XoopsModules25x /
smartpartner
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.
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 | // XOOPS - PHP Content Management System // |
||
| 5 | // Copyright (c) 2000-2016 XOOPS.org // |
||
| 6 | // <http://xoops.org/> // |
||
| 7 | // ------------------------------------------------------------------------ // |
||
| 8 | // This program is free software; you can redistribute it and/or modify // |
||
| 9 | // it under the terms of the GNU General Public License as published by // |
||
| 10 | // the Free Software Foundation; either version 2 of the License, or // |
||
| 11 | // (at your option) any later version. // |
||
| 12 | // // |
||
| 13 | // You may not change or alter any portion of this comment or credits // |
||
| 14 | // of supporting developers from this source code or any supporting // |
||
| 15 | // source code which is considered copyrighted (c) material of the // |
||
| 16 | // original comment or credit authors. // |
||
| 17 | // // |
||
| 18 | // This program is distributed in the hope that it will be useful, // |
||
| 19 | // but WITHOUT ANY WARRANTY; without even the implied warranty of // |
||
| 20 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // |
||
| 21 | // GNU General Public License for more details. // |
||
| 22 | // // |
||
| 23 | // You should have received a copy of the GNU General Public License // |
||
| 24 | // along with this program; if not, write to the Free Software // |
||
| 25 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // |
||
| 26 | // ------------------------------------------------------------------------ // |
||
| 27 | // Author: Kazumi Ono (AKA onokazu) // |
||
| 28 | // URL: http://www.myweb.ne.jp/, http://xoops.org/, http://jp.xoops.org/ // |
||
| 29 | // Project: XOOPS Project // |
||
| 30 | // ------------------------------------------------------------------------- // |
||
| 31 | |||
| 32 | $admin_mydirname = basename(dirname(__DIR__)); |
||
| 33 | |||
| 34 | $fct = empty($_POST['fct']) ? '' : trim($_POST['fct']); |
||
| 35 | $fct = empty($_GET['fct']) ? $fct : trim($_GET['fct']); |
||
| 36 | if (empty($fct)) { |
||
| 37 | $fct = 'preferences'; |
||
| 38 | } |
||
| 39 | //if (isset($fct) && $fct == "users") { |
||
| 40 | // $xoopsOption['pagetype'] = "user"; |
||
| 41 | //} |
||
| 42 | include dirname(dirname(dirname(__DIR__))) . '/mainfile.php'; |
||
| 43 | // include "../../mainfile.php"; GIJ |
||
| 44 | include XOOPS_ROOT_PATH . '/include/cp_functions.php'; |
||
| 45 | |||
| 46 | include_once XOOPS_ROOT_PATH . '/kernel/module.php'; |
||
| 47 | include_once dirname(__DIR__) . '/include/gtickets.php'; // GIJ |
||
| 48 | |||
| 49 | $admintest = 0; |
||
| 50 | |||
| 51 | if (is_object($xoopsUser)) { |
||
| 52 | $xoopsModule = XoopsModule::getByDirname('system'); |
||
| 53 | if (!$xoopsUser->isAdmin($xoopsModule->mid())) { |
||
| 54 | redirect_header(XOOPS_URL . '/user.php', 3, _NOPERM); |
||
| 55 | } |
||
| 56 | $admintest = 1; |
||
| 57 | } else { |
||
| 58 | redirect_header(XOOPS_URL . '/user.php', 3, _NOPERM); |
||
| 59 | } |
||
| 60 | |||
| 61 | // include system category definitions |
||
| 62 | include_once XOOPS_ROOT_PATH . '/modules/system/constants.php'; |
||
| 63 | $error = false; |
||
| 64 | if ($admintest != 0) { |
||
| 65 | if (isset($fct) && $fct != '') { |
||
| 66 | if (file_exists(XOOPS_ROOT_PATH . '/modules/system/admin/' . $fct . '/xoops_version.php')) { |
||
| 67 | if (file_exists(XOOPS_ROOT_PATH . '/modules/system/language/' . $xoopsConfig['language'] . '/admin.php')) { |
||
| 68 | include XOOPS_ROOT_PATH . '/modules/system/language/' . $xoopsConfig['language'] . '/admin.php'; |
||
| 69 | } else { |
||
| 70 | include XOOPS_ROOT_PATH . '/modules/system/language/english/admin.php'; |
||
| 71 | } |
||
| 72 | |||
| 73 | if (file_exists(XOOPS_ROOT_PATH . '/modules/system/language/' . $xoopsConfig['language'] . '/admin/' . $fct . '.php')) { |
||
| 74 | include XOOPS_ROOT_PATH . '/modules/system/language/' . $xoopsConfig['language'] . '/admin/' . $fct . '.php'; |
||
| 75 | } elseif (file_exists(XOOPS_ROOT_PATH . '/modules/system/language/english/admin/' . $fct . '.php')) { |
||
| 76 | include XOOPS_ROOT_PATH . '/modules/system/language/english/admin/' . $fct . '.php'; |
||
| 77 | } |
||
| 78 | include XOOPS_ROOT_PATH . '/modules/system/admin/' . $fct . '/xoops_version.php'; |
||
| 79 | $syspermHandler = xoops_getHandler('groupperm'); |
||
| 80 | $category = !empty($modversion['category']) ? (int)$modversion['category'] : 0; |
||
| 81 | unset($modversion); |
||
| 82 | if ($category > 0) { |
||
| 83 | $groups =& $xoopsUser->getGroups(); |
||
| 84 | if (in_array(XOOPS_GROUP_ADMIN, $groups) || false != $syspermHandler->checkRight('system_admin', $category, $groups, $xoopsModule->getVar('mid'))) { |
||
| 85 | // if (file_exists(XOOPS_ROOT_PATH."/modules/system/admin/".$fct."/main.php")) { |
||
| 86 | // include_once XOOPS_ROOT_PATH."/modules/system/admin/".$fct."/main.php"; GIJ |
||
| 87 | if (file_exists("../include/{$fct}.inc.php")) { |
||
| 88 | include_once "../include/{$fct}.inc.php"; |
||
| 89 | } else { |
||
| 90 | $error = true; |
||
| 91 | } |
||
| 92 | } else { |
||
| 93 | $error = true; |
||
| 94 | } |
||
| 95 | } elseif ($fct === 'version') { |
||
| 96 | if (file_exists(XOOPS_ROOT_PATH . '/modules/system/admin/version/main.php')) { |
||
| 97 | include_once XOOPS_ROOT_PATH . '/modules/system/admin/version/main.php'; |
||
| 98 | } else { |
||
| 99 | $error = true; |
||
| 100 | } |
||
| 101 | } else { |
||
| 102 | $error = true; |
||
| 103 | } |
||
| 104 | } else { |
||
| 105 | $error = true; |
||
| 106 | } |
||
| 107 | } else { |
||
| 108 | $error = true; |
||
| 109 | } |
||
| 110 | } |
||
| 111 | |||
| 112 | if (false != $error) { |
||
|
0 ignored issues
–
show
|
|||
| 113 | xoops_cp_header(); |
||
| 114 | echo '<h4>System Configuration</h4>'; |
||
| 115 | echo '<table class="outer" cellpadding="4" cellspacing="1">'; |
||
| 116 | echo '<tr>'; |
||
| 117 | $groups = $xoopsUser->getGroups(); |
||
| 118 | $all_ok = false; |
||
| 119 | if (!in_array(XOOPS_GROUP_ADMIN, $groups)) { |
||
| 120 | $syspermHandler = xoops_getHandler('groupperm'); |
||
| 121 | $ok_syscats =& $syspermHandler->getItemIds('system_admin', $groups); |
||
| 122 | } else { |
||
| 123 | $all_ok = true; |
||
| 124 | } |
||
| 125 | $admin_dir = XOOPS_ROOT_PATH . '/modules/system/admin'; |
||
| 126 | $handle = opendir($admin_dir); |
||
| 127 | $counter = 0; |
||
| 128 | $class = 'even'; |
||
| 129 | while ($file = readdir($handle)) { |
||
| 130 | if (strtolower($file) !== 'cvs' && !preg_match('/[.]/', $file) && is_dir($admin_dir . '/' . $file)) { |
||
| 131 | include $admin_dir . '/' . $file . '/xoops_version.php'; |
||
| 132 | if ($modversion['hasAdmin']) { |
||
| 133 | $category = isset($modversion['category']) ? (int)$modversion['category'] : 0; |
||
| 134 | if (false != $all_ok || in_array($modversion['category'], $ok_syscats)) { |
||
|
0 ignored issues
–
show
|
|||
| 135 | echo "<td class='$class' align='center' valign='bottom' width='19%'>"; |
||
| 136 | echo "<a href='" . XOOPS_URL . '/modules/system/admin.php?fct=' . $file . "'><b>" . trim($modversion['name']) . "</b></a>\n"; |
||
| 137 | echo '</td>'; |
||
| 138 | ++$counter; |
||
| 139 | $class = ($class === 'even') ? 'odd' : 'even'; |
||
| 140 | } |
||
| 141 | if ($counter > 4) { |
||
| 142 | $counter = 0; |
||
| 143 | echo '</tr>'; |
||
| 144 | echo '<tr>'; |
||
| 145 | } |
||
| 146 | } |
||
| 147 | unset($modversion); |
||
| 148 | } |
||
| 149 | } |
||
| 150 | while ($counter < 5) { |
||
| 151 | echo '<td class="' . $class . '"> </td>'; |
||
| 152 | $class = ($class === 'even') ? 'odd' : 'even'; |
||
| 153 | ++$counter; |
||
| 154 | } |
||
| 155 | echo '</tr></table>'; |
||
| 156 | xoops_cp_footer(); |
||
| 157 | } |
||
| 158 |
When comparing two booleans, it is generally considered safer to use the strict comparison operator.