示例#1
0
 public function act(AutoLogin $auto)
 {
     $ds = new DataStore_Memcache();
     $ds->setDsn(array('scope' => 'autologin'));
     $auto->setDataStore($ds);
     $auto->logout();
     return 'redirect:/AutoLoginMemcache';
 }
示例#2
0
 public function filter(AutoLogin $auto)
 {
     $ds = new DataStore_Memcache();
     $ds->setDsn(array('scope' => 'autologin'));
     $auto->setDataStore($ds);
     $startNow = $auto->autoLoginStart();
     $this->logined = $auto->isLogined();
     $this->loginMessage = $auto->getUserId() . ' is logined with memcache!';
     if ($startNow) {
         // Initialize application session values
     }
 }
示例#3
0
 public function act(Session_Login $login, AutoLogin $auto, Result $res)
 {
     if (!$login->login($this->name, $this->password)) {
         $res->message = 'login failed!';
         // for output
         return 'action:AutoLoginMemcache';
     }
     $ds = new DataStore_Memcache();
     $ds->setDsn(array('scope' => 'autologin'));
     $auto->setDataStore($ds);
     $ret = $auto->login($this->name, $this->auto);
     return 'redirect:/AutoLoginMemcache';
 }