Code Duplication    Length = 5-5 lines in 9 locations

addlisting.php 1 location

@@ 32-36 (lines=5) @@
29
//$erh = new ErrorHandler; //ErrorHandler object
30
31
$module_id = $xoopsModule->getVar('mid');
32
if (is_object($GLOBALS['xoopsUser'])) {
33
    $groups = $GLOBALS['xoopsUser']->getGroups();
34
} else {
35
    $groups = XOOPS_GROUP_ANONYMOUS;
36
}
37
$gpermHandler = xoops_getHandler('groupperm');
38
$perm_itemid = XoopsRequest::getInt('item_id', 0, 'POST');
39
if (!$gpermHandler->checkRight('adslight_submit', $perm_itemid, $groups, $module_id)) {

contact.php 2 locations

@@ 39-43 (lines=5) @@
36
37
    $module_id = $xoopsModule->getVar('mid');
38
39
    if (is_object($GLOBALS['xoopsUser'])) {
40
        $groups = $GLOBALS['xoopsUser']->getGroups();
41
    } else {
42
        $groups = XOOPS_GROUP_ANONYMOUS;
43
    }
44
45
    $gpermHandler = xoops_getHandler('groupperm');
46
@@ 155-159 (lines=5) @@
152
    global $xoopsConfig, $xoopsDB, $myts, $meta;
153
154
    $module_id = $xoopsModule->getVar('mid');
155
    if (is_object($GLOBALS['xoopsUser'])) {
156
        $groups = $GLOBALS['xoopsUser']->getGroups();
157
    } else {
158
        $groups = XOOPS_GROUP_ANONYMOUS;
159
    }
160
    $gpermHandler = xoops_getHandler('groupperm');
161
    $perm_itemid  = XoopsRequest::getInt('item_id', 0, 'POST');
162
    //If no access

maps.php 1 location

@@ 29-33 (lines=5) @@
26
$myts      = MyTextSanitizer::getInstance();
27
$module_id = $xoopsModule->getVar('mid');
28
29
if (is_object($GLOBALS['xoopsUser'])) {
30
    $groups = $GLOBALS['xoopsUser']->getGroups();
31
} else {
32
    $groups = XOOPS_GROUP_ANONYMOUS;
33
}
34
$gpermHandler = xoops_getHandler('groupperm');
35
$perm_itemid = XoopsRequest::getInt('item_id', 0, 'POST');
36
//If no access

viewads.php 2 locations

@@ 30-34 (lines=5) @@
27
$myts      = MyTextSanitizer::getInstance();
28
$module_id = $xoopsModule->getVar('mid');
29
30
if (is_object($GLOBALS['xoopsUser'])) {
31
    $groups = $GLOBALS['xoopsUser']->getGroups();
32
} else {
33
    $groups = XOOPS_GROUP_ANONYMOUS;
34
}
35
$gpermHandler = xoops_getHandler('groupperm');
36
$perm_itemid = XoopsRequest::getInt('item_id', 0, 'POST');
37
//If no access
@@ 162-166 (lines=5) @@
159
        $xoopsTpl->assign('category_title', $ctitle);
160
161
        $module_id = $xoopsModule->getVar('mid');
162
        if (is_object($GLOBALS['xoopsUser'])) {
163
            $groups = $GLOBALS['xoopsUser']->getGroups();
164
        } else {
165
            $groups = XOOPS_GROUP_ANONYMOUS;
166
        }
167
        $gpermHandler = xoops_getHandler('groupperm');
168
        $xoopsTpl->assign('purchasable', $gpermHandler->checkRight('adslight_purchase', $cid, $groups, $module_id));
169

viewcats.php 1 location

@@ 30-34 (lines=5) @@
27
$myts           = MyTextSanitizer::getInstance();
28
$module_id      = $xoopsModule->getVar('mid');
29
30
if (is_object($GLOBALS['xoopsUser'])) {
31
    $groups = $GLOBALS['xoopsUser']->getGroups();
32
} else {
33
    $groups = XOOPS_GROUP_ANONYMOUS;
34
}
35
$gpermHandler = xoops_getHandler('groupperm');
36
37
$perm_itemid = XoopsRequest::getInt('item_id', 0, 'POST');

members.php 1 location

@@ 39-43 (lines=5) @@
36
$lid       = XoopsRequest::getInt('lid', 0, 'GET');
37
$usid      = XoopsRequest::getInt('usid', 0, 'GET');
38
$module_id = $xoopsModule->getVar('mid');
39
if (is_object($GLOBALS['xoopsUser'])) {
40
    $groups = $GLOBALS['xoopsUser']->getGroups();
41
} else {
42
    $groups = XOOPS_GROUP_ANONYMOUS;
43
}
44
$gpermHandler = xoops_getHandler('groupperm');
45
$perm_itemid  = XoopsRequest::getInt('item_id', 0, 'POST');
46

modify.php 1 location

@@ 336-340 (lines=5) @@
333
            echo "<input type=\"hidden\" name=\"op\" value=\"ModAdS\" />";
334
335
            $module_id = $xoopsModule->getVar('mid');
336
            if (is_object($GLOBALS['xoopsUser'])) {
337
                $groups =& $GLOBALS['xoopsUser']->getGroups();
338
            } else {
339
                $groups = XOOPS_GROUP_ANONYMOUS;
340
            }
341
            $gpermHandler = xoops_getHandler('groupperm');
342
            $perm_itemid = XoopsRequest::getInt('item_id', 0, 'POST');
343
            //If no access