/** * Removes [a] password blacklist item(s) * * @return void */ public function removeTask() { // Check for request forgeries Request::checkToken(); if (!User::authorise('core.manage', $this->_option) && !User::authorise('core.admin', $this->_option) && !User::authorise('core.delete', $this->_option)) { App::abort(403, Lang::txt('JERROR_ALERTNOAUTHOR')); } // Incoming $ids = Request::getVar('id', array()); $ids = !is_array($ids) ? array($ids) : $ids; $i = 0; // Do we have any IDs? if (!empty($ids)) { // Loop through each ID and delete the necessary items foreach ($ids as $id) { $id = intval($id); // Remove the record $row = Blacklist::oneOrFail($id); if (!$row->destroy()) { Notify::error($row->getError()); continue; } $i++; } } else { Notify::warning(Lang::txt('COM_MEMBERS_PASSWORD_BLACKLIST_DELETE_NO_ROW_SELECTED')); } // Output messsage and redirect if ($i) { Notify::success(Lang::txt('COM_MEMBERS_PASSWORD_BLACKLIST_DELETE_SUCCESS')); } $this->cancelTask(); }