This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
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 | /** |
||||||
13 | * @copyright XOOPS Project (https://xoops.org) |
||||||
14 | * @license http://www.gnu.org/licenses/gpl-2.0.html GNU Public License |
||||||
15 | * @package Mymenus |
||||||
16 | * @since 1.0 |
||||||
17 | * @author trabis <[email protected]> |
||||||
18 | */ |
||||||
19 | |||||||
20 | use Xmf\Request; |
||||||
0 ignored issues
–
show
|
|||||||
21 | |||||||
22 | $currentFile = basename(__FILE__); |
||||||
23 | require __DIR__ . '/admin_header.php'; |
||||||
24 | |||||||
25 | $op = Request::getString('op', 'list'); |
||||||
26 | switch ($op) { |
||||||
27 | case 'list': |
||||||
28 | default: |
||||||
29 | $apply_filter = Request::getBool('apply_filter', false); |
||||||
30 | // admin navigation |
||||||
31 | xoops_cp_header(); |
||||||
0 ignored issues
–
show
The function
xoops_cp_header was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
32 | $adminObject = \Xmf\Module\Admin::getInstance(); |
||||||
0 ignored issues
–
show
The type
Xmf\Module\Admin was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||||||
33 | $adminObject->displayNavigation($currentFile); |
||||||
34 | // buttons |
||||||
35 | if (true === $apply_filter) { |
||||||
36 | $adminObject->addItemButton(_LIST, '?op=list', 'list'); |
||||||
0 ignored issues
–
show
|
|||||||
37 | } |
||||||
38 | $adminObject->addItemButton(_ADD, $currentFile . '?op=edit', 'add'); |
||||||
0 ignored issues
–
show
|
|||||||
39 | $adminObject->displayButton('left'); |
||||||
40 | // |
||||||
41 | $menusCount = $helper->getHandler('Menus')->getCount(); |
||||||
42 | $GLOBALS['xoopsTpl']->assign('menusCount', $menusCount); |
||||||
43 | // |
||||||
44 | if ($menusCount > 0) { |
||||||
45 | // get filter parameters |
||||||
46 | $filter_menus_title_condition = Request::getString('filter_menus_title_condition', ''); |
||||||
47 | $filter_menus_title = Request::getString('filter_menus_title', ''); |
||||||
48 | // |
||||||
49 | $menusCriteria = new \CriteriaCompo(); |
||||||
0 ignored issues
–
show
The type
CriteriaCompo was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||||||
50 | // |
||||||
51 | if (true === $apply_filter) { |
||||||
52 | // evaluate title criteria |
||||||
53 | if ('' !== $filter_menus_title) { |
||||||
54 | switch ($filter_menus_title_condition) { |
||||||
55 | case 'CONTAINS': |
||||||
56 | default: |
||||||
57 | $pre = '%'; |
||||||
58 | $post = '%'; |
||||||
59 | $function = 'LIKE'; |
||||||
60 | break; |
||||||
61 | case 'MATCHES': |
||||||
62 | $pre = ''; |
||||||
63 | $post = ''; |
||||||
64 | $function = '='; |
||||||
65 | break; |
||||||
66 | case 'STARTSWITH': |
||||||
67 | $pre = ''; |
||||||
68 | $post = '%'; |
||||||
69 | $function = 'LIKE'; |
||||||
70 | break; |
||||||
71 | case 'ENDSWITH': |
||||||
72 | $pre = '%'; |
||||||
73 | $post = ''; |
||||||
74 | $function = 'LIKE'; |
||||||
75 | break; |
||||||
76 | } |
||||||
77 | $menusCriteria->add(new \Criteria('title', $pre . $filter_menus_title . $post, $function)); |
||||||
0 ignored issues
–
show
The type
Criteria was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||||||
78 | } |
||||||
79 | } |
||||||
80 | $GLOBALS['xoopsTpl']->assign('apply_filter', $apply_filter); |
||||||
81 | $menusFilterCount = $helper->getHandler('Menus')->getCount($menusCriteria); |
||||||
82 | $GLOBALS['xoopsTpl']->assign('menusFilterCount', $menusFilterCount); |
||||||
83 | // |
||||||
84 | $menusCriteria->setSort('id'); |
||||||
85 | $menusCriteria->setOrder('ASC'); |
||||||
86 | // |
||||||
87 | $start = Request::getInt('start', 0); |
||||||
88 | $limit = $helper->getConfig('admin_perpage'); |
||||||
89 | $menusCriteria->setStart($start); |
||||||
90 | $menusCriteria->setLimit($limit); |
||||||
91 | // |
||||||
92 | if ($menusFilterCount > $limit) { |
||||||
93 | xoops_load('XoopsPagenav'); |
||||||
0 ignored issues
–
show
The function
xoops_load was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
94 | $linklist = "op={$op}"; |
||||||
95 | $linklist .= "&filter_menus_title_condition={$filter_menus_title_condition}"; |
||||||
96 | $linklist .= "&filter_menus_title={$filter_menus_title}"; |
||||||
97 | $pagenavObj = new \XoopsPageNav($itemFilterCount, $limit, $start, 'start', $linklist); |
||||||
0 ignored issues
–
show
The type
XoopsPageNav was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||||||
98 | $pagenav = $pagenavObj->renderNav(4); |
||||||
99 | } else { |
||||||
100 | $pagenav = ''; |
||||||
101 | } |
||||||
102 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav); |
||||||
103 | // |
||||||
104 | $filter_menus_title_condition_select = new \XoopsFormSelect(_AM_MYMENUS_MENU_TITLE, 'filter_menus_title_condition', $filter_menus_title_condition, 1, false); |
||||||
0 ignored issues
–
show
The type
XoopsFormSelect was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||||||
105 | $filter_menus_title_condition_select->addOption('CONTAINS', _CONTAINS); |
||||||
0 ignored issues
–
show
|
|||||||
106 | $filter_menus_title_condition_select->addOption('MATCHES', _MATCHES); |
||||||
0 ignored issues
–
show
|
|||||||
107 | $filter_menus_title_condition_select->addOption('STARTSWITH', _STARTSWITH); |
||||||
0 ignored issues
–
show
|
|||||||
108 | $filter_menus_title_condition_select->addOption('ENDSWITH', _ENDSWITH); |
||||||
0 ignored issues
–
show
|
|||||||
109 | $GLOBALS['xoopsTpl']->assign('filter_menus_title_condition_select', $filter_menus_title_condition_select->render()); |
||||||
110 | $GLOBALS['xoopsTpl']->assign('filter_menus_title_condition', $filter_menus_title_condition); |
||||||
111 | $GLOBALS['xoopsTpl']->assign('filter_menus_title', $filter_menus_title); |
||||||
112 | // |
||||||
113 | $menusObjs = $helper->getHandler('Menus')->getObjects($menusCriteria); |
||||||
114 | foreach ($menusObjs as $menusObj) { |
||||||
115 | $menusObjArray = $menusObj->getValues(); // as array |
||||||
116 | $GLOBALS['xoopsTpl']->append('menus', $menusObjArray); |
||||||
117 | unset($menusObjArray); |
||||||
118 | } |
||||||
119 | unset($menusCriteria, $menusObjs); |
||||||
120 | } else { |
||||||
121 | // NOP |
||||||
122 | } |
||||||
123 | $GLOBALS['xoopsTpl']->display($GLOBALS['xoops']->path("modules/{$helper->getDirname()}/templates/static/mymenus_admin_menus.tpl")); |
||||||
124 | require __DIR__ . '/admin_footer.php'; |
||||||
125 | break; |
||||||
126 | |||||||
127 | case 'add': |
||||||
128 | case 'edit': |
||||||
129 | // admin navigation |
||||||
130 | xoops_cp_header(); |
||||||
131 | $adminObject = \Xmf\Module\Admin::getInstance(); |
||||||
132 | $adminObject->displayNavigation($currentFile); |
||||||
133 | // buttons |
||||||
134 | $adminObject->addItemButton(_LIST, $currentFile . '?op=list', 'list'); |
||||||
135 | $adminObject->displayButton('left'); |
||||||
136 | // |
||||||
137 | $id = Request::getInt('id', 0); |
||||||
138 | if (!$menusObj = $helper->getHandler('Menus')->get($id)) { |
||||||
139 | // ERROR |
||||||
140 | redirect_header($currentFile, 3, _AM_MYMENUS_MSG_ERROR); |
||||||
0 ignored issues
–
show
The function
redirect_header was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
141 | } |
||||||
142 | $form = $menusObj->getForm(); |
||||||
143 | $form->display(); |
||||||
144 | // |
||||||
145 | require __DIR__ . '/admin_footer.php'; |
||||||
146 | break; |
||||||
147 | |||||||
148 | case 'save': |
||||||
149 | if (!$GLOBALS['xoopsSecurity']->check()) { |
||||||
150 | redirect_header($currentFile, 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
||||||
151 | } |
||||||
152 | $id = Request::getInt('id', 0, 'POST'); |
||||||
153 | $isNewMenus = 0 == $id; |
||||||
154 | // |
||||||
155 | $menusObj = $helper->getHandler('Menus')->get($id); |
||||||
156 | $menusObj->setVar('title', Request::getString('title', '', 'POST')); |
||||||
157 | $menusObj->setVar('css', Request::getString('css', '', 'POST')); |
||||||
158 | // |
||||||
159 | if (!$helper->getHandler('Menus')->insert($menusObj)) { |
||||||
160 | // ERROR |
||||||
161 | xoops_cp_header(); |
||||||
162 | echo $menusObj->getHtmlErrors(); |
||||||
163 | xoops_cp_footer(); |
||||||
0 ignored issues
–
show
The function
xoops_cp_footer was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
164 | exit(); |
||||||
165 | } |
||||||
166 | $id = (int)$menusObj->getVar('id'); |
||||||
167 | // |
||||||
168 | if ($isNewMenus) { |
||||||
169 | // NOP |
||||||
170 | } else { |
||||||
171 | // NOP |
||||||
172 | } |
||||||
173 | // |
||||||
174 | redirect_header($currentFile, 3, _AM_MYMENUS_MSG_SUCCESS); |
||||||
175 | break; |
||||||
176 | |||||||
177 | case 'delete': |
||||||
178 | $id = Request::getInt('id', null); |
||||||
179 | $menusObj = $helper->getHandler('Menus')->get($id); |
||||||
180 | if (true === Request::getBool('ok', false, 'POST')) { |
||||||
181 | if (!$GLOBALS['xoopsSecurity']->check()) { |
||||||
182 | redirect_header($currentFile, 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
||||||
183 | } |
||||||
184 | // delete menus |
||||||
185 | if (!$helper->getHandler('Menus')->delete($menusObj)) { |
||||||
186 | // ERROR |
||||||
187 | xoops_cp_header(); |
||||||
188 | xoops_error(_AM_MYMENUS_MSG_ERROR, $menusObj->getVar('id')); |
||||||
0 ignored issues
–
show
The function
xoops_error was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
189 | xoops_cp_footer(); |
||||||
190 | exit(); |
||||||
191 | } |
||||||
192 | // Delete links |
||||||
193 | $helper->getHandler('Links')->deleteAll(new \Criteria('mid', $id)); |
||||||
194 | redirect_header($currentFile, 3, _AM_MYMENUS_MSG_DELETE_MENU_SUCCESS); |
||||||
195 | } else { |
||||||
196 | xoops_cp_header(); |
||||||
197 | xoops_confirm(['ok' => true, 'id' => $id, 'op' => 'delete'], // $_SERVER['REQUEST_URI'], |
||||||
0 ignored issues
–
show
The function
xoops_confirm was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
198 | Request::getString('REQUEST_URI', '', 'SERVER'), sprintf(_AM_MYMENUS_MENUS_SUREDEL, $menusObj->getVar('title'))); |
||||||
199 | require __DIR__ . '/admin_footer.php'; |
||||||
200 | } |
||||||
201 | break; |
||||||
202 | } |
||||||
203 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths