public function update_library() { if (Loader::helper("validation/token")->validate('update_library')) { if ($this->post('activeLibrary')) { $scl = SystemAntispamLibrary::getByHandle($this->post('activeLibrary')); if (is_object($scl)) { $scl->activate(); Config::save('ANTISPAM_NOTIFY_EMAIL', $this->post('ANTISPAM_NOTIFY_EMAIL')); Config::save('ANTISPAM_LOG_SPAM', $this->post('ANTISPAM_LOG_SPAM')); if ($scl->hasOptionsForm() && $this->post('ccm-submit-submit')) { $controller = $scl->getController(); $controller->saveOptions($this->post()); } $this->redirect('/dashboard/system/permissions/antispam', 'saved'); } else { $this->error->add(t('Invalid anti-spam library.')); } } else { SystemAntispamLibrary::deactivateAll(); } } else { $this->error->add(Loader::helper('validation/token')->getErrorMessage()); } $this->view(); }