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(); }
public function __construct() { Loader::model('system/antispam/library'); $library = SystemAntispamLibrary::getActive(); if (is_object($library)) { $this->controller = $library->getController(); } }
/** * Returns an array of package items (e.g. blocks, themes) */ public function getPackageItems() { $items = array(); Loader::model('single_page'); Loader::library('mail/importer'); Loader::model('job'); Loader::model('collection_types'); Loader::model('system/captcha/library'); Loader::model('system/antispam/library'); $items['attribute_categories'] = AttributeKeyCategory::getListByPackage($this); $items['permission_categories'] = PermissionKeyCategory::getListByPackage($this); $items['permission_access_entity_types'] = PermissionAccessEntityType::getListByPackage($this); $items['attribute_keys'] = AttributeKey::getListByPackage($this); $items['attribute_sets'] = AttributeSet::getListByPackage($this); $items['group_sets'] = GroupSet::getListByPackage($this); $items['page_types'] = CollectionType::getListByPackage($this); $items['mail_importers'] = MailImporter::getListByPackage($this); $items['configuration_values'] = Config::getListByPackage($this); $items['block_types'] = BlockTypeList::getByPackage($this); $items['page_themes'] = PageTheme::getListByPackage($this); $items['permissions'] = PermissionKey::getListByPackage($this); $items['single_pages'] = SinglePage::getListByPackage($this); $items['attribute_types'] = AttributeType::getListByPackage($this); $items['captcha_libraries'] = SystemCaptchaLibrary::getListByPackage($this); $items['antispam_libraries'] = SystemAntispamLibrary::getListByPackage($this); $items['jobs'] = Job::getListByPackage($this); $items['workflow_types'] = WorkflowType::getListByPackage($this); ksort($items); return $items; }
public static function getListByPackage($pkg) { $db = Loader::db(); $saslHandles = $db->GetCol('select saslHandle from SystemAntispamLibraries where pkgID = ? order by saslHandle asc', array($pkg->getPackageID())); $libraries = array(); foreach ($saslHandles as $saslHandle) { $sasl = SystemAntispamLibrary::getByHandle($saslHandle); $libraries[] = $sasl; } return $libraries; }
/** * Returns an array of package items (e.g. blocks, themes) */ public function getPackageItems() { $items = array(); Loader::model('single_page'); Loader::library('mail/importer'); Loader::model('job'); Loader::model('collection_types'); Loader::model('system/captcha/library'); Loader::model('system/antispam/library'); $items['attribute_categories'] = AttributeKeyCategory::getListByPackage($this); $items['attribute_keys'] = AttributeKey::getListByPackage($this); $items['attribute_sets'] = AttributeSet::getListByPackage($this); $items['page_types'] = CollectionType::getListByPackage($this); $items['mail_importers'] = MailImporter::getListByPackage($this); $items['configuration_values'] = Config::getListByPackage($this); $items['block_types'] = BlockTypeList::getByPackage($this); $items['page_themes'] = PageTheme::getListByPackage($this); $tp = new TaskPermissionList(); $items['task_permissions'] = $tp->populatePackagePermissions($this); $items['single_pages'] = SinglePage::getListByPackage($this); $items['attribute_types'] = AttributeType::getListByPackage($this); $items['captcha_libraries'] = SystemCaptchaLibrary::getListByPackage($this); $items['antispam_libraries'] = SystemAntispamLibrary::getListByPackage($this); $items['jobs'] = Job::getListByPackage($this); ksort($items); return $items; }