mambax7 /
smartobject
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 | use XoopsModules\Smartobject; |
||
| 4 | use XoopsModules\Smartobject\ObjectColumn; |
||
| 5 | use XoopsModules\Smartobject\ObjectController; |
||
| 6 | use XoopsModules\Smartobject\Table; |
||
| 7 | |||
| 8 | /** |
||
| 9 | * |
||
| 10 | * Module: Class_Booking |
||
| 11 | * Author: The SmartFactory <www.smartfactory.ca> |
||
| 12 | * Licence: GNU |
||
| 13 | * @param bool $showmenu |
||
| 14 | * @param int $ratingid |
||
| 15 | */ |
||
| 16 | |||
| 17 | function editclass($showmenu = false, $ratingid = 0) |
||
|
0 ignored issues
–
show
|
|||
| 18 | { |
||
| 19 | global $smartobjectRatingHandler; |
||
| 20 | |||
| 21 | $ratingObj = $smartobjectRatingHandler->get($ratingid); |
||
| 22 | |||
| 23 | if (!$ratingObj->isNew()) { |
||
| 24 | if ($showmenu) { |
||
| 25 | //Smartobject\Utility::getAdminMenu(4, _AM_SOBJECT_RATINGS . " > " . _AM_SOBJECT_EDITING); |
||
| 26 | } |
||
| 27 | Smartobject\Utility::getCollapsableBar('ratingedit', _AM_SOBJECT_RATINGS_EDIT, _AM_SOBJECT_RATINGS_EDIT_INFO); |
||
| 28 | |||
| 29 | $sform = $ratingObj->getForm(_AM_SOBJECT_RATINGS_EDIT, 'addrating'); |
||
| 30 | $sform->display(); |
||
| 31 | Smartobject\Utility::closeCollapsable('ratingedit'); |
||
| 32 | } else { |
||
| 33 | $ratingObj->hideFieldFromForm(['item', 'itemid', 'uid', 'date', 'rate']); |
||
| 34 | |||
| 35 | if (isset($_POST['op'])) { |
||
| 36 | $controller = new XoopsModules\Smartobject\ObjectController($smartobjectRatingHandler); |
||
| 37 | $controller->postDataToObject($ratingObj); |
||
| 38 | |||
| 39 | if ('changedField' === $_POST['op']) { |
||
| 40 | switch ($_POST['changedField']) { |
||
| 41 | case 'dirname': |
||
| 42 | $ratingObj->showFieldOnForm(['item', 'itemid', 'uid', 'date', 'rate']); |
||
| 43 | break; |
||
| 44 | } |
||
| 45 | } |
||
| 46 | } |
||
| 47 | |||
| 48 | if ($showmenu) { |
||
| 49 | //Smartobject\Utility::getAdminMenu(4, _AM_SOBJECT_RATINGS . " > " . _CO_SOBJECT_CREATINGNEW); |
||
| 50 | } |
||
| 51 | |||
| 52 | Smartobject\Utility::getCollapsableBar('ratingcreate', _AM_SOBJECT_RATINGS_CREATE, _AM_SOBJECT_RATINGS_CREATE_INFO); |
||
| 53 | $sform = $ratingObj->getForm(_AM_SOBJECT_RATINGS_CREATE, 'addrating'); |
||
| 54 | $sform->display(); |
||
| 55 | Smartobject\Utility::closeCollapsable('ratingcreate'); |
||
| 56 | } |
||
| 57 | } |
||
| 58 | |||
| 59 | require_once __DIR__ . '/admin_header.php'; |
||
| 60 | //require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
||
| 61 | //require_once SMARTOBJECT_ROOT_PATH . 'class/rating.php'; |
||
| 62 | $smartobjectRatingHandler = Smartobject\Helper::getInstance()->getHandler('Rating'); |
||
| 63 | $indexAdmin = \Xmf\Module\Admin::getInstance(); |
||
| 64 | |||
| 65 | $op = ''; |
||
| 66 | |||
| 67 | if (isset($_GET['op'])) { |
||
| 68 | $op = $_GET['op']; |
||
| 69 | } |
||
| 70 | if (isset($_POST['op'])) { |
||
| 71 | $op = $_POST['op']; |
||
| 72 | } |
||
| 73 | |||
| 74 | switch ($op) { |
||
| 75 | case 'mod': |
||
| 76 | View Code Duplication | case 'changedField': |
|
| 77 | |||
| 78 | $ratingid = \Xmf\Request::getInt('ratingid', 0, 'GET'); |
||
| 79 | |||
| 80 | Smartobject\Utility::getXoopsCpHeader(); |
||
| 81 | $adminObject->displayNavigation(basename(__FILE__)); |
||
| 82 | |||
| 83 | editclass(true, $ratingid); |
||
| 84 | break; |
||
| 85 | |||
| 86 | case 'addrating': |
||
| 87 | // require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
||
| 88 | $controller = new XoopsModules\Smartobject\ObjectController($smartobjectRatingHandler); |
||
| 89 | $controller->storeFromDefaultForm(_AM_SOBJECT_RATINGS_CREATED, _AM_SOBJECT_RATINGS_MODIFIED, SMARTOBJECT_URL . 'admin/rating.php'); |
||
| 90 | |||
| 91 | break; |
||
| 92 | |||
| 93 | case 'del': |
||
| 94 | // require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
||
| 95 | $controller = new XoopsModules\Smartobject\ObjectController($smartobjectRatingHandler); |
||
| 96 | $controller->handleObjectDeletion(); |
||
| 97 | |||
| 98 | break; |
||
| 99 | |||
| 100 | View Code Duplication | default: |
|
| 101 | |||
| 102 | Smartobject\Utility::getXoopsCpHeader(); |
||
| 103 | $adminObject->displayNavigation(basename(__FILE__)); |
||
| 104 | |||
| 105 | //Smartobject\Utility::getAdminMenu(4, _AM_SOBJECT_RATINGS); |
||
| 106 | |||
| 107 | Smartobject\Utility::getCollapsableBar('createdratings', _AM_SOBJECT_RATINGS, _AM_SOBJECT_RATINGS_DSC); |
||
| 108 | |||
| 109 | // require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
||
| 110 | $objectTable = new XoopsModules\Smartobject\Table($smartobjectRatingHandler); |
||
| 111 | $objectTable->addColumn(new XoopsModules\Smartobject\ObjectColumn('name', 'left')); |
||
| 112 | $objectTable->addColumn(new XoopsModules\Smartobject\ObjectColumn('dirname', 'left')); |
||
| 113 | $objectTable->addColumn(new XoopsModules\Smartobject\ObjectColumn('item', 'left', false, 'getItemValue')); |
||
| 114 | $objectTable->addColumn(new XoopsModules\Smartobject\ObjectColumn('date', 'center', 150)); |
||
| 115 | $objectTable->addColumn(new XoopsModules\Smartobject\ObjectColumn('rate', 'center', 40, 'getRateValue')); |
||
| 116 | |||
| 117 | // $objectTable->addCustomAction('getCreateItemLink'); |
||
| 118 | // $objectTable->addCustomAction('getCreateAttributLink'); |
||
| 119 | |||
| 120 | $objectTable->addIntroButton('addrating', 'rating.php?op=mod', _AM_SOBJECT_RATINGS_CREATE); |
||
| 121 | /* |
||
| 122 | $criteria_upcoming = new \CriteriaCompo(); |
||
| 123 | $criteria_upcoming->add(new \Criteria('start_date', time(), '>')); |
||
| 124 | $objectTable->addFilter(_AM_SOBJECT_FILTER_UPCOMING, array( |
||
| 125 | 'key' => 'start_date', |
||
| 126 | 'criteria' => $criteria_upcoming |
||
| 127 | )); |
||
| 128 | |||
| 129 | $criteria_last7days = new \CriteriaCompo(); |
||
| 130 | $criteria_last7days->add(new \Criteria('start_date', time() - 30 *(60 * 60 * 24), '>')); |
||
| 131 | $criteria_last7days->add(new \Criteria('start_date', time(), '<')); |
||
| 132 | $objectTable->addFilter(_AM_SOBJECT_FILTER_LAST7DAYS, array( |
||
| 133 | 'key' => 'start_date', |
||
| 134 | 'criteria' => $criteria_last7days |
||
| 135 | )); |
||
| 136 | |||
| 137 | $criteria_last30days = new \CriteriaCompo(); |
||
| 138 | $criteria_last30days->add(new \Criteria('start_date', time() - 30 *(60 * 60 * 24), '>')); |
||
| 139 | $criteria_last30days->add(new \Criteria('start_date', time(), '<')); |
||
| 140 | $objectTable->addFilter(_AM_SOBJECT_FILTER_LAST30DAYS, array( |
||
| 141 | 'key' => 'start_date', |
||
| 142 | 'criteria' => $criteria_last30days |
||
| 143 | )); |
||
| 144 | */ |
||
| 145 | |||
| 146 | $objectTable->render(); |
||
| 147 | |||
| 148 | echo '<br>'; |
||
| 149 | Smartobject\Utility::closeCollapsable('createdratings'); |
||
| 150 | echo '<br>'; |
||
| 151 | |||
| 152 | break; |
||
| 153 | } |
||
| 154 | |||
| 155 | //Smartobject\Utility::getModFooter(); |
||
| 156 | //xoops_cp_footer(); |
||
| 157 | require_once __DIR__ . '/admin_footer.php'; |
||
| 158 |
This check looks for functions that have already been defined in other files.
Some Codebases, like WordPress, make a practice of defining functions multiple times. This may lead to problems with the detection of function parameters and types. If you really need to do this, you can mark the duplicate definition with the
@ignoreannotation.See also the PhpDoc documentation for @ignore.