Code Duplication    Length = 7-7 lines in 2 locations

viewcats.php 1 location

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

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 = AdslightUtilities::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
161
    if ($GLOBALS['xoopsUser']) {