mambax7 /
smartfaq
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | |||
| 3 | /** |
||
| 4 | * Module: SmartFAQ |
||
| 5 | * Author: The SmartFactory <www.smartfactory.ca> |
||
| 6 | * Licence: GNU |
||
| 7 | */ |
||
| 8 | |||
| 9 | include_once __DIR__ . '/admin_header.php'; |
||
| 10 | include_once XOOPS_ROOT_PATH . '/class/xoopsform/grouppermform.php'; |
||
| 11 | |||
| 12 | if (!sf_userIsAdmin()) { |
||
| 13 | redirect_header('javascript:history.go(-1)', 1, _NOPERM); |
||
| 14 | } |
||
| 15 | |||
| 16 | $op = ''; |
||
| 17 | |||
| 18 | foreach ($_POST as $k => $v) { |
||
| 19 | ${$k} = $v; |
||
| 20 | } |
||
| 21 | |||
| 22 | foreach ($_GET as $k => $v) { |
||
| 23 | ${$k} = $v; |
||
| 24 | } |
||
| 25 | |||
| 26 | switch ($op) { |
||
| 27 | case 'default': |
||
| 28 | default: |
||
| 29 | global $xoopsDB, $xoopsModule; |
||
| 30 | |||
| 31 | $indexAdmin = new ModuleAdmin(); |
||
| 32 | xoops_cp_header(); |
||
| 33 | echo $indexAdmin->addNavigation(basename(__FILE__)); |
||
| 34 | // View Categories permissions |
||
| 35 | $item_list_view = array(); |
||
| 36 | $block_view = array(); |
||
| 37 | // echo "<h3 style='color: #2F5376; '>"._AM_SF_PERMISSIONSADMIN."</h3>\n" ; |
||
|
0 ignored issues
–
show
|
|||
| 38 | sf_collapsableBar('toptable', 'toptableicon'); |
||
| 39 | |||
| 40 | $result_view = $xoopsDB->query('SELECT categoryid, name FROM ' . $xoopsDB->prefix('smartfaq_categories') . ' '); |
||
| 41 | if ($xoopsDB->getRowsNum($result_view)) { |
||
| 42 | while ($myrow_view = $xoopsDB->fetcharray($result_view)) { |
||
| 43 | $item_list_view['cid'] = $myrow_view['categoryid']; |
||
| 44 | $item_list_view['title'] = $myrow_view['name']; |
||
| 45 | $form_view = new XoopsGroupPermForm('', $xoopsModule->getVar('mid'), 'category_read', "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt='' /></a> " . _AM_SF_PERMISSIONSVIEWMAN . "</h3><div id='toptable'><span style=\"color: #567; margin: 3px 0 0 0; font-size: small; display: block; \">" . _AM_SF_VIEW_CATS . '</span>', 'admin/permissions.php'); |
||
| 46 | $block_view[] = $item_list_view; |
||
| 47 | foreach ($block_view as $itemlists) { |
||
| 48 | $form_view->addItem($itemlists['cid'], $myts->displayTarea($itemlists['title'])); |
||
| 49 | } |
||
| 50 | } |
||
| 51 | echo $form_view->render(); |
||
| 52 | } else { |
||
| 53 | echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt='' /></a> " . _AM_SF_PERMISSIONSVIEWMAN . "</h3><div id='toptable'><span style=\"color: #567; margin: 3px 0 0 0; font-size: small; display: block; \">" . _AM_SF_NOPERMSSET . '</span>'; |
||
| 54 | } |
||
| 55 | echo '</div>'; |
||
| 56 | |||
| 57 | echo "<br />\n"; |
||
| 58 | } |
||
| 59 | |||
| 60 | include_once __DIR__ . '/admin_footer.php'; |
||
| 61 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.