Exemplo n.º 1
0
 public function login()
 {
     if (IS_POST) {
         $data['username'] = $_POST['username'];
         $data['password'] = $_POST['password'];
         $verify = $_POST['verify'];
         $User = new \Home\Model\UserModel();
         if (!$this->checkVerify($verify)) {
             $this->ajaxReturn($this->ajaxReturnMessage(2));
         }
         if ($User->checkLogin($data['username'], $data['password'])) {
             $this->ajaxReturn($this->ajaxReturnMessage(4));
         } else {
             $this->ajaxReturn($this->ajaxReturnMessage(3));
         }
     }
     if (!$this->is_login()) {
         $this->display("login");
     } else {
         $this->redirect("index");
     }
 }