Code Duplication    Length = 11-12 lines in 2 locations

main/wiki/wiki.inc.php 2 locations

@@ 4327-4337 (lines=11) @@
4324
            if ($current_row['group_id'] != 0) {
4325
                $groupInfo = GroupManager::get_group_properties($this->group_id);
4326
                //Only teacher, platform admin and group members can edit a wiki group
4327
                if (api_is_allowed_to_edit(false, true) ||
4328
                    api_is_platform_admin() ||
4329
                    GroupManager::is_user_in_group($userId, $groupInfo) ||
4330
                    api_is_allowed_in_course()
4331
                ) {
4332
                    $PassEdit = true;
4333
                } else {
4334
                    Display::addFlash(
4335
                        Display::return_message(get_lang('OnlyEditPagesGroupMembers'), 'normal', false)
4336
                    );
4337
                }
4338
            } else {
4339
                $PassEdit = true;
4340
            }
@@ 4979-4990 (lines=12) @@
4976
            if (!empty($groupId)) {
4977
                $groupInfo = GroupManager::get_group_properties($groupId);
4978
                //Only teacher, platform admin and group members can edit a wiki group
4979
                if (api_is_allowed_to_edit(false, true) ||
4980
                    api_is_platform_admin() ||
4981
                    GroupManager::is_user_in_group($userId, $groupInfo)
4982
                ) {
4983
                    $PassEdit = true;
4984
                } else {
4985
                    Display::addFlash(
4986
                        Display::return_message(
4987
                            get_lang('OnlyEditPagesGroupMembers')
4988
                        )
4989
                    );
4990
                }
4991
            } else {
4992
                $PassEdit = true;
4993
            }