mambax7 /
newbb
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 declare(strict_types=1); |
||||||||||
| 2 | |||||||||||
| 3 | /** |
||||||||||
| 4 | * You may not change or alter any portion of this comment or credits |
||||||||||
| 5 | * of supporting developers from this source code or any supporting source code |
||||||||||
| 6 | * which is considered copyrighted (c) material of the original comment or credit authors. |
||||||||||
| 7 | * |
||||||||||
| 8 | * |
||||||||||
| 9 | * @category Module |
||||||||||
| 10 | * @author XOOPS Development Team |
||||||||||
| 11 | * @copyright XOOPS Project |
||||||||||
| 12 | * @link https://xoops.org |
||||||||||
| 13 | * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) |
||||||||||
| 14 | */ |
||||||||||
| 15 | |||||||||||
| 16 | use Xmf\Module\Admin; |
||||||||||
| 17 | use Xmf\Request; |
||||||||||
| 18 | use XoopsModules\Newbb\{ |
||||||||||
| 19 | Common\Blocksadmin, |
||||||||||
| 20 | Helper |
||||||||||
| 21 | }; |
||||||||||
| 22 | |||||||||||
| 23 | /** @var Admin $adminObject */ |
||||||||||
| 24 | /** @var Helper $helper */ |
||||||||||
| 25 | |||||||||||
| 26 | require_once __DIR__ . '/admin_header.php'; |
||||||||||
| 27 | xoops_cp_header(); |
||||||||||
| 28 | |||||||||||
| 29 | $moduleDirName = $helper->getDirname(); |
||||||||||
| 30 | $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
||||||||||
| 31 | |||||||||||
| 32 | /** @var \XoopsMySQLDatabase $xoopsDB */ |
||||||||||
| 33 | $xoopsDB = \XoopsDatabaseFactory::getDatabaseConnection(); |
||||||||||
| 34 | $blocksadmin = new Blocksadmin($xoopsDB, $helper); |
||||||||||
| 35 | |||||||||||
| 36 | $xoopsModule = XoopsModule::getByDirname($moduleDirName); |
||||||||||
| 37 | |||||||||||
| 38 | if (!is_object($GLOBALS['xoopsUser']) || !is_object($xoopsModule) |
||||||||||
| 39 | // || !$GLOBALS['xoopsUser']->isAdmin($xoopsModule->mid())) { |
||||||||||
| 40 | || !$helper->isUserAdmin()) { |
||||||||||
| 41 | exit(constant('CO_' . $moduleDirNameUpper . '_' . 'ERROR403')); |
||||||||||
| 42 | } |
||||||||||
| 43 | $bcachetime = null; |
||||||||||
| 44 | $bmodule = null; |
||||||||||
| 45 | $bside = null; |
||||||||||
| 46 | $btitle = null; |
||||||||||
| 47 | $bvisible = null; |
||||||||||
| 48 | $bweight = null; |
||||||||||
| 49 | $groups = null; |
||||||||||
| 50 | $options = null; |
||||||||||
| 51 | |||||||||||
| 52 | if ($helper->isUserAdmin()) { |
||||||||||
| 53 | require_once XOOPS_ROOT_PATH . '/class/xoopsblock.php'; |
||||||||||
| 54 | |||||||||||
| 55 | $op = Request::getCmd('op', 'list'); |
||||||||||
| 56 | if ($_POST !== []) { |
||||||||||
| 57 | $ok = Request::getInt('ok', 0, 'POST'); |
||||||||||
| 58 | $confirm_submit = Request::getCmd('confirm_submit', '', 'POST'); |
||||||||||
| 59 | $submit = Request::getString('submit', '', 'POST'); |
||||||||||
| 60 | $bside = Request::getString('bside', '0', 'POST'); |
||||||||||
| 61 | $bweight = Request::getString('bweight', '0', 'POST'); |
||||||||||
| 62 | $bvisible = Request::getString('bvisible', '0', 'POST'); |
||||||||||
| 63 | $bmodule = Request::getArray('bmodule', [], 'POST'); |
||||||||||
| 64 | $btitle = Request::getString('btitle', '', 'POST'); |
||||||||||
| 65 | $bcachetime = Request::getString('bcachetime', '0', 'POST'); |
||||||||||
| 66 | $groups = Request::getArray('groups', [], 'POST'); |
||||||||||
| 67 | $options = Request::getArray('options', [], 'POST'); |
||||||||||
| 68 | $submitblock = Request::getString('submitblock', '', 'POST'); |
||||||||||
| 69 | $fct = Request::getString('fct', '', 'POST'); |
||||||||||
| 70 | $title = Request::getString('title', '', 'POST'); |
||||||||||
| 71 | $side = Request::getString('side', '0', 'POST'); |
||||||||||
| 72 | $weight = Request::getString('weight', '0', 'POST'); |
||||||||||
| 73 | $visible = Request::getString('visible', '0', 'POST'); |
||||||||||
| 74 | } |
||||||||||
| 75 | |||||||||||
| 76 | if ('list' === $op) { |
||||||||||
| 77 | // xoops_cp_header(); |
||||||||||
| 78 | $blocksadmin->listBlocks(); |
||||||||||
| 79 | require_once __DIR__ . '/admin_footer.php'; |
||||||||||
| 80 | exit(); |
||||||||||
| 81 | } |
||||||||||
| 82 | |||||||||||
| 83 | if (\in_array($op, ['edit', 'edit_ok', 'delete', 'delete_ok', 'clone', 'clone_ok'])) { |
||||||||||
| 84 | $bid = Request::getInt('bid', 0); |
||||||||||
| 85 | $ok = Request::getInt('ok', 0); |
||||||||||
| 86 | |||||||||||
| 87 | if ('clone' === $op) { |
||||||||||
| 88 | $blocksadmin->cloneBlock($bid); |
||||||||||
| 89 | } |
||||||||||
| 90 | |||||||||||
| 91 | if ('delete' === $op) { |
||||||||||
| 92 | if (1 === $ok) { |
||||||||||
| 93 | // if (!$GLOBALS['xoopsSecurity']->check()) { |
||||||||||
| 94 | // redirect_header($helper->url('admin/blocksadmin.php'), 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
||||||||||
| 95 | // } |
||||||||||
| 96 | $blocksadmin->deleteBlock($bid); |
||||||||||
| 97 | } else { |
||||||||||
| 98 | // xoops_cp_header(); |
||||||||||
| 99 | xoops_confirm(['ok' => 1, 'op' => 'delete', 'bid' => $bid], 'blocksadmin.php', constant('CO_' . $moduleDirNameUpper . '_' . 'DELETE_BLOCK_CONFIRM'), constant('CO_' . $moduleDirNameUpper . '_' . 'CONFIRM'), true); |
||||||||||
| 100 | xoops_cp_footer(); |
||||||||||
| 101 | } |
||||||||||
| 102 | } |
||||||||||
| 103 | |||||||||||
| 104 | if ('edit' === $op) { |
||||||||||
| 105 | $blocksadmin->editBlock($bid); |
||||||||||
| 106 | } |
||||||||||
| 107 | |||||||||||
| 108 | if ('edit_ok' === $op) { |
||||||||||
| 109 | $blocksadmin->updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups); |
||||||||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
It seems like
$btitle can also be of type null; however, parameter $btitle of XoopsModules\Newbb\Commo...cksadmin::updateBlock() does only seem to accept 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
Loading history...
It seems like
$bcachetime can also be of type null; however, parameter $bcachetime of XoopsModules\Newbb\Commo...cksadmin::updateBlock() does only seem to accept 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
Loading history...
It seems like
$bweight can also be of type null; however, parameter $bweight of XoopsModules\Newbb\Commo...cksadmin::updateBlock() does only seem to accept 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
Loading history...
It seems like
$bvisible can also be of type null; however, parameter $bvisible of XoopsModules\Newbb\Commo...cksadmin::updateBlock() does only seem to accept 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
Loading history...
|
|||||||||||
| 110 | } |
||||||||||
| 111 | |||||||||||
| 112 | if ('clone_ok' === $op) { |
||||||||||
| 113 | $blocksadmin->isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups); |
||||||||||
|
0 ignored issues
–
show
It seems like
$bcachetime can also be of type null; however, parameter $bcachetime of XoopsModules\Newbb\Commo...sadmin::isBlockCloned() does only seem to accept 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
Loading history...
It seems like
$bvisible can also be of type null; however, parameter $bvisible of XoopsModules\Newbb\Commo...sadmin::isBlockCloned() does only seem to accept 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
Loading history...
It seems like
$bweight can also be of type null; however, parameter $bweight of XoopsModules\Newbb\Commo...sadmin::isBlockCloned() does only seem to accept 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
Loading history...
It seems like
$bside can also be of type null; however, parameter $bside of XoopsModules\Newbb\Commo...sadmin::isBlockCloned() does only seem to accept 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
Loading history...
|
|||||||||||
| 114 | } |
||||||||||
| 115 | } |
||||||||||
| 116 | |||||||||||
| 117 | if ('order' === $op) { |
||||||||||
| 118 | $bid = Request::getArray('bid', []); |
||||||||||
| 119 | |||||||||||
| 120 | $title = Request::getArray('title', [], 'POST'); |
||||||||||
| 121 | $side = Request::getArray('side', [], 'POST'); |
||||||||||
| 122 | $weight = Request::getArray('weight', [], 'POST'); |
||||||||||
| 123 | $visible = Request::getArray('visible', [], 'POST'); |
||||||||||
| 124 | $bcachetime = Request::getArray('bcachetime', [], 'POST'); |
||||||||||
| 125 | $bmodule = Request::getArray('bmodule', [], 'POST');//mb |
||||||||||
| 126 | |||||||||||
| 127 | $oldtitle = Request::getArray('oldtitle', [], 'POST'); |
||||||||||
| 128 | $oldside = Request::getArray('oldside', [], 'POST'); |
||||||||||
| 129 | $oldweight = Request::getArray('oldweight', [], 'POST'); |
||||||||||
| 130 | $oldvisible = Request::getArray('oldvisible', [], 'POST'); |
||||||||||
| 131 | $oldgroups = Request::getArray('oldgroups', [], 'POST'); |
||||||||||
| 132 | $oldbcachetime = Request::getArray('oldcachetime', [], 'POST'); |
||||||||||
| 133 | $oldbmodule = Request::getArray('oldbmodule', [], 'POST');//mb |
||||||||||
| 134 | |||||||||||
| 135 | $blocksadmin->orderBlock( |
||||||||||
| 136 | $bid, |
||||||||||
| 137 | $oldtitle, |
||||||||||
| 138 | $oldside, |
||||||||||
| 139 | $oldweight, |
||||||||||
| 140 | $oldvisible, |
||||||||||
| 141 | $oldgroups, |
||||||||||
| 142 | $oldbcachetime, |
||||||||||
| 143 | $oldbmodule, |
||||||||||
| 144 | $title, |
||||||||||
| 145 | $weight, |
||||||||||
| 146 | $visible, |
||||||||||
| 147 | $side, |
||||||||||
| 148 | $bcachetime, |
||||||||||
| 149 | $groups, |
||||||||||
|
0 ignored issues
–
show
It seems like
$groups can also be of type null; however, parameter $groups of XoopsModules\Newbb\Commo...ocksadmin::orderBlock() does only seem to accept array, 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
Loading history...
|
|||||||||||
| 150 | $bmodule |
||||||||||
| 151 | ); |
||||||||||
| 152 | } |
||||||||||
| 153 | } else { |
||||||||||
| 154 | echo constant('CO_' . $moduleDirNameUpper . '_' . 'ERROR403'); |
||||||||||
| 155 | } |
||||||||||
| 156 | |||||||||||
| 157 | require_once __DIR__ . '/admin_footer.php'; |
||||||||||
| 158 |