public function actionLogin() { $api = Api_InterfaceAbstract::instance(); // @todo password is currently sent as plain text if (!isset($_POST['username']) or !isset($_POST['password'])) { $this->actionLoginForm(); } else { $loginInfo = $api->callApi('user', 'login', array($_POST['username'], $_POST['password'], $_POST['vb_login_md5password'], $_POST['vb_login_md5password_utf'], '')); if (isset($loginInfo['errors']) and !empty($loginInfo['errors'])) { $errorIds = array(); foreach ($loginInfo['errors'] as $k => $error) { $errorIds[] = $errorId = array_shift($error); // this enables the template code to parse phrases with unknown number of variables $loginInfo['errors'][$k] = array($errorId, $error); } $loginErrors = array('errors' => $loginInfo['errors'], 'errorIds' => implode(' ', $errorIds)); $this->actionLoginForm($loginErrors, array('username' => $_POST['username'], 'remembermeCheckedAttr' => (isset($_POST['rememberme']) and $_POST['rememberme']) ? ' checked="checked"' : '')); } else { vB5_Auth::setLoginCookies($loginInfo, '', !empty($_POST['rememberme'])); vB5_Auth::doLoginRedirect(); } } }