Code Duplication    Length = 11-12 lines in 2 locations

main/wiki/wiki.inc.php 2 locations

@@ 4784-4794 (lines=11) @@
4781
                    $this->group_id
4782
                );
4783
                //Only teacher, platform admin and group members can edit a wiki group
4784
                if (api_is_allowed_to_edit(false, true) ||
4785
                    api_is_platform_admin() ||
4786
                    GroupManager::is_user_in_group($userId, $groupInfo) ||
4787
                    api_is_allowed_in_course()
4788
                ) {
4789
                    $PassEdit = true;
4790
                } else {
4791
                    Display::addFlash(
4792
                        Display::return_message(
4793
                            get_lang('OnlyEditPagesGroupMembers'),
4794
                            'normal',
4795
                            false
4796
                        )
4797
                    );
@@ 5560-5571 (lines=12) @@
5557
            if (!empty($groupId)) {
5558
                $groupInfo = GroupManager::get_group_properties($groupId);
5559
                //Only teacher, platform admin and group members can edit a wiki group
5560
                if (api_is_allowed_to_edit(false, true) ||
5561
                    api_is_platform_admin() ||
5562
                    GroupManager::is_user_in_group($userId, $groupInfo)
5563
                ) {
5564
                    $PassEdit = true;
5565
                } else {
5566
                    Display::addFlash(
5567
                        Display::return_message(
5568
                            get_lang('OnlyEditPagesGroupMembers')
5569
                        )
5570
                    );
5571
                }
5572
            } else {
5573
                $PassEdit = true;
5574
            }