Beispiel #1
0
 public function action_delete()
 {
     $this->template->page_title = 'Delete Entry';
     $entry_id = $this->request->param('id');
     if (!$entry_id) {
         throw new Exception('ID must not be empty!');
     }
     $entry = new Model_Entry();
     if (!Security::check($this->request->param('id2'))) {
         throw new HTTP_Exception_401("Bad token!");
     }
     $delete_entry = $entry->delete_entry($entry_id);
     if (!$delete_entry) {
         throw new Exception('Error with deleting entry!');
     }
     $this->request->redirect('cp/entries');
 }