Completed
Push — master ( c8eead...62889a )
by Michael
04:13
created

admin/permissions.php (5 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/*
3
 You may not change or alter any portion of this comment or credits
4
 of supporting developers from this source code or any supporting source code
5
 which is considered copyrighted (c) material of the original comment or credit authors.
6
7
 This program is distributed in the hope that it will be useful,
8
 but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
*/
11
/**
12
 * xdirectory module for xoops
13
 *
14
 * @copyright       The TXMod XOOPS Project http://sourceforge.net/projects/thmod/
15
 * @copyright       The XOOPS Project http://sourceforge.net/projects/xoops/
16
 * @license         GPL 2.0 or later
17
 * @package         xdirectory
18
 * @since           2.5.x
19
 * @author          XOOPS Development Team ( [email protected] ) - ( http://xoops.org )
20
 * @version         $Id: const_entete.php 9860 2012-07-13 10:41:41Z txmodxoops $
21
 */
22
23
include_once __DIR__ . '/admin_header.php';
24
//xoops_cp_header();
25
include_once XOOPS_ROOT_PATH . "/class/xoopsform/grouppermform.php";
26
//include_once XOOPS_ROOT_PATH."/class/xoopsform/FormHiddenToken.php";
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

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.

Loading history...
27
28
if (!empty($_POST["submit"])) {
29
    redirect_header(XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/admin/permissions.php", 1, _MP_GPERMUPDATED);
30
}
31
32
$permissions_admin = new ModuleAdmin();
33
echo $permissions_admin->addNavigation("permissions.php");
34
35
$permission                = animal_CleanVars($_POST, 'permission', 1, 'int');
36
$selected                  = array("", "", "");
37
$selected[$permission - 1] = " selected";
38
39
echo "
40
<form method=\"post\" name=\"fselperm\" action=\"permissions.php\">
41
    <table border=0>
42
        <tr>
43
            <td>
44
                <select name=\"permission\" onChange=\"document.fselperm.submit()\">
45
                    <option value=\"1\"" . $selected[0] . ">" . _AM_PEDIGREE_PERMISSIONS_ACCESS . "</option>
46
                    <option value=\"2\"" . $selected[1] . ">" . _AM_PEDIGREE_PERMISSIONS_SUBMIT . "</option>
47
                    <option value=\"3\"" . $selected[2] . ">" . _AM_PEDIGREE_PERMISSIONS_VIEW . "</option>
48
                </select>
49
            </td>
50
        </tr>
51
    </table>
52
</form>";
53
54
$module_id = $xoopsModule->getVar("mid");
55
56
switch ($permission) {
57
    case 1:
58
        $formTitle = _AM_PEDIGREE_PERMISSIONS_ACCESS;
59
        $permName  = "xdirectory_access";
60
        $permDesc  = "";
61
        break;
62
    case 2:
63
        $formTitle = _AM_PEDIGREE_PERMISSIONS_SUBMIT;
64
        $permName  = "xdirectory_submit";
65
        $permDesc  = "";
66
        break;
67
    case 3:
68
        $formTitle = _AM_PEDIGREE_PERMISSIONS_VIEW;
69
        $permName  = "xdirectory_view";
70
        $permDesc  = "";
71
        break;
72
}
73
74
$permform = new XoopsGroupPermForm($formTitle, $module_id, $permName, $permDesc, "admin/permissions.php");
75
//	$xdir_cat_Handler=& xoops_getModuleHandler('xdirectory_xdir_cat', $xoopsModule->getVar("dirname"));
0 ignored issues
show
Unused Code Comprehensibility introduced by
67% of this comment could be valid code. Did you maybe forget this after debugging?

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.

Loading history...
76
$criteria = new CriteriaCompo();
77
$criteria->setSort('title');
78
$criteria->setOrder('ASC');
79
//    $xdir_cat_arr = $xdir_cat_Handler->getObjects($criteria);
0 ignored issues
show
Unused Code Comprehensibility introduced by
59% of this comment could be valid code. Did you maybe forget this after debugging?

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.

Loading history...
80
81
//foreach (array_keys($xdir_cat_arr) as $xdir_cat_id => $xdir_cat)
0 ignored issues
show
Unused Code Comprehensibility introduced by
63% of this comment could be valid code. Did you maybe forget this after debugging?

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.

Loading history...
82
foreach (array_keys($xdir_cat_arr) as $i) {
83
    //$permform->addItem($xdir_cat_id, $xdir_cat["xdir_cat_title"], $xdir_cat["xdir_cat_pid"]);
0 ignored issues
show
Unused Code Comprehensibility introduced by
85% of this comment could be valid code. Did you maybe forget this after debugging?

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.

Loading history...
84
    $permform->addItem($xdir_cat_arr[$i]->getVar('cid'), $xdir_cat_arr[$i]->getVar('title'));
85
}
86
echo $permform->render();
87
echo "<br /><br /><br /><br />\n";
88
unset ($permform);
89
90
include_once __DIR__ . '/admin_footer.php';
91