コード例 #1
0
ファイル: signin.php プロジェクト: Kit-kat1/bluz
            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');
};
コード例 #2
0
ファイル: Auth.php プロジェクト: 9618211/framework
 /**
  * Clear identity and user agent information
  * @api
  * @return void
  */
 public function clearIdentity()
 {
     $this->identity = null;
     Session::delete('auth:identity');
     Session::delete('auth:agent');
 }
コード例 #3
0
ファイル: Crud.php プロジェクト: bobrofor/menuProject
 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);
 }