Code Duplication    Length = 3-3 lines in 11 locations

addlisting.php 1 location

@@ 43-45 (lines=3) @@
40
} else {
41
    $perm_itemid = 0;
42
}
43
if (!$gperm_handler->checkRight('adslight_submit', $perm_itemid, $groups, $module_id)) {
44
    redirect_header(XOOPS_URL . '/index.php', 3, _NOPERM);
45
}
46
if (!$gperm_handler->checkRight('adslight_premium', $perm_itemid, $groups, $module_id)) {
47
    $premium = 0;
48
} else {

contact.php 2 locations

@@ 53-55 (lines=3) @@
50
        $perm_itemid = 0;
51
    }
52
    //If no access
53
    if (!$gperm_handler->checkRight('adslight_view', $perm_itemid, $groups, $module_id)) {
54
        redirect_header(XOOPS_URL . '/index.php', 3, _NOPERM);
55
    }
56
    global $xoopsConfig, $xoopsModuleConfig, $xoopsDB, $myts, $meta;
57
    require_once XOOPS_ROOT_PATH . '/modules/adslight/include/gtickets.php';
58
@@ 174-176 (lines=3) @@
171
        $perm_itemid = 0;
172
    }
173
    //If no access
174
    if (!$gperm_handler->checkRight('adslight_view', $perm_itemid, $groups, $module_id)) {
175
        redirect_header(XOOPS_URL . '/index.php', 3, _NOPERM);
176
    }
177
178
    require_once XOOPS_ROOT_PATH . '/modules/adslight/include/gtickets.php';
179
    include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';

index.php 1 location

@@ 35-37 (lines=3) @@
32
33
isset($_POST['item_id']) ? $perm_itemid = (int)$_POST['item_id'] : $perm_itemid = 0;
34
35
if (!$gperm_handler->checkRight('adslight_view', $perm_itemid, $groups, $module_id)) {
36
    redirect_header(XOOPS_URL . '/index.php', 3, _NOPERM);
37
}
38
39
(!$gperm_handler->checkRight('adslight_premium', $perm_itemid, $groups, $module_id)) ? $prem_perm = '0' : $prem_perm = '1';
40

maps.php 1 location

@@ 41-43 (lines=3) @@
38
    $perm_itemid = 0;
39
}
40
//If no access
41
if (!$gperm_handler->checkRight('adslight_view', $perm_itemid, $groups, $module_id)) {
42
    redirect_header(XOOPS_URL . '/index.php', 3, _NOPERM);
43
}
44
if (!$gperm_handler->checkRight('adslight_premium', $perm_itemid, $groups, $module_id)) {
45
    $prem_perm = '0';
46
} else {

viewads.php 1 location

@@ 41-43 (lines=3) @@
38
    $perm_itemid = 0;
39
}
40
//If no access
41
if (!$gperm_handler->checkRight('adslight_view', $perm_itemid, $groups, $module_id)) {
42
    redirect_header(XOOPS_URL . '/index.php', 3, _NOPERM);
43
}
44
if (!$gperm_handler->checkRight('adslight_premium', $perm_itemid, $groups, $module_id)) {
45
    $prem_perm = '0';
46
} else {

viewcats.php 1 location

@@ 41-43 (lines=3) @@
38
    $perm_itemid = 0;
39
}
40
41
if (!$gperm_handler->checkRight('adslight_view', $perm_itemid, $groups, $module_id)) {
42
    redirect_header(XOOPS_URL . '/index.php', 3, _NOPERM);
43
}
44
if (!$gperm_handler->checkRight('adslight_premium', $perm_itemid, $groups, $module_id)) {
45
    $prem_perm = '0';
46
} else {

add.php 1 location

@@ 39-41 (lines=3) @@
36
$gperm_handler = xoops_getHandler('groupperm');
37
$perm_itemid   = XoopsRequest::getInt('item_id', 0, 'POST');
38
39
if (!$gperm_handler->checkRight('adslight_submit', $perm_itemid, $groups, $module_id)) {
40
    redirect_header(XOOPS_URL . '/index.php', 3, _NOPERM);
41
}
42
43
$premium = $gperm_handler->checkRight('adslight_premium', $perm_itemid, $groups, $module_id) ? 1 : 0;
44

modify.php 1 location

@@ 35-37 (lines=3) @@
32
$perm_itemid   = XoopsRequest::getInt('item_id', 0, 'POST');
33
34
//If no access
35
if (!$gperm_handler->checkRight('adslight_submit', $perm_itemid, $groups, $module_id)) {
36
    redirect_header(XOOPS_URL . '/modules/adslight/index.php', 3, _NOPERM);
37
}
38
39
/**
40
 * @param $lid

replies.php 1 location

@@ 33-35 (lines=3) @@
30
$perm_itemid   = XoopsRequest::getInt('item_id', 0, 'POST');
31
32
//If no access
33
if (!$gperm_handler->checkRight('adslight_premium', $perm_itemid, $groups, $module_id)) {
34
    redirect_header(XOOPS_URL . '/modules/adslight/index.php', 3, _NOPERM);
35
}
36
include_once XOOPS_ROOT_PATH . '/modules/adslight/class/classifiedstree.php';
37
$mytree = new ClassifiedsTree($xoopsDB->prefix('adslight_categories'), 'cid', 'pid');
38

tips_writing_ad.php 1 location

@@ 33-35 (lines=3) @@
30
$gperm_handler = xoops_getHandler('groupperm');
31
$perm_itemid   = XoopsRequest::getInt('item_id', 0, 'POST');
32
//If no access
33
if (!$gperm_handler->checkRight('adslight_view', $perm_itemid, $groups, $module_id)) {
34
    redirect_header(XOOPS_URL . '/index.php', 3, _NOPERM);
35
}
36
$prem_perm = $gperm_handler->checkRight('adslight_premium', $perm_itemid, $groups, $module_id) ? '1' : '0';
37
38
#  function tips_writing