Ejemplo n.º 1
0
 public function logoutAction()
 {
     $auth = Yasui_Auth::getInstance();
     $authAdapter = $auth->getAdapter('DB');
     $authAdapter->deAuthenticate();
     $this->redirect($this->_request()->baseURL());
 }
Ejemplo n.º 2
0
 public function preDispatch()
 {
     $auth = Yasui_Auth::getInstance();
     $authAdapter = $auth->getAdapter('DB');
     if (!$authAdapter->isAuthenticate()) {
         $this->redirect($this->_request()->baseURL() . 'user/login');
     }
 }
Ejemplo n.º 3
0
<?php

set_include_path(get_include_path() . PATH_SEPARATOR . 'library/');
require 'BootStrap.php';
Yasui_Registry::set('config', new Yasui_Config('config.ini', 'ini'));
$auth = Yasui_Auth::getInstance();
$authAdapter = $auth->getAdapter('DB');
$authAdapter->setAuthLocation('users')->setIdentityColumn('email')->setCredentialColumn('password')->setCredentialCrypt('md5');
$view = Yasui_View::getInstance();
$view->addHelperPath('application/views/helpers/');
$view->setPluginConf('menuAuth', array('authAdapter' => $authAdapter));
$view->authenticate = $authAdapter->isAuthenticate();
$front->dispatch();