mambax7 /
cardealer
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 | /* |
||||
| 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 | This program is distributed in the hope that it will be useful, |
||||
| 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
| 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
||||
| 11 | */ |
||||
| 12 | |||||
| 13 | /** |
||||
| 14 | * Module: cardealer |
||||
| 15 | * |
||||
| 16 | * @category Module |
||||
| 17 | * @package cardealer |
||||
| 18 | * @author XOOPS Development Team <[email protected]> - <https://xoops.org> |
||||
| 19 | * @copyright {@link https://xoops.org/ XOOPS Project} |
||||
| 20 | * @license GPL 2.0 or later |
||||
| 21 | * @link https://xoops.org/ |
||||
| 22 | * @since 1.0.0 |
||||
| 23 | */ |
||||
| 24 | |||||
| 25 | use Xmf\Request; |
||||
| 26 | use XoopsModules\Cardealer; |
||||
| 27 | |||||
| 28 | $GLOBALS['xoopsOption']['template_main'] = 'cardealer_part_list0.tpl'; |
||||
| 29 | require __DIR__ . '/header.php'; |
||||
| 30 | $start = Request::getInt('start', 0); |
||||
| 31 | // Define Stylesheet |
||||
| 32 | $xoTheme->addStylesheet($stylesheet); |
||||
| 33 | |||||
| 34 | $db = \XoopsDatabaseFactory::getDatabaseConnection(); |
||||
| 35 | |||||
| 36 | // Get Handler |
||||
| 37 | /** @var \XoopsPersistableObjectHandler $partHandler */ |
||||
| 38 | $partHandler = new Cardealer\PartHandler($db); |
||||
| 39 | |||||
| 40 | $partPaginationLimit = $helper->getConfig('userpager'); |
||||
| 41 | |||||
| 42 | $criteria = new \CriteriaCompo(); |
||||
| 43 | |||||
| 44 | $criteria->setOrder('DESC'); |
||||
| 45 | $criteria->setLimit($partPaginationLimit); |
||||
| 46 | $criteria->setStart($start); |
||||
| 47 | |||||
| 48 | $partCount = $partHandler->getCount($criteria); |
||||
| 49 | $partArray = $partHandler->getAll($criteria); |
||||
| 50 | |||||
| 51 | $op = Request::getCmd('op', ''); |
||||
| 52 | $partnum = Request::getInt('partnum', 0, 'GET'); |
||||
| 53 | |||||
| 54 | switch ($op) { |
||||
| 55 | case 'view': |
||||
| 56 | // viewItem(); |
||||
| 57 | $GLOBALS['xoopsOption']['template_main'] = 'cardealer_part.tpl'; |
||||
| 58 | $partPaginationLimit = 1; |
||||
| 59 | $myid = $partnum; |
||||
| 60 | //partnum |
||||
| 61 | $partObject = $partHandler->get($myid); |
||||
| 62 | |||||
| 63 | $criteria = new \CriteriaCompo(); |
||||
| 64 | $criteria->setSort('partnum'); |
||||
| 65 | $criteria->setOrder('DESC'); |
||||
| 66 | $criteria->setLimit($partPaginationLimit); |
||||
| 67 | $criteria->setStart($start); |
||||
| 68 | $part['partnum'] = $partObject->getVar('partnum'); |
||||
| 69 | $part['price'] = $partObject->getVar('price'); |
||||
| 70 | $part['stock'] = $partObject->getVar('stock'); |
||||
| 71 | $part['title'] = $partObject->getVar('title'); |
||||
| 72 | $part['description'] = $partObject->getVar('description'); |
||||
| 73 | $part['picture'] = $partObject->getVar('picture'); |
||||
| 74 | |||||
| 75 | // $GLOBALS['xoopsTpl']->append('part', $part); |
||||
| 76 | $keywords[] = $partObject->getVar('title'); |
||||
| 77 | |||||
| 78 | $GLOBALS['xoopsTpl']->assign('part', $part); |
||||
| 79 | $start = $partnum; |
||||
| 80 | |||||
| 81 | // Display Navigation |
||||
| 82 | if ($partCount > $partPaginationLimit) { |
||||
| 83 | |||||
| 84 | $GLOBALS['xoopsTpl']->assign('xoops_mpageurl', CARDEALER_URL . '/part.php'); |
||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||
| 85 | xoops_load('XoopsPageNav'); |
||||
| 86 | $pagenav = new \XoopsPageNav($partCount, $partPaginationLimit, $start, 'op=view&partnum'); |
||||
| 87 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); |
||||
| 88 | } |
||||
| 89 | |||||
| 90 | break; |
||||
| 91 | case 'list': |
||||
| 92 | default: |
||||
| 93 | // viewall(); |
||||
| 94 | $GLOBALS['xoopsOption']['template_main'] = 'cardealer_part_list0.tpl'; |
||||
| 95 | // require __DIR__ . '/header.php'; |
||||
| 96 | |||||
| 97 | if ($partCount > 0) { |
||||
| 98 | foreach (array_keys($partArray) as $i) { |
||||
| 99 | $part['partnum'] = $partArray[$i]->getVar('partnum'); |
||||
| 100 | $part['price'] = $partArray[$i]->getVar('price'); |
||||
| 101 | $part['stock'] = $partArray[$i]->getVar('stock'); |
||||
| 102 | $part['title'] = $partArray[$i]->getVar('title'); |
||||
| 103 | $part['description'] = $partArray[$i]->getVar('description'); |
||||
| 104 | $part['picture'] = $partArray[$i]->getVar('picture'); |
||||
| 105 | $GLOBALS['xoopsTpl']->append('part', $part); |
||||
| 106 | $keywords[] = $partArray[$i]->getVar('title'); |
||||
| 107 | unset($part); |
||||
| 108 | } |
||||
| 109 | // Display Navigation |
||||
| 110 | if ($partCount > $partPaginationLimit) { |
||||
| 111 | $GLOBALS['xoopsTpl']->assign('xoops_mpageurl', CARDEALER_URL . '/part.php'); |
||||
| 112 | xoops_load('XoopsPageNav'); |
||||
| 113 | $pagenav = new \XoopsPageNav($partCount, $partPaginationLimit, $start, 'start'); |
||||
| 114 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); |
||||
| 115 | } |
||||
| 116 | } |
||||
| 117 | } |
||||
| 118 | |||||
| 119 | //keywords |
||||
| 120 | if (isset($keywords)) { |
||||
| 121 | $utility::metaKeywords(xoops_getModuleOption('keywords', $moduleDirName) . ', ' . implode(', ', $keywords)); |
||||
|
0 ignored issues
–
show
The function
xoops_getModuleOption() has been deprecated.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 122 | } |
||||
| 123 | //description |
||||
| 124 | $utility::metaDescription(MD_CARDEALER_PART_DESC); |
||||
| 125 | // |
||||
| 126 | $GLOBALS['xoopsTpl']->assign('xoops_mpageurl', CARDEALER_URL . '/part.php'); |
||||
| 127 | $GLOBALS['xoopsTpl']->assign('cardealer_url', CARDEALER_URL); |
||||
| 128 | $GLOBALS['xoopsTpl']->assign('adv', xoops_getModuleOption('advertise', $moduleDirName)); |
||||
|
0 ignored issues
–
show
The function
xoops_getModuleOption() has been deprecated.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 129 | // |
||||
| 130 | $GLOBALS['xoopsTpl']->assign('bookmarks', xoops_getModuleOption('bookmarks', $moduleDirName)); |
||||
|
0 ignored issues
–
show
The function
xoops_getModuleOption() has been deprecated.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 131 | $GLOBALS['xoopsTpl']->assign('fbcomments', xoops_getModuleOption('fbcomments', $moduleDirName)); |
||||
|
0 ignored issues
–
show
The function
xoops_getModuleOption() has been deprecated.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 132 | // |
||||
| 133 | $GLOBALS['xoopsTpl']->assign('admin', CARDEALER_ADMIN); |
||||
|
0 ignored issues
–
show
|
|||||
| 134 | $GLOBALS['xoopsTpl']->assign('copyright', $copyright); |
||||
| 135 | // |
||||
| 136 | require XOOPS_ROOT_PATH . '/footer.php'; |
||||
| 137 |