Code Duplication    Length = 10-15 lines in 2 locations

main/wiki/wiki.inc.php 2 locations

@@ 4814-4823 (lines=10) @@
4811
                    )
4812
                );
4813
            } elseif ($current_row['assignment'] == 2) {
4814
                if (($userId == $current_row['user_id']) == false) {
4815
                    if (api_is_allowed_to_edit(false, true) || api_is_platform_admin()) {
4816
                        $PassEdit = true;
4817
                    } else {
4818
                        Display::addFlash(
4819
                            Display::return_message(
4820
                                get_lang('LockByTeacher'),
4821
                                'normal',
4822
                                false
4823
                            )
4824
                        );
4825
                        $PassEdit = false;
4826
                    }
@@ 5596-5610 (lines=15) @@
5593
                    '',
5594
                    ICON_SIZE_SMALL
5595
                );
5596
                if (($userId == $row['user_id']) == false) {
5597
                    if (api_is_allowed_to_edit(false, true) || api_is_platform_admin()) {
5598
                        $PassEdit = true;
5599
                    } else {
5600
                        Display::addFlash(
5601
                            Display::return_message(
5602
                                get_lang('LockByTeacher'),
5603
                                'warning'
5604
                            )
5605
                        );
5606
                        $PassEdit = false;
5607
                    }
5608
                } else {
5609
                    $PassEdit = true;
5610
                }
5611
            }
5612
5613
            if ($PassEdit) {