예제 #1
0
 /**
  * Save blacklisted password
  *
  * @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 blacklist edits
     $fields = Request::getVar('fields', array(), 'post');
     // Load the record
     $row = Blacklist::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_BLACKLIST_SAVE_SUCCESS'));
     // Fall through to edit form
     if ($this->getTask() == 'apply') {
         return $this->editTask($row);
     }
     // Redirect
     $this->cancelTask();
 }