1
|
|
|
<?php declare(strict_types=1); |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* Module: SmartFAQ |
5
|
|
|
* Author: The SmartFactory <www.smartfactory.ca> |
6
|
|
|
* Licence: GNU |
7
|
|
|
*/ |
8
|
|
|
|
9
|
|
|
use Xmf\Module\Admin; |
10
|
|
|
use XoopsModules\Smartfaq; |
11
|
|
|
|
12
|
|
|
require_once __DIR__ . '/admin_header.php'; |
13
|
|
|
|
14
|
|
|
if (!Smartfaq\Utility::userIsAdmin()) { |
15
|
|
|
redirect_header('<script>javascript:history.go(-1)</script>', 1, _NOPERM); |
16
|
|
|
} |
17
|
|
|
|
18
|
|
|
$op = ''; |
19
|
|
|
|
20
|
|
|
foreach ($_POST as $k => $v) { |
21
|
|
|
${$k} = $v; |
22
|
|
|
} |
23
|
|
|
|
24
|
|
|
foreach ($_GET as $k => $v) { |
25
|
|
|
${$k} = $v; |
26
|
|
|
} |
27
|
|
|
|
28
|
|
|
switch ($op) { |
29
|
|
|
case 'default': |
30
|
|
|
default: |
31
|
|
|
global $xoopsDB, $xoopsModule; |
32
|
|
|
|
33
|
|
|
$adminObject = Admin::getInstance(); |
34
|
|
|
xoops_cp_header(); |
35
|
|
|
$adminObject->displayNavigation(basename(__FILE__)); |
36
|
|
|
// View Categories permissions |
37
|
|
|
$item_list_view = []; |
38
|
|
|
$block_view = []; |
39
|
|
|
// echo "<h3 style='color: #2F5376; '>"._AM_SF_PERMISSIONSADMIN."</h3>\n" ; |
40
|
|
|
Smartfaq\Utility::collapsableBar('toptable', 'toptableicon'); |
41
|
|
|
|
42
|
|
|
$result_view = $xoopsDB->query('SELECT categoryid, name FROM ' . $xoopsDB->prefix('smartfaq_categories') . ' '); |
43
|
|
|
if ($xoopsDB->getRowsNum($result_view)) { |
44
|
|
|
while (false !== ($myrow_view = $xoopsDB->fetchArray($result_view))) { |
45
|
|
|
$item_list_view['cid'] = $myrow_view['categoryid']; |
46
|
|
|
$item_list_view['title'] = $myrow_view['name']; |
47
|
|
|
$form_view = new Smartfaq\GroupPermForm( |
48
|
|
|
'', |
49
|
|
|
$xoopsModule->getVar('mid'), |
50
|
|
|
'category_read', |
51
|
|
|
"<img id='toptableicon' src=" |
52
|
|
|
. XOOPS_URL |
53
|
|
|
. '/modules/' |
54
|
|
|
. $xoopsModule->dirname() |
55
|
|
|
. "/assets/images/icon/close12.gif alt=''></a> " |
56
|
|
|
. _AM_SF_PERMISSIONSVIEWMAN |
57
|
|
|
. "</h3><div id='toptable'><span style=\"color: #567; margin: 3px 0 0 0; font-size: small; display: block; \">" |
58
|
|
|
. _AM_SF_VIEW_CATS |
59
|
|
|
. '</span>', |
60
|
|
|
'admin/permissions.php' |
|
|
|
|
61
|
|
|
); |
62
|
|
|
$block_view[] = $item_list_view; |
63
|
|
|
foreach ($block_view as $itemlists) { |
64
|
|
|
$form_view->addItem($itemlists['cid'], $myts->displayTarea($itemlists['title'])); |
65
|
|
|
} |
66
|
|
|
} |
67
|
|
|
echo $form_view->render(); |
68
|
|
|
} else { |
69
|
|
|
echo "<img id='toptableicon' src=" |
70
|
|
|
. XOOPS_URL |
71
|
|
|
. '/modules/' |
72
|
|
|
. $xoopsModule->dirname() |
73
|
|
|
. "/assets/images/icon/close12.gif alt=''></a> " |
74
|
|
|
. _AM_SF_PERMISSIONSVIEWMAN |
75
|
|
|
. "</h3><div id='toptable'><span style=\"color: #567; margin: 3px 0 0 0; font-size: small; display: block; \">" |
76
|
|
|
. _AM_SF_NOPERMSSET |
77
|
|
|
. '</span>'; |
78
|
|
|
} |
79
|
|
|
echo '</div>'; |
80
|
|
|
|
81
|
|
|
echo "<br>\n"; |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
require_once __DIR__ . '/admin_footer.php'; |
85
|
|
|
|
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.