Beispiel #1
0
 public function editReplyAction()
 {
     $id = $this->intVal(3);
     $threadModel = new ThreadModel();
     $reply = $threadModel->replyByReplyId($id, 0);
     if ($this->userid == 0) {
         header("location: /thread/show/{$reply['threadid']}/");
     }
     if ($reply["userid"] != $this->userid) {
         header("location: /thread/show/{$reply['threadid']}/");
     }
     if ($_POST && strlen($_POST["replyid"]) > 0 && strlen($_POST["content"]) > 0) {
         $reply = $threadModel->replyByReplyId($_POST["replyid"], 0);
         if ($reply["userid"] != $this->userid) {
             header("location: /thread/show/{$reply['threadid']}/");
             die;
         }
         $data = array();
         $data["id"] = $_POST["replyid"];
         $data["updatedate"] = time();
         $data["content"] = $_POST["content"];
         $threadModel->updateReply($data);
         header("location: /thread/show/{$_POST['threadid']}/");
         die;
     }
     $this->_mainContent->assign("reply", $reply);
     $this->_mainContent->assign("userid", $this->userid);
     $this->_mainContent->assign("isEmailValidated", $this->isEmailValidated);
     $this->display();
 }