if (empty($login)) { throw new Exception("Login is empty"); } if (empty($password)) { throw new Exception("Password is empty"); } // login/password // throw AuthException Auth\Table::getInstance()->authenticateEquals($login, $password); if ($rememberMe) { Auth\Table::getInstance()->generateCookie(); } Messages::addNotice('You are signed'); // try to rollback to previous called URL if ($rollback = Session::get('rollback')) { Session::delete('rollback'); $this->redirect($rollback); } // try back to index $this->redirectTo('index', 'index'); } catch (Exception $e) { Messages::addError($e->getMessage()); $view->login = $login; } catch (AuthException $e) { Messages::addError($e->getMessage()); $view->login = $login; } } // change layout $this->useLayout('small.phtml'); };
/** * Clear identity and user agent information * @api * @return void */ public function clearIdentity() { $this->identity = null; Session::delete('auth:identity'); Session::delete('auth:agent'); }
public function readOne($primary) { $filesArray = unserialize(Session::get('files')); $path = Config::getModuleData('menu', 'full_path'); if ($filesArray) { foreach ($filesArray as $file) { $filename = $path . $file->getFullName(); if (is_file($filename)) { unlink($filename); } } } Session::delete('files'); return parent::readOne($primary); }