Example #1
0
 public function deleteAction()
 {
     if ($this->request->isPost()) {
         $auser = new model\aUser();
         $auser->id = $_POST["id"];
         if ($auser->delete() == false) {
             $this->flag(FALSE, '×');
         } else {
             $this->flag(TRUE, '√');
         }
     }
 }
Example #2
0
 public function indexAction()
 {
     if ($this->request->isPost() == true) {
         if (!$this->security->checkToken()) {
             $this->view->errorMsg = "检查到跨域攻击";
             return;
         }
         $name = $_POST["name"];
         $password = $_POST["password"];
         $db_user = model\aUser::findFirstByName($name);
         if ($db_user) {
             if (!password_verify($password, $db_user->pwd_hash)) {
                 $this->view->errorMsg = '密码错误';
                 return;
             } else {
                 $this->session->set("current_admin", serialize($db_user));
                 $this->response->redirect("admin/admin/index");
                 $this->view->disable();
                 return;
             }
         } else {
             $this->view->errorMsg = '用户尚未注册,请联系管理员';
         }
     }
 }