Code Duplication    Length = 3-6 lines in 5 locations

main/inc/ajax/announcement.ajax.php 1 location

@@ 21-23 (lines=3) @@
18
                return false;
19
            }
20
21
            if (api_get_session_id() != 0 && api_is_allowed_to_session_edit(false, true) == false) {
22
                return false;
23
            }
24
25
            $list = explode(',', $_REQUEST['id']);
26
            foreach ($list as $itemId) {

main/forum/index.php 1 location

@@ 125-130 (lines=6) @@
122
123
// Notification
124
if ($actions == 'notify' && isset($_GET['content']) && isset($_GET['id'])) {
125
    if (
126
        api_get_session_id() != 0 &&
127
        api_is_allowed_to_session_edit(false, true) == false
128
    ) {
129
        api_not_allowed();
130
    }
131
    $return_message = set_notification($_GET['content'], $_GET['id']);
132
    echo Display::return_message($return_message, 'confirm', false);
133
}

main/wiki/wiki.inc.php 3 locations

@@ 3345-3349 (lines=5) @@
3342
        $groupfilter = $this->groupfilter;
3343
        $tbl_wiki_discuss = $this->tbl_wiki_discuss;
3344
3345
        if (api_get_session_id() != 0 &&
3346
            api_is_allowed_to_session_edit(false, true) == false
3347
        ) {
3348
            api_not_allowed();
3349
        }
3350
3351
        if (!$_GET['title']) {
3352
            Display::addFlash(Display::return_message(get_lang("MustSelectPage"), 'error', false));
@@ 4924-4928 (lines=5) @@
4921
        $groupId = $this->group_id;
4922
        $userId = api_get_user_id();
4923
4924
        if (api_get_session_id() != 0 &&
4925
            api_is_allowed_to_session_edit(false, true) == false
4926
        ) {
4927
            api_not_allowed();
4928
        }
4929
4930
        $sql = 'SELECT *
4931
                FROM '.$tbl_wiki.' w INNER JOIN '.$tbl_wiki_conf.' c
@@ 5590-5592 (lines=3) @@
5587
                self::getLinks($page);
5588
                break;
5589
            case 'addnew':
5590
                if (api_get_session_id() != 0 && api_is_allowed_to_session_edit(false, true) == false) {
5591
                    api_not_allowed();
5592
                }
5593
                $groupInfo = GroupManager::get_group_properties(api_get_group_id());
5594
                echo '<div class="actions">'.get_lang('AddNew').'</div>';
5595
                echo '<br/>';