Beispiel #1
0
 public function showAction()
 {
     header('Pragma: ');
     header("cache-control: s-maxage=600");
     $id = $this->intVal(3);
     if ($id == 0) {
         header('HTTP/1.1 301 Moved Permanently');
         header("location:/user/show/0/");
     }
     $userModel = new UserModel();
     $threadModel = new ThreadModel();
     $cacheModel = new FilecacheModel();
     $userinfo = $cacheModel->getCache("userinfo", "{$id}");
     if (!$userinfo) {
         $userinfo = $userModel->userInfo($id);
         $userinfo["image"] = DiscuzModel::get_avatar($id, "middle");
         $userinfo["threadscreate"] = $threadModel->threadsByUserid($id);
         $userinfo["threadsreply"] = $threadModel->threadsReplyByUserid($id);
         $cacheModel->createCache("userinfo", "{$id}", $userinfo);
     }
     $this->_mainContent->assign("user", $userinfo);
     $this->setTitle($userinfo["username"]);
     $this->display();
 }
Beispiel #2
0
 public function banuserAction()
 {
     $userModel = new UserModel();
     $threadModel = new ThreadModel();
     if ($_POST) {
         $userid = $_POST["userid"];
         if ($userid <= 0 || $userid == 2) {
             header('HTTP/1.1 301 Moved Permanently');
             header("location:/home/");
             die;
         }
         $userModel->banUser($userid);
         if ($_POST["delallthread"]) {
             $threadModel->delUserAllThread($userid);
         }
         if ($_POST["delallreply"]) {
             $threadModel->delUserAllReply($userid);
         }
         header('HTTP/1.1 301 Moved Permanently');
         header("location:/user/show/{$userid}/");
         die;
     }
     $id = $this->intVal(3);
     if ($id == 0 || $id == 2 || $this->userid != 2) {
         header('HTTP/1.1 301 Moved Permanently');
         header("location:/home/");
     }
     $userinfo = $userModel->userInfo($id);
     $userinfo["image"] = DiscuzModel::get_avatar($id, "middle");
     $userinfo["threadscreate"] = $threadModel->threadsByUserid($id, 5);
     $this->_mainContent->assign("user", $userinfo);
     $this->display();
 }