示例#1
0
 /**
  * Thread delete
  * 
  * @access  public
  * @params  integer
  * @return  Response
  */
 public function action_delete($id = null)
 {
     \Util_security::check_method('POST');
     \Util_security::check_csrf();
     try {
         \DB::start_transaction();
         $thread = Model_Thread::check_authority($id, $this->u->id);
         $thread->delete();
         \DB::commit_transaction();
         \Session::set_flash('message', term('thread') . 'を削除しました。');
     } catch (\FuelException $e) {
         if (\DB::in_transaction()) {
             \DB::rollback_transaction();
         }
         \Session::set_flash('error', $e->getMessage());
     }
     \Response::redirect('thread');
 }