Exemple #1
0
 public function reauthenticate(Zend_Auth_Adapter_Interface $adapter, $id)
 {
     $result = $adapter->reauthenticate($id);
     if ($result->isValid()) {
         require_once 'Zend/Session.php';
         Zend_Session::regenerateId();
         $user = $adapter->getResultRowObject();
         $this->getStorage()->write($user->name);
         $this->getStorage()->writeData($user);
         $this->getStorage()->writeExpires(time() + $this->_lifetime);
         $this->getStorage()->writeIpAddress($_SERVER['REMOTE_ADDR']);
         require_once 'Zend/Date.php';
         $date = new Zend_Date();
         $date->setTimezone('UTC');
         $now = $date->get(Zend_Date::ISO_8601);
         $data = array('lastLogin' => $now, 'lastRequest' => $now);
         $adapter->update($user->id, $data);
     }
     return $result;
 }