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 | * Module: Class_Booking |
||
| 10 | * Author: The SmartFactory <www.smartfactory.ca> |
||
| 11 | * Licence: GNU |
||
| 12 | * @param bool $showmenu |
||
| 13 | * @param int $currencyid |
||
| 14 | */ |
||
| 15 | |||
| 16 | function editclass($showmenu = false, $currencyid = 0) |
||
| 17 | { |
||
| 18 | global $smartobjectCurrencyHandler; |
||
| 19 | |||
| 20 | $currencyObj = $smartobjectCurrencyHandler->get($currencyid); |
||
| 21 | |||
| 22 | if (!$currencyObj->isNew()) { |
||
| 23 | if ($showmenu) { |
||
| 24 | //Smartobject\Utility::getAdminMenu(5, _AM_SOBJECT_CURRENCIES . " > " . _AM_SOBJECT_EDITING); |
||
| 25 | } |
||
| 26 | Smartobject\Utility::getCollapsableBar('currencyedit', _AM_SOBJECT_CURRENCIES_EDIT, _AM_SOBJECT_CURRENCIES_EDIT_INFO); |
||
| 27 | |||
| 28 | $sform = $currencyObj->getForm(_AM_SOBJECT_CURRENCIES_EDIT, 'addcurrency'); |
||
| 29 | $sform->display(); |
||
| 30 | Smartobject\Utility::closeCollapsable('currencyedit'); |
||
| 31 | } else { |
||
| 32 | if ($showmenu) { |
||
| 33 | //Smartobject\Utility::getAdminMenu(5, _AM_SOBJECT_CURRENCIES . " > " . _CO_SOBJECT_CREATINGNEW); |
||
| 34 | } |
||
| 35 | |||
| 36 | Smartobject\Utility::getCollapsableBar('currencycreate', _AM_SOBJECT_CURRENCIES_CREATE, _AM_SOBJECT_CURRENCIES_CREATE_INFO); |
||
| 37 | $sform = $currencyObj->getForm(_AM_SOBJECT_CURRENCIES_CREATE, 'addcurrency'); |
||
| 38 | $sform->display(); |
||
| 39 | Smartobject\Utility::closeCollapsable('currencycreate'); |
||
| 40 | } |
||
| 41 | } |
||
| 42 | |||
| 43 | require_once __DIR__ . '/admin_header.php'; |
||
| 44 | //require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
||
| 45 | //require_once SMARTOBJECT_ROOT_PATH . 'class/currency.php'; |
||
| 46 | $smartobjectCurrencyHandler = Smartobject\Helper::getInstance()->getHandler('Currency'); |
||
| 47 | |||
| 48 | $op = ''; |
||
| 49 | |||
| 50 | if (isset($_GET['op'])) { |
||
| 51 | $op = $_GET['op']; |
||
| 52 | } |
||
| 53 | if (isset($_POST['op'])) { |
||
| 54 | $op = $_POST['op']; |
||
| 55 | } |
||
| 56 | |||
| 57 | switch ($op) { |
||
| 58 | View Code Duplication | case 'mod': |
|
| 59 | $currencyid = \Xmf\Request::getInt('currencyid', 0, 'GET'); |
||
| 60 | |||
| 61 | Smartobject\Utility::getXoopsCpHeader(); |
||
| 62 | |||
| 63 | editclass(true, $currencyid); |
||
| 64 | break; |
||
| 65 | |||
| 66 | case 'updateCurrencies': |
||
| 67 | |||
| 68 | if (!isset($_POST['SmartobjectCurrency_objects']) || 0 == count($_POST['SmartobjectCurrency_objects'])) { |
||
| 69 | redirect_header($smart_previous_page, 3, _AM_SOBJECT_NO_RECORDS_TO_UPDATE); |
||
| 70 | } |
||
| 71 | |||
| 72 | if (isset($_POST['default_currency'])) { |
||
| 73 | $newDefaultCurrency = $_POST['default_currency']; |
||
| 74 | $sql = 'UPDATE ' . $smartobjectCurrencyHandler->table . ' SET default_currency=0'; |
||
| 75 | $smartobjectCurrencyHandler->query($sql); |
||
| 76 | $sql = 'UPDATE ' . $smartobjectCurrencyHandler->table . ' SET default_currency=1 WHERE currencyid=' . $newDefaultCurrency; |
||
| 77 | $smartobjectCurrencyHandler->query($sql); |
||
| 78 | } |
||
| 79 | |||
| 80 | /* |
||
| 81 | $criteria = new \CriteriaCompo(); |
||
| 82 | $criteria->add(new \Criteria('currencyid', '(' . implode(', ', $_POST['SmartobjectCurrency_objects']) . ')', 'IN')); |
||
| 83 | $currenciesObj = $smartobjectCurrencyHandler->getObjects($criteria, true); |
||
| 84 | |||
| 85 | foreach ($currenciesObj as $currencyid=>$currencyObj) { |
||
| 86 | //$bookingObj->setVar('attended', isset($_POST['attended_' . $bookingid]) ? (int)($_POST['attended_' . $bookingid]): 0); |
||
| 87 | $smartobjectCurrencyHandler->insert($currencyObj); |
||
| 88 | } |
||
| 89 | */ |
||
| 90 | redirect_header($smart_previous_page, 3, _AM_SOBJECT_RECORDS_UPDATED); |
||
| 91 | break; |
||
| 92 | |||
| 93 | case 'addcurrency': |
||
| 94 | // require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
||
| 95 | $controller = new ObjectController($smartobjectCurrencyHandler); |
||
| 96 | $controller->storeFromDefaultForm(_AM_SOBJECT_CURRENCIES_CREATED, _AM_SOBJECT_CURRENCIES_MODIFIED, SMARTOBJECT_URL . 'admin/currency.php'); |
||
| 97 | |||
| 98 | break; |
||
| 99 | |||
| 100 | case 'del': |
||
| 101 | // require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
||
| 102 | $controller = new ObjectController($smartobjectCurrencyHandler); |
||
| 103 | $controller->handleObjectDeletion(); |
||
| 104 | |||
| 105 | break; |
||
| 106 | |||
| 107 | View Code Duplication | default: |
|
| 108 | |||
| 109 | Smartobject\Utility::getXoopsCpHeader(); |
||
| 110 | |||
| 111 | //Smartobject\Utility::getAdminMenu(5, _AM_SOBJECT_CURRENCIES); |
||
| 112 | |||
| 113 | Smartobject\Utility::getCollapsableBar('createdcurrencies', _AM_SOBJECT_CURRENCIES, _AM_SOBJECT_CURRENCIES_DSC); |
||
| 114 | |||
| 115 | // require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
||
| 116 | $objectTable = new Table($smartobjectCurrencyHandler); |
||
| 117 | $objectTable->addColumn(new ObjectColumn('name', 'left', false, 'getCurrencyLink')); |
||
|
0 ignored issues
–
show
|
|||
| 118 | $objectTable->addColumn(new ObjectColumn('rate', 'center', 150)); |
||
|
0 ignored issues
–
show
150 is of type integer, but the function expects a boolean.
It seems like the type of the argument is not accepted by the function/method which you are calling. In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug. We suggest to add an explicit type cast like in the following example: function acceptsInteger($int) { }
$x = '123'; // string "123"
// Instead of
acceptsInteger($x);
// we recommend to use
acceptsInteger((integer) $x);
Loading history...
|
|||
| 119 | $objectTable->addColumn(new ObjectColumn('iso4217', 'center', 150)); |
||
|
0 ignored issues
–
show
150 is of type integer, but the function expects a boolean.
It seems like the type of the argument is not accepted by the function/method which you are calling. In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug. We suggest to add an explicit type cast like in the following example: function acceptsInteger($int) { }
$x = '123'; // string "123"
// Instead of
acceptsInteger($x);
// we recommend to use
acceptsInteger((integer) $x);
Loading history...
|
|||
| 120 | $objectTable->addColumn(new ObjectColumn('default_currency', 'center', 150, 'getDefaultCurrencyControl')); |
||
|
0 ignored issues
–
show
150 is of type integer, but the function expects a boolean.
It seems like the type of the argument is not accepted by the function/method which you are calling. In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug. We suggest to add an explicit type cast like in the following example: function acceptsInteger($int) { }
$x = '123'; // string "123"
// Instead of
acceptsInteger($x);
// we recommend to use
acceptsInteger((integer) $x);
Loading history...
'getDefaultCurrencyControl' is of type string, but the function expects a boolean.
It seems like the type of the argument is not accepted by the function/method which you are calling. In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug. We suggest to add an explicit type cast like in the following example: function acceptsInteger($int) { }
$x = '123'; // string "123"
// Instead of
acceptsInteger($x);
// we recommend to use
acceptsInteger((integer) $x);
Loading history...
|
|||
| 121 | |||
| 122 | $objectTable->addIntroButton('addcurrency', 'currency.php?op=mod', _AM_SOBJECT_CURRENCIES_CREATE); |
||
| 123 | |||
| 124 | $objectTable->addActionButton('updateCurrencies', _SUBMIT, _AM_SOBJECT_CURRENCY_UPDATE_ALL); |
||
|
0 ignored issues
–
show
_AM_SOBJECT_CURRENCY_UPDATE_ALL is of type string, but the function expects a boolean.
It seems like the type of the argument is not accepted by the function/method which you are calling. In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug. We suggest to add an explicit type cast like in the following example: function acceptsInteger($int) { }
$x = '123'; // string "123"
// Instead of
acceptsInteger($x);
// we recommend to use
acceptsInteger((integer) $x);
Loading history...
|
|||
| 125 | |||
| 126 | $objectTable->render(); |
||
| 127 | |||
| 128 | echo '<br>'; |
||
| 129 | Smartobject\Utility::closeCollapsable('createdcurrencies'); |
||
| 130 | echo '<br>'; |
||
| 131 | |||
| 132 | break; |
||
| 133 | } |
||
| 134 | |||
| 135 | //Smartobject\Utility::getModFooter(); |
||
| 136 | //xoops_cp_footer(); |
||
| 137 | require_once __DIR__ . '/admin_footer.php'; |
||
| 138 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: