예제 #1
0
파일: events.php 프로젝트: anqqa/Anqh
 /**
  * Delete event
  *
  * @param  int|string  $event_id
  */
 public function _event_delete($event_id)
 {
     $this->history = false;
     $event = new Event_Model((int) $event_id);
     // For authenticated users only
     if (!$this->user || !csrf::valid() || !$event->is_author() && !$this->visitor->logged_in(array('admin', 'event moderator'))) {
         url::back('/events');
     }
     if ($event->id) {
         $event->delete();
         url::redirect('/events');
     }
     url::back('/events');
 }