Code Duplication    Length = 7-7 lines in 2 locations

modify.php 1 location

@@ 152-158 (lines=7) @@
149
    list($lid, $cide, $title, $status, $expire, $type, $desctext, $tel, $price, $typeprice, $typeusure, $date, $email, $submitter, $usid, $town, $country, $contactby, $premium, $valid) = $xoopsDB->fetchRow($result);
150
151
    $categories = AdslightUtility::getMyItemIds('adslight_submit');
152
    if (is_array($categories) && count($categories) > 0) {
153
        if (!in_array($cide, $categories)) {
154
            redirect_header(XOOPS_URL . '/modules/adslight/index.php', 3, _NOPERM);
155
        }
156
    } else {    // User can't see any category
157
        redirect_header(XOOPS_URL . '/index.php', 3, _NOPERM);
158
    }
159
160
    if ($GLOBALS['xoopsUser']) {
161
        $calusern = $GLOBALS['xoopsUser']->uid();

viewcats.php 1 location

@@ 145-151 (lines=7) @@
142
    $xoopsTpl->assign('subcat_title2', _ADSLIGHT_ANNONCES);
143
144
    $categories = AdslightUtility::getMyItemIds('adslight_view');
145
    if (is_array($categories) && count($categories) > 0) {
146
        if (!in_array($cid, $categories)) {
147
            redirect_header(XOOPS_URL . '/modules/adslight/index.php', 3, _NOPERM);
148
        }
149
    } else {    // User can't see any category
150
        redirect_header(XOOPS_URL . '/index.php', 3, _NOPERM);
151
    }
152
153
    $arrow = '<img src="' . XOOPS_URL . '/modules/adslight/assets/images/arrow.gif" alt="&raquo;" >';
154