/** * Save password rule * * @return void */ public function saveTask() { // Check for request forgeries Request::checkToken(); if (!User::authorise('core.manage', $this->_option) && !User::authorise('core.admin', $this->_option) && !User::authorise('core.create', $this->_option) && !User::authorise('core.edit', $this->_option)) { App::abort(403, Lang::txt('JERROR_ALERTNOAUTHOR')); } // Incoming password rule edits $fields = Request::getVar('fields', array(), 'post'); // Load the record $row = Rule::oneOrNew($fields['id'])->set($fields); // Try to save if (!$row->save()) { Notify::error($row->getError()); return $this->editTask($row); } Notify::success(Lang::txt('COM_MEMBERS_PASSWORD_RULES_SAVE_SUCCESS')); // Redirect if ($this->getTask() == 'apply') { return $this->editTask($row); } // Redirect $this->cancelTask(); }