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 | * Pedigree module for XOOPS |
||||
14 | * |
||||
15 | * @copyright {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} |
||||
16 | * @license GPL 2.0 or later |
||||
17 | * @package pedigree |
||||
18 | * @since 2.5.x |
||||
19 | * @author XOOPS Module Dev Team (https://xoops.org) |
||||
20 | */ |
||||
21 | |||||
22 | use Xmf\Request; |
||||
23 | use XoopsModules\Pedigree\{ |
||||
24 | Helper |
||||
25 | }; |
||||
26 | |||||
27 | require_once __DIR__ . '/admin_header.php'; |
||||
28 | |||||
29 | xoops_cp_header(); |
||||
30 | //$adminObject = \Xmf\Module\Admin::getInstance(); |
||||
31 | |||||
32 | $fieldsHandler = Helper::getInstance()->getHandler('Fields'); |
||||
33 | |||||
34 | //It recovered the value of argument op in URL$ |
||||
35 | $op = Request::getCmd('op', 'list'); |
||||
36 | switch ($op) { |
||||
37 | case 'list': |
||||
38 | default: |
||||
39 | $adminObject->displayNavigation(basename(__FILE__)); |
||||
40 | $adminObject->addItemButton(_AM_PEDIGREE_NEWPEDIGREE_CONFIG, 'pedigree_fields.php?op=new_pedigree_fields', 'add'); |
||||
41 | $adminObject->displayButton('left'); |
||||
42 | $criteria = new \CriteriaCompo(); |
||||
43 | $criteria->setSort('id'); |
||||
44 | $criteria->setOrder('ASC'); |
||||
45 | $numrows = $fieldsHandler->getCount(); |
||||
46 | $pedigree_fields_arr = $fieldsHandler->getAll($criteria); |
||||
47 | |||||
48 | //Table view |
||||
49 | if ($numrows > 0) { |
||||
50 | echo "<table cellspacing='1' class='outer width100'> |
||||
51 | <thead> |
||||
52 | <tr> |
||||
53 | <th class='txtcenter'>" . _AM_PEDIGREE_PEDIGREE_CONFIG_ISACTIVE . "</th> |
||||
54 | <th class='txtcenter'>" . _AM_PEDIGREE_PEDIGREE_CONFIG_FIELDNAME . "</th> |
||||
55 | <th class='txtcenter'>" . _AM_PEDIGREE_PEDIGREE_CONFIG_FIELDTYPE . "</th> |
||||
56 | <th class='txtcenter'>" . _AM_PEDIGREE_PEDIGREE_CONFIG_LOOKUPTABLE . "</th> |
||||
57 | <th class='txtcenter'>" . _AM_PEDIGREE_PEDIGREE_CONFIG_DEFAULTVALUE . "</th> |
||||
58 | <th class='txtcenter'>" . _AM_PEDIGREE_PEDIGREE_CONFIG_FIELDEXPLANATION . "</th> |
||||
59 | <th class='txtcenter'>" . _AM_PEDIGREE_PEDIGREE_CONFIG_HASSEARCH . "</th> |
||||
60 | <th class='txtcenter'>" . _AM_PEDIGREE_PEDIGREE_CONFIG_LITTER . "</th> |
||||
61 | <th class='txtcenter'>" . _AM_PEDIGREE_PEDIGREE_CONFIG_GENERALLITTER . "</th> |
||||
62 | <th class='txtcenter'>" . _AM_PEDIGREE_PEDIGREE_CONFIG_SEARCHNAME . "</th> |
||||
63 | <th class='txtcenter'>" . _AM_PEDIGREE_PEDIGREE_CONFIG_SEARCHEXPLANATION . "</th> |
||||
64 | <th class='txtcenter'>" . _AM_PEDIGREE_PEDIGREE_CONFIG_VIEWINPEDIGREE . "</th> |
||||
65 | <th class='txtcenter'>" . _AM_PEDIGREE_PEDIGREE_CONFIG_VIEWINADVANCED . "</th> |
||||
66 | <th class='txtcenter'>" . _AM_PEDIGREE_PEDIGREE_CONFIG_VIEWINPIE . "</th> |
||||
67 | <th class='txtcenter'>" . _AM_PEDIGREE_PEDIGREE_CONFIG_VIEWINLIST . "</th> |
||||
68 | <th class='txtcenter width10'>" . _AM_PEDIGREE_FORMACTION . '</th> |
||||
69 | </tr> |
||||
70 | </thead> |
||||
71 | <tbody>'; |
||||
72 | |||||
73 | $class = 'odd'; |
||||
74 | |||||
75 | foreach (array_keys($pedigree_fields_arr) as $i) { |
||||
76 | if (0 == $pedigree_fields_arr[$i]->getVar('pedigree_fields_pid')) { |
||||
77 | echo "<tr class='{$class}'>"; |
||||
78 | $class = ('even' === $class) ? 'odd' : 'even'; |
||||
79 | echo "<td class='txtcenter'>" . $pedigree_fields_arr[$i]->getVar('isactive') . '</td>'; |
||||
80 | echo "<td class='txtcenter'>" . $pedigree_fields_arr[$i]->getVar('fieldname') . '</td>'; |
||||
81 | echo "<td class='txtcenter'>" . $pedigree_fields_arr[$i]->getVar('fieldtype') . '</td>'; |
||||
82 | echo "<td class='txtcenter'>" . $pedigree_fields_arr[$i]->getVar('lookuptable') . '</td>'; |
||||
83 | echo "<td class='txtcenter'>" . $pedigree_fields_arr[$i]->getVar('defaultvalue') . '</td>'; |
||||
84 | echo "<td class='txtcenter'>" . $pedigree_fields_arr[$i]->getVar('fieldexplanation') . '</td>'; |
||||
85 | echo "<td class='txtcenter'>" . $pedigree_fields_arr[$i]->getVar('hassearch') . '</td>'; |
||||
86 | echo "<td class='txtcenter'>" . $pedigree_fields_arr[$i]->getVar('litter') . '</td>'; |
||||
87 | echo "<td class='txtcenter'>" . $pedigree_fields_arr[$i]->getVar('generallitter') . '</td>'; |
||||
88 | echo "<td class='txtcenter'>" . $pedigree_fields_arr[$i]->getVar('searchname') . '</td>'; |
||||
89 | echo "<td class='txtcenter'>" . $pedigree_fields_arr[$i]->getVar('searchexplanation') . '</td>'; |
||||
90 | echo "<td class='txtcenter'>" . $pedigree_fields_arr[$i]->getVar('viewinpedigree') . '</td>'; |
||||
91 | echo "<td class='txtcenter'>" . $pedigree_fields_arr[$i]->getVar('viewinadvanced') . '</td>'; |
||||
92 | echo "<td class='txtcenter'>" . $pedigree_fields_arr[$i]->getVar('viewinpie') . '</td>'; |
||||
93 | echo "<td class='txtcenter'>" . $pedigree_fields_arr[$i]->getVar('viewinlist') . '</td>'; |
||||
94 | echo "<td class='txtcenter width10'> |
||||
95 | <a href='pedigree_fields.php?op=edit_pedigree_fields&id=" . $pedigree_fields_arr[$i]->getVar('id') . "'><img src='{$pathIcon16}/edit.png' alt='" . _EDIT . "' title='" . _EDIT . "'></a> |
||||
96 | <a href='pedigree_fields.php?op=delete_pedigree_fields&id=" . $pedigree_fields_arr[$i]->getVar('id') . "'><img src='{$pathIcon16}/delete.png' alt='" . _DELETE . "' title='" . _DELETE . "'></a> |
||||
97 | </td>"; |
||||
98 | echo '</tr>'; |
||||
99 | } |
||||
100 | } |
||||
101 | echo '</tbody> |
||||
102 | </table> |
||||
103 | <br><br>'; |
||||
104 | } |
||||
105 | |||||
106 | break; |
||||
107 | |||||
108 | case 'new_pedigree_fields': |
||||
109 | $adminObject->displayNavigation(basename(__FILE__)); |
||||
110 | $adminObject->addItemButton(_AM_PEDIGREE_PEDIGREE_CONFIGLIST, 'pedigree_fields.php?op=list', 'list'); |
||||
111 | $adminObject->displayButton('left'); |
||||
112 | |||||
113 | $obj = $fieldsHandler->create(); |
||||
114 | $form = $obj->getForm(); |
||||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||||
115 | $form->display(); |
||||
116 | break; |
||||
117 | |||||
118 | case 'save_pedigree_fields': |
||||
119 | if (!$GLOBALS['xoopsSecurity']->check()) { |
||||
120 | $helper->redirect('admin/pedigree_fields.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
||||
121 | } |
||||
122 | $id = Request::getInt('id', 0, 'POST'); |
||||
123 | if ($id) { |
||||
124 | $obj = $fieldsHandler->get($id); |
||||
125 | } else { |
||||
126 | $obj = $fieldsHandler->create(); |
||||
127 | } |
||||
128 | //Form isactive |
||||
129 | $obj->setVar('isactive', Request::getInt('isActive', 0, 'POST')); |
||||
130 | //Form fieldname |
||||
131 | $obj->setVar('fieldname', Request::getString('fieldName', '', 'POST')); |
||||
132 | //Form fieldtype |
||||
133 | $obj->setVar('fieldtype', Request::getString('fieldType', 'textbox', 'POST')); |
||||
134 | //Form LookupTable |
||||
135 | $obj->setVar('lookuptable', Request::getString('lookupTable', '', 'POST')); |
||||
136 | //Form DefaultValue |
||||
137 | $obj->setVar('defaultvalue', Request::getString('defaultValue', '', 'POST')); |
||||
138 | //Form FieldExplanation |
||||
139 | $obj->setVar('fieldexplanation', Request::getString('fieldExplanation', '', 'POST')); |
||||
140 | //Form HasSearch |
||||
141 | $obj->setVar('hassearch', Request::getInt('hasSearch', 0, 'POST')); |
||||
142 | //Form Litter Types |
||||
143 | $litterType = Request::getString('litterType', 'generalLitter'); |
||||
144 | if ('Litter' === $litterType) { |
||||
145 | $obj->setVar('litter', 1); |
||||
146 | $obj->setVar('generalLitter', 0); |
||||
147 | } else { |
||||
148 | $obj->setVar('litter', 0); |
||||
149 | $obj->setVar('generalLitter', 1); |
||||
150 | } |
||||
151 | //Form SearchName |
||||
152 | $obj->setVar('searchname', Request::getString('searchName', '', 'POST')); |
||||
153 | //Form SearchExplanation |
||||
154 | $obj->setVar('searchexplanation', Request::getString('searchExplanation', '', 'POST')); |
||||
155 | //Form viewinpedigree |
||||
156 | $obj->setVar('viewinpedigree', Request::getInt('viewInPedigree', 0, 'POST')); |
||||
157 | //Form ViewInAdvanced |
||||
158 | $obj->setVar('viewinadvanced', Request::getInt('viewInAdvanced', 1, 'POST')); |
||||
159 | //Form ViewInPie |
||||
160 | $obj->setVar('viewinpie', Request::getInt('viewInPie', 0, 'POST')); |
||||
161 | //Form ViewInList |
||||
162 | $obj->setVar('viewinlist', Request::getInt('viewInList', 0, 'POST')); |
||||
163 | //Form locked |
||||
164 | $obj->setVar('locked', Request::getInt('locked', 0, 'POST')); |
||||
165 | //Form order |
||||
166 | $obj->setVar('order', Request::getInt('order', 0, 'POST')); |
||||
167 | |||||
168 | if ($fieldsHandler->insert($obj)) { |
||||
169 | $helper->redirect('admin/pedigree_fields.php?op=list', 2, _AM_PEDIGREE_FORMOK); |
||||
170 | } |
||||
171 | |||||
172 | echo $obj->getHtmlErrors(); |
||||
173 | $form = $obj->getForm(); |
||||
174 | $form->display(); |
||||
175 | break; |
||||
176 | |||||
177 | case 'edit_pedigree_fields': |
||||
178 | $adminObject->displayNavigation(basename(__FILE__)); |
||||
179 | $adminObject->addItemButton(_AM_PEDIGREE_NEWPEDIGREE_CONFIG, 'pedigree_fields.php?op=new_pedigree_fields', 'add'); |
||||
180 | $adminObject->addItemButton(_AM_PEDIGREE_PEDIGREE_CONFIGLIST, 'pedigree_fields.php?op=list', 'list'); |
||||
181 | $adminObject->displayButton('left'); |
||||
182 | $obj = $fieldsHandler->get(Request::getInt('id', 0)); |
||||
183 | $form = $obj->getForm(); |
||||
184 | $form->display(); |
||||
185 | break; |
||||
186 | |||||
187 | case 'delete_pedigree_fields': |
||||
188 | $id = Request::getInt('id', 0); |
||||
189 | $obj = $fieldsHandler->get($id); |
||||
190 | $ok = Request::getInt('ok', 0, 'POST'); |
||||
191 | if ('0' != $ok) { |
||||
192 | // if (isset($_REQUEST['ok']) && (1 == $_REQUEST['ok'])) { |
||||
193 | if (!$GLOBALS['xoopsSecurity']->check()) { |
||||
194 | $helper->redirect('admin/pedigree_fields.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
||||
195 | } |
||||
196 | if ($fieldsHandler->delete($obj)) { |
||||
197 | $helper->redirect('admin/pedigree_fields.php', 3, _AM_PEDIGREE_FORMDELOK); |
||||
198 | } else { |
||||
199 | echo $obj->getHtmlErrors(); |
||||
200 | } |
||||
201 | } else { |
||||
202 | xoops_confirm(['ok' => 1, 'id' => $id, 'op' => 'delete_pedigree_fields'], $_SERVER['REQUEST_URI'], sprintf(_AM_PEDIGREE_FORMSUREDEL, $obj->getVar('pedigree_fields'))); |
||||
0 ignored issues
–
show
It seems like
$obj->getVar('pedigree_fields') can also be of type array and array ; however, parameter $values of sprintf() does only seem to accept double|integer|string , maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
203 | } |
||||
204 | break; |
||||
205 | } |
||||
206 | require_once __DIR__ . '/admin_footer.php'; |
||||
207 |