/** * Performs the delete action. * * @todo: could be worth to require a security token in the url and check it. Currently confirmation is done through javascript confirmation only. */ public function delete() { if (!$this->is_allowed_to_edit()) { $this->forbidden(); return; } // $is_valid = Security::check_token(); // if (!$is_valid) { // $this->listing(); // return false; // } $description->c_id = Request::get_c_id(); $description->id = Request::get_id(); $repo = CourseDescription::repository(); $success = $repo->remove($description); $message = $success ? get_lang('CourseDescriptionDeleted') : get_lang('Error'); $home = $this->url(); Redirect::go($home); }
/** * */ public function delete() { if (!$this->is_allowed_to_edit()) { $this->forbidden(); return; } $description = (object) array(); $description->c_id = Request::get_c_id(); $description->id = Request::get_id(); $success = CourseDescription::repository()->remove($description); $this->response($success); }