Exemplo n.º 1
0
 public function _pre()
 {
     $this->_setExceptionHandler(BackendExceptionHandler::class);
     $value = $this->request->getCookie("auth");
     $newPwd = PasswordUtil::getPassword();
     if ($value != md5($newPwd)) {
         throw new \Exception("timeout!");
     }
 }
Exemplo n.º 2
0
 public function doAuthAction()
 {
     $password = $this->request->getPost("pwd");
     $newPwd = PasswordUtil::getPassword();
     if ($newPwd != $password) {
         throw new \Exception("System Err.1");
     }
     $this->response->setCookie("auth", md5($newPwd), "/", TRUE);
     return $this->_alertRedirect("Success!", "/backend/welcome");
 }