Code Duplication    Length = 7-7 lines in 2 locations

viewcats.php 1 location

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

modify.php 1 location

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