public static function checkParameters($parameters) { if (Controller::$action == 'add' && empty($parameters[0]) && array_key_exists('url', $_REQUEST)) { $parameters[0] = $_REQUEST['url']; } $parameters = parent::checkParameters($parameters); return $parameters; }
public static function checkParameters($parameters) { $parameters = parent::checkParameters($parameters); if (Controller::$action == 'display') { $parameters[1] = array_key_exists(1, $parameters) ? $parameters[1] : 0; $parameters[2] = array_key_exists(2, $parameters) ? $parameters[2] : Value::get('TagContentListLength', 10); } else { if (in_array(Controller::$action, array('display'))) { if (!isset(Controller::$parameters[0])) { $parameters[1] = 0; } if (!isset(Controller::$parameters[2])) { $parameters[2] = Value::get('list_length', 5); } } } return $parameters; }
public static function checkParameters($parameters) { $parameters = parent::checkParameters($parameters); switch (Controller::$action) { case 'login': if (empty($parameters[0])) { $parameters[0] = Controller::getVar('username'); } if (empty($parameters[1])) { $parameters[1] = Controller::getVar('password'); } break; case 'confirm': if (empty($parameters[0])) { $parameters[0] = Controller::getVar('salt'); } case 'signup': if (array_key_exists('user', $_SESSION) && $_SESSION['BackendUser']->id > 0) { Controller::setAction('display'); } break; case 'update': case 'display': if (array_key_exists('BackendUser', $_SESSION) && $_SESSION['BackendUser']->id > 0) { //If empty, set it to the current user if (empty($parameters['0'])) { $parameters[0] = $_SESSION['BackendUser']->id; } //If not set to current user, and user doesn't have permissions, set to current user if ($parameters[0] != $_SESSION['BackendUser']->id && !Permission::check('manage', class_for_url(get_called_class())) && Permission::check(Controller::$action, class_for_url(get_called_class()))) { $parameters[0] = $_SESSION['BackendUser']->id; } } break; } return $parameters; }