예제 #1
0
 public function autologinAction()
 {
     if ($email = $this->getRequest()->getParam("email") and $token = $this->getRequest()->getParam("token")) {
         try {
             $admin = new Admin_Model_Admin();
             $admin->find($email, "email");
             if (!$admin->getId()) {
                 throw new Exception($this->_("The user doesn't exist."));
             }
             if ($admin->getLoginToken() != $token) {
                 throw new Exception($this->_("Authentication failed"));
             }
             $this->getSession()->setAdmin($admin);
             $this->_redirect("admin/application/list");
         } catch (Exception $e) {
         }
     }
 }