// fix uri $_SERVER['REQUEST_URI'] = $this->getRequest()->getRequestUri(); // reset view $this->view->legacy = NULL; $this->_helper->layout->enableLayout(); // redirect/forward if (!empty($_POST['_next']) && $_POST['_next'] == 'post') { // forward POST request $this->_forward($this->_getParam('action'), $this->_getParam('controller'), 'admin'); } else { // redirect GET request setcookie("TOL_Language", $f_login_language); if (array_key_exists(SecurityToken::SECURITY_TOKEN, $_GET)) { $_SERVER['REQUEST_URI'] .= sprintf('&%s=%s', SecurityToken::SECURITY_TOKEN, SecurityToken::GetToken()); } $this->_redirect($_SERVER['REQUEST_URI'], array('prependBase' => false)); } return; } } // // Invalid logins start here. // // Record the attempt LoginAttempts::RecordLoginAttempt(); // CAPTCHA invalid -> captcha login page if ($validateCaptcha && !PhpCaptcha::Validate($f_captcha_code, true)) { return 'captcha'; } // Everything else return 'userpass';