Просмотр исходного кода

Ticket #3675 - Toxicity Filters for Antispam module.

Alexander 4 лет назад
Родитель
Сommit
9431d9d09e

+ 59 - 3
inc/classes/BxDolForm.php

@@ -725,6 +725,7 @@ class BxDolForm extends BxDol implements iBxDolReplaceable
     protected $oTemplate;
 
     protected $_isValid = true;
+    protected $_bForceSetToPending = false;
     protected $_sChecker;
     protected $_sCheckerHelper;
     protected $_aSpecificValues;
@@ -858,6 +859,10 @@ class BxDolForm extends BxDol implements iBxDolReplaceable
                 $this->_isValid = false;
 
         }
+
+        bx_alert('system', 'form_check', 0, 0, array(
+            'object' => &$this,
+        ));
     }
 
     function getKeyValuesPair ()
@@ -873,25 +878,71 @@ class BxDolForm extends BxDol implements iBxDolReplaceable
 
     function insert ($aValsToAdd = array(), $isIgnore = false)
     {
+        $this->autoSetToPending($aValsToAdd);
+
         $oChecker = new $this->_sChecker($this->_sCheckerHelper);
         $oChecker->setFormMethod($this->aFormAttrs['method'], $this->_aSpecificValues);
         $sSql = $oChecker->dbInsert($this->aParams['db'], $this->aInputs, $aValsToAdd, $isIgnore);
         if (!$sSql)
             return false;
         $oDb = BxDolDb::getInstance();
-        if ($oDb->query($sSql))
-            return $oDb->lastId();
+        if ($oDb->query($sSql)) {
+            $iRes = $oDb->lastId();
+
+            bx_alert('system', 'form_submitted', $iRes, bx_get_logged_profile_id(), array(
+                'module' => isset($this->aParams['module']) ? $this->aParams['module'] : '',
+                'entry_id' => $iRes,
+                'action' => 'insert',
+                'form_object' => &$this,
+            ));
+
+            return $iRes;
+        }
         return false;
     }
 
     function update ($val, $aValsToAdd = array(), &$aTrackTextFieldsChanges = null)
     {
+        $this->autoSetToPending($aValsToAdd);
+
         $oChecker = new $this->_sChecker($this->_sCheckerHelper);
         $oChecker->setFormMethod($this->aFormAttrs['method'], $this->_aSpecificValues);
         $sSql = $oChecker->dbUpdate($val, $this->aParams['db'], $this->aInputs, $aValsToAdd, $aTrackTextFieldsChanges);
         if (!$sSql)
             return false;
-        return BxDolDb::getInstance()->query($sSql);
+        $bRes = BxDolDb::getInstance()->query($sSql);
+
+        bx_alert('system', 'form_submitted', $val, bx_get_logged_profile_id(), array(
+            'module' => isset($this->aParams['module']) ? $this->aParams['module'] : '',
+            'entry_id' => $val,
+            'action' => 'update',
+            'form_object' => &$this,
+        ));
+
+        return $bRes;
+    }
+
+    function isStatusFieldSupported() {
+        // check whether we have a status field available for this type of content
+        if (isset($this->aParams['module']) && $this->aParams['module'] && $oModule = BxDolModule::getInstance($this->aParams['module'])) {
+            $CNF = &$oModule->_oConfig->CNF;
+            if ((isset($CNF['FIELD_STATUS_ADMIN']) || isset($CNF['FIELD_STATUS'])) &&
+                isset($this->aParams['db']['table']) && isset($CNF['TABLE_ENTRIES']) && $this->aParams['db']['table'] == $CNF['TABLE_ENTRIES']) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    function autoSetToPending(&$aValsToAdd) {
+        if ($this->isStatusFieldSupported() && $this->_bForceSetToPending) {
+            $oModule = BxDolModule::getInstance($this->aParams['module']);
+            $CNF = &$oModule->_oConfig->CNF;
+
+            if (isset($CNF['FIELD_STATUS_ADMIN'])) $aValsToAdd[$CNF['FIELD_STATUS_ADMIN']] = BX_BASE_MOD_TEXT_STATUS_HIDDEN;
+            elseif (isset($CNF['FIELD_STATUS'])) $aValsToAdd[$CNF['FIELD_STATUS']] = BX_BASE_MOD_TEXT_STATUS_AWAITING;
+        }
     }
 
     function delete ($val)
@@ -956,6 +1007,11 @@ class BxDolForm extends BxDol implements iBxDolReplaceable
         $this->aFormAttrs['name'] = $sName;
     }
 
+    function setForceSetToPending ($isValid)
+    {
+        $this->_bForceSetToPending = $isValid;
+    }
+
     function setValid ($isValid)
     {
         $this->_isValid = $isValid;

+ 6 - 1
inc/utils.inc.php

@@ -895,7 +895,7 @@ function bx_php_string_quot ($mixedInput)
  */
 function bx_file_get_contents($sFileUrl, $aParams = array(), $sMethod = 'get', $aHeaders = array(), &$sHttpCode = null, $aBasicAuth = array(), $iTimeout = 0, $aCustomCurlParams = array())
 {
-    if ('post' != $sMethod && 'post-json' != $sMethod)
+    if ('post' != $sMethod && 'post-json' != $sMethod && 'post-json-object' != $sMethod)
     	$sFileUrl = bx_append_url_params($sFileUrl, $aParams);
 
     $sResult = '';
@@ -933,6 +933,11 @@ function bx_file_get_contents($sFileUrl, $aParams = array(), $sMethod = 'get', $
             curl_setopt($rConnect, CURLOPT_POSTFIELDS, json_encode($aParams));
             $aHeaders[] = 'Content-Type: application/json';
         }
+        elseif ('post-json-object' == $sMethod) {
+            curl_setopt($rConnect, CURLOPT_POST, true);
+            curl_setopt($rConnect, CURLOPT_POSTFIELDS, json_encode($aParams, JSON_FORCE_OBJECT));
+            $aHeaders[] = 'Content-Type: application/json';
+        }
 
         if ($aHeaders)
             curl_setopt($rConnect, CURLOPT_HTTPHEADER, $aHeaders);

+ 6 - 0
modules/boonex/antispam/classes/BxAntispamAlertsResponse.php

@@ -35,6 +35,12 @@ class BxAntispamAlertsResponse extends BxDolAlertsResponse
                     if ((!isset($oAlert->aExtras['type']) || 'textarea' == $oAlert->aExtras['type']) && is_string($oAlert->aExtras['content']))
                         $oAlert->aExtras['is_spam'] = BxDolService::call('bx_antispam', 'is_spam', array(&$oAlert->aExtras['content']));
                     break;
+                case 'form_check':
+                    BxDolService::call('bx_antispam', 'check_form_for_toxicity', array(&$oAlert->aExtras['object']));
+                    break;
+                case 'form_submitted':
+                    BxDolService::call('bx_antispam', 'on_form_submitted', array($oAlert->aExtras['module'], $oAlert->aExtras['entry_id']));
+                    break;
             }
         }
     }

+ 6 - 0
modules/boonex/antispam/classes/BxAntispamConfig.php

@@ -25,6 +25,9 @@ class BxAntispamConfig extends BxDolModuleConfig
         'disposable_email_domains_mode' => 'bx_antispam_disposable_email_domains_mode',
         'disposable_email_domains_behaviour_join' => 'bx_antispam_disposable_email_domains_behaviour_join',
         'profanity_enable' => 'bx_antispam_profanity_filter_enable',
+        'toxicity_enable' => 'bx_antispam_toxicity_filter_enable',
+        'toxicity_action' => 'bx_antispam_toxicity_filter_action',
+        'toxicity_report' => 'bx_antispam_toxicity_filter_report',
     );
     /**
      * default local options, it is filled in with real system options in class contructor, @see restoreAntispamOptions
@@ -38,6 +41,9 @@ class BxAntispamConfig extends BxDolModuleConfig
         'dnsbl_behaviour_join' => 'approval',
         'akismet_enable' => '',
         'profanity_enable' => '',
+        'toxicity_enable' => '',
+        'toxicity_action' => '',
+        'toxicity_report' => '',
     );
 
     public function __construct($aModule)

+ 168 - 0
modules/boonex/antispam/classes/BxAntispamModule.php

@@ -11,6 +11,8 @@
 
 class BxAntispamModule extends BxDolModule
 {
+    private $_bLastSubmittedFormWasToxic;
+
     public function __construct(&$aModule)
     {
         parent::__construct($aModule);
@@ -134,6 +136,160 @@ class BxAntispamModule extends BxDolModule
         return false;
     }
 
+    /**
+     * Check text for toxicity.
+     * It can send report if toxic content is found or tries to inform caller to block the content (depending on configuration).
+     *
+     * @param $sContent content to check for spam
+     * @param $sIp IP address of content poster
+     * @param $isStripSlashes slashes parameter:
+     *          BX_SLASHES_AUTO - automatically detect magic_quotes_gpc setting
+     *          BX_SLASHES_NO_ACTION - do not perform any action with slashes
+     * @return true if spam detected and content shouln't be recorded, false if content should be processed as usual.
+     */
+    public function serviceIsToxic ($sContent, $sIp = '', $isStripSlashes = BX_SLASHES_AUTO)
+    {
+        if (defined('BX_DOL_CRON_EXECUTE') || isAdmin())
+            return false;
+
+        static $aQuickCache;
+        $key = md5($sContent);
+        if (isset($aQuickCache[$key]))
+            return $aQuickCache[$key];
+
+        $aQuickCache[$key] = false;
+
+        if (!$this->serviceIsIpWhitelisted($sIp)) {
+            if (version_compare(phpversion(), '7.4.0', '<') && function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc() && $isStripSlashes == BX_SLASHES_AUTO)
+                $sContent = stripslashes($sContent);
+
+            if ('on' == $this->_oConfig->getAntispamOption('toxicity_enable')) {
+                $oPerspectiveAPI = bx_instance('BxAntispamPerspectiveAPI', array(), $this->_aModule);
+                if ($oPerspectiveAPI->isToxic($sContent)) {
+                    $oPerspectiveAPI->onPositiveDetection($sContent);
+                    $aQuickCache[$key] = true;
+                }
+            }
+        }
+
+        return $aQuickCache[$key];
+    }
+
+    public function serviceCheckFormForToxicity(&$oForm) {
+        $this->_bLastSubmittedFormWasToxic = false;
+
+        if (!$oForm->isValid() || !$oForm->isSubmitted()) return false;
+
+        $sSubmitName = false;
+        $sFormText = '';
+        foreach ($oForm->aInputs as $k => $a) {
+            if (isset($a['visible_for_levels']) && !BxDolForm::isVisible($a))
+                continue;
+
+            if (empty($a['name']) || 'submit' == $a['type'] || 'reset' == $a['type'] || 'button' == $a['type'] || 'value' == $a['type']) {
+                if (isset($a['type']) && 'submit' == $a['type'])
+                    $sSubmitName = $k;
+                continue;
+            }
+
+            if ('input_set' == $a['type'])
+                foreach ($a as $r)
+                    if (isset($r['type']) && 'submit' == $r['type'])
+                        $sSubmitName = $k;
+
+            $a['name'] = str_replace('[]', '', $a['name']);
+
+            if ($a['type'] != 'textarea' && $a['type'] != 'text')
+                continue;
+
+            $val = BxDolForm::getSubmittedValue($a['name'], $oForm->aFormAttrs['method']);
+            if (!$val)
+                continue;
+
+            $sFormText .= " ".$val; // collect all text fields into a single text
+        }
+
+        if ($this->serviceIsToxic($sFormText)) {
+            $this->_bLastSubmittedFormWasToxic = true;
+
+            $sActionrequired = $this->_oConfig->getAntispamOption('toxicity_action');
+
+            if ($sActionrequired == 'block' || $sActionrequired == 'disapprove' && !$oForm->isStatusFieldSupported()) {
+                $oForm->setValid(false);
+                $this->serviceOnToxicContentBlocked($sFormText);
+
+                if ($sSubmitName)
+                    $oForm->aInputs[$sSubmitName]['error'] = _t('_bx_antispam_form_submission_error');
+            } elseif ($sActionrequired == 'disapprove' && $oForm->isStatusFieldSupported()) {
+                $oForm->setForceSetToPending(true);
+                return false;
+            }
+        }
+    }
+
+    public function serviceOnFormSubmitted($sModule, $iEntry) {
+        if ($this->_bLastSubmittedFormWasToxic) {
+            $this->serviceOnToxicContentPosted($sModule, $iEntry);
+        }
+    }
+
+    public function serviceOnToxicContentBlocked(&$sText) {
+        if ('on' == $this->_oConfig->getAntispamOption('toxicity_report')) {
+            $oProfile = BxDolProfile::getInstance();
+            if (!$oProfile) return;
+            $aPlus = array(
+                'AuthorUrl' => $oProfile->getUrl(),
+                'AuthorNickName' => $oProfile->getDisplayName(),
+                'Page' => htmlspecialchars_adv($_SERVER['PHP_SELF']),
+                'Content' => htmlspecialchars_adv(strip_tags($sText)),
+            );
+
+            $aTemplate = BxDolEmailTemplates::getInstance()->parseTemplate('bx_antispam_toxicity_blocked_report', $aPlus);
+            if (!$aTemplate)
+                trigger_error('Email template or translation missing: bx_antispam_toxicity_blocked_report', E_USER_ERROR);
+
+            sendMail(getParam('site_email'), $aTemplate['Subject'], $aTemplate['Body']);
+        }
+    }
+
+    public function serviceOnToxicContentPosted($sModule, $iContentId) {
+        if ('on' == $this->_oConfig->getAntispamOption('toxicity_report') && $sModule) {
+            $oModule = BxDolModule::getInstance($sModule);
+            $CNF = &$oModule->_oConfig->CNF;
+            $sContentUrl = isset($CNF['URI_VIEW_ENTRY']) ? BX_DOL_URL_ROOT.BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $iContentId) : false;
+            $sManageContentUrl = isset($CNF['URL_MANAGE_ADMINISTRATION']) ? BX_DOL_URL_ROOT.BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URL_MANAGE_ADMINISTRATION']) : false;
+
+            $oProfile = BxDolProfile::getInstance();
+            if (!$oProfile) return;
+
+            $aPlus = array(
+                'AuthorUrl' => $oProfile->getUrl(),
+                'AuthorNickName' => $oProfile->getDisplayName(),
+                'Page' => htmlspecialchars_adv($_SERVER['PHP_SELF']),
+                'bx_if:content_url' => [
+                    'condition' => boolval($sContentUrl),
+                    'content' => ['c_url' => $sContentUrl],
+                ],
+                'bx_if:manage_content_url' => [
+                    'condition' => boolval($sManageContentUrl),
+                    'content' => ['m_url' => $sManageContentUrl],
+                ],
+            );
+
+            $aTemplate = BxDolEmailTemplates::getInstance()->parseTemplate('bx_antispam_toxicity_posted_report', $aPlus);
+            if (!$aTemplate)
+                trigger_error('Email template or translation missing: bx_antispam_toxicity_posted_report', E_USER_ERROR);
+
+            sendMail(getParam('site_email'), $aTemplate['Subject'], $aTemplate['Body']);
+
+            bx_alert('bx_antispam', 'toxic_content_posted', $iContentId, bx_get_logged_profile_id(), array(
+                'module' => $sModule,
+                'entry_id' => $iContentId,
+                'etrny_url' => $sContentUrl,
+            ));
+        }
+    }
+
     /**
      * Perform complex check if user is allowed to login.
      * First it checks if IP is directly blocked (@see serviceIsIpBlocked),
@@ -319,6 +475,18 @@ class BxAntispamModule extends BxDolModule
         return $oProfanityFilter->getDicts(); 
     }
 
+    /**
+     * @return array with avaliable toxicity filter actions
+     */
+    public function serviceGetToxicityFilterActions ()
+    {
+        return [
+            'none' => _t('_bx_antispam_option_toxicity_filter_action_none'),
+            'block' => _t('_bx_antispam_option_toxicity_filter_action_block'),
+            'disapprove' => _t('_bx_antispam_option_toxicity_filter_action_disapprove'),
+        ];
+    }
+
     protected function getErrorMessageIpBlocked ()
     {
         bx_import('BxDolLanguages');

+ 68 - 0
modules/boonex/antispam/classes/BxAntispamPerspectiveAPI.php

@@ -0,0 +1,68 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Antispam Antispam
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Toxicity detection based on the message content and logged in user info - http://www.perspectiveapi.com
+ */
+
+define('BX_ANTISPAM_PERSPECTIVE_API_URL', 'https://commentanalyzer.googleapis.com/v1alpha1/comments:analyze');
+
+class BxAntispamPerspectiveAPI extends BxDol
+{
+    private $_sAPIKey;
+    private $_iThreshold;
+
+    public function __construct()
+    {
+        parent::__construct();
+        $this->_sAPIKey = getParam('bx_antispam_toxicity_filter_api_key');
+        $this->_iThreshold = getParam('bx_antispam_toxicity_filter_threshold');
+    }
+
+    public function isToxic ($s)
+    {
+        if (!$this->_sAPIKey || !$this->_iThreshold)
+            return false;
+
+        $aRequest = [
+            'comment' => ['text' => $s],
+            'doNotStore' => true,
+            'requestedAttributes' => [
+                'TOXICITY' => [],
+            ],
+        ];
+
+        $sResponse = bx_file_get_contents(
+            bx_append_url_params(BX_ANTISPAM_PERSPECTIVE_API_URL, ['key' => $this->_sAPIKey]),
+            $aRequest,
+            'post-json-object'
+        );
+
+        $aResponse = [];
+        if ($sResponse) $aResponse = json_decode($sResponse, true);
+
+        // if we get any score then compare it with a threshold
+        if ($aResponse && isset($aResponse['attributeScores']) && isset($aResponse['attributeScores']['TOXICITY']) && isset($aResponse['attributeScores']['TOXICITY']['summaryScore'])) {
+            return $aResponse['attributeScores']['TOXICITY']['summaryScore']['value'] >= $this->_iThreshold/100;
+        }
+
+        // in any other case consider this text as non toxic
+        return false;
+    }
+
+    public function onPositiveDetection ($sExtraData = '')
+    {
+        $o = bx_instance('DNSBlacklists', array(), 'bx_antispam');
+        $o->onPositiveDetection (getVisitorIP(), $sExtraData, 'toxicity_filter');
+    }
+}
+
+/** @} */

+ 37 - 0
modules/boonex/antispam/install/langs/en.xml

@@ -12,6 +12,7 @@
     <li><b>Akismet</b> - automatic spam content blocking using <a target="_blank" href="http://akismet.com">Akismet service</a></li>
     <li><b>StopForumSpam</b> - automatic spam content blocking using <a target="_blank" href="http://www.stopforumspam.com">StopForumSpam service</a></li>
     <li><b>Profanity filter</b> - profanity filter, based on a predefined list of words with the ability to add to words this list</a></li>
+    <li><b>Toxicity filter</b> - toxicity filter, based on a <a target="_blank" href="https://www.perspectiveapi.com/">Perspective API</a> provided by Google</a></li>
 </ul>
 ]]></string>
     <string name="_bx_antispam_help_dnsbl"><![CDATA[
@@ -166,5 +167,41 @@ This antispam method scan submitted content for the URLs and check them if any o
 <pre>
 {SpamContent}
 </pre>
+{email_footer}]]></string>
+
+	<string name="_bx_antispam_type_toxicity_filter"><![CDATA[Toxicity Filter]]></string>
+	<string name="_bx_antispam_adm_stg_cpt_category_toxicity_filter"><![CDATA[Toxicity filter]]></string>
+	<string name="_bx_antispam_option_toxicity_filter_enable"><![CDATA[Enable toxicity filter]]></string>
+	<string name="_bx_antispam_option_toxicity_filter_action"><![CDATA[Action]]></string>
+	<string name="_bx_antispam_option_toxicity_filter_action_none"><![CDATA[None]]></string>
+	<string name="_bx_antispam_option_toxicity_filter_action_block"><![CDATA[Block all toxic content]]></string>
+	<string name="_bx_antispam_option_toxicity_filter_action_disapprove"><![CDATA[Disapprove all toxic content if possible, block the rest]]></string>
+	<string name="_bx_antispam_option_toxicity_report"><![CDATA[Send report to admin if toxic content discovered]]></string>
+	<string name="_bx_antispam_option_toxicity_filter_api_key"><![CDATA[Perspective API key (see <a href="https://developers.perspectiveapi.com/s/docs-get-started">this</a> page on how obtain it)]]></string>
+	<string name="_bx_antispam_option_toxicity_filter_threshold"><![CDATA[Toxicity threshold to consider a text as toxic (0 - 100)]]></string>
+	<string name="_bx_antispam_form_submission_error"><![CDATA[Incorrect info. The form seems to contain some toxic content. Please, check your inputs and try to submit again.]]></string>
+
+	<string name="_bx_antispam_toxicity_blocked_report_name"><![CDATA[Toxicity blocked report message]]></string>
+    <string name="_bx_antispam_toxicity_blocked_report_subject"><![CDATA[Toxic content has been blocked]]></string>
+    <string name="_bx_antispam_toxicity_blocked_report_body"><![CDATA[{email_header}
+<b>Profile:</b> <a href="{AuthorUrl}">{AuthorNickName}</a><br />
+<b>Page:</b> {Page}<br /><br />
+<b>Content:</b>
+<pre>
+{Content}
+</pre>
+{email_footer}]]></string>
+
+	<string name="_bx_antispam_toxicity_posted_report_name"><![CDATA[Toxicity posted report message]]></string>
+    <string name="_bx_antispam_toxicity_posted_report_subject"><![CDATA[Toxic content has been posted]]></string>
+    <string name="_bx_antispam_toxicity_posted_report_body"><![CDATA[{email_header}
+<b>Profile:</b> <a href="{AuthorUrl}">{AuthorNickName}</a><br />
+<b>Page:</b> {Page}<br /><br />
+<bx_if:content_url>
+	<b>Content:</b> <a href="{c_url}">{c_url}</a><br /><br />
+</bx_if:content_url>
+<bx_if:manage_content_url>
+	<b>Manage:</b> <a href="{m_url}">{m_url}</a><br /><br />
+</bx_if:manage_content_url>
 {email_footer}]]></string>
 </resources>

+ 242 - 227
modules/boonex/antispam/install/sql/enable.sql

@@ -1,227 +1,242 @@
-
--- settings
-
-SET @iTypeOrder = (SELECT MAX(`order`) FROM `sys_options_types` WHERE `group` = 'modules');
-INSERT INTO `sys_options_types` (`group`, `name`, `caption`, `icon`, `order`) VALUES 
-('modules', 'bx_antispam', '_bx_antispam_adm_stg_cpt_type', 'bx_antispam@modules/boonex/antispam/|std-icon.svg', IF(NOT ISNULL(@iTypeOrder), @iTypeOrder + 1, 1));
-SET @iTypeId = LAST_INSERT_ID();
-
-
-
-INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )  
-VALUES (@iTypeId, 'bx_antispam_general', '_bx_antispam_adm_stg_cpt_category_general', 1);
-SET @iCategoryId = LAST_INSERT_ID();
-
-INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
-(@iCategoryId, 'bx_antispam_block', '_bx_antispam_option_block', '', 'checkbox', '', '', '', 10),
-(@iCategoryId, 'bx_antispam_report', '_bx_antispam_option_report', 'on', 'checkbox', '', '', '', 20);
-
-
-
-INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )  
-VALUES (@iTypeId, 'bx_antispam_ip_table', '_bx_antispam_adm_stg_cpt_category_ip_table', 2);
-SET @iCategoryId = LAST_INSERT_ID();
-
-INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
-(@iCategoryId, 'bx_antispam_ip_list_type', '_bx_antispam_option_ip_list_type', '0', 'select', 'a:3:{s:6:"module";s:11:"bx_antispam";s:6:"method";s:13:"config_values";s:6:"params";a:1:{i:0;s:8:"ip_table";}}', '', '', 10);
-
-
-
-INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )  
-VALUES (@iTypeId, 'bx_antispam_dnsbl', '_bx_antispam_adm_stg_cpt_category_dnsbl', 3);
-SET @iCategoryId = LAST_INSERT_ID();
-
-INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
-(@iCategoryId, 'bx_antispam_dnsbl_enable', '_bx_antispam_option_dnsbl_enable', 'on', 'checkbox', '', '', '', 10),
-(@iCategoryId, 'bx_antispam_dnsbl_behaviour_login', '_bx_antispam_option_dnsbl_behaviour_login', 'block', 'select', 'a:3:{s:6:"module";s:11:"bx_antispam";s:6:"method";s:13:"config_values";s:6:"params";a:1:{i:0;s:11:"dnsbl_login";}}', '', '', 20),
-(@iCategoryId, 'bx_antispam_dnsbl_behaviour_join', '_bx_antispam_option_dnsbl_behaviour_join', 'approval', 'select', 'a:3:{s:6:"module";s:11:"bx_antispam";s:6:"method";s:13:"config_values";s:6:"params";a:1:{i:0;s:10:"dnsbl_join";}}', '', '', 30),
-(@iCategoryId, 'bx_antispam_uridnsbl_enable', '_bx_antispam_option_uridnsbl_enable', 'on', 'checkbox', '', '', '', 40);
-
-
-
-INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )  
-VALUES (@iTypeId, 'bx_antispam_akismet', '_bx_antispam_adm_stg_cpt_category_akismet', 4);
-SET @iCategoryId = LAST_INSERT_ID();
-
-INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
-(@iCategoryId, 'bx_antispam_akismet_enable', '_bx_antispam_option_akismet_enable', '', 'checkbox', '', '', '', 10),
-(@iCategoryId, 'bx_antispam_akismet_api_key', '_bx_antispam_option_akismet_api_key', '', 'digit', '', '', '', 20);
-
-
-
-INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )  
-VALUES (@iTypeId, 'bx_antispam_stopforumspam', '_bx_antispam_adm_stg_cpt_category_stopforumspam', 5);
-SET @iCategoryId = LAST_INSERT_ID();
-
-INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
-(@iCategoryId, 'bx_antispam_stopforumspam_enable', '_bx_antispam_option_stopforumspam_enable', 'on', 'checkbox', '', '', '', 10),
-(@iCategoryId, 'bx_antispam_stopforumspam_api_key', '_bx_antispam_option_stopforumspam_api_key', '', 'digit', '', '', '', 20);
-
-INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )  
-VALUES (@iTypeId, 'bx_antispam_disposable_email_domains', '_bx_antispam_adm_stg_cpt_category_disposable_email_domains', 6);
-SET @iCategoryId = LAST_INSERT_ID();
-
-INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
-(@iCategoryId, 'bx_antispam_disposable_email_domains_mode', '_bx_antispam_option_disposable_email_domains_mode', 'blacklist', 'select', 'a:3:{s:6:"module";s:11:"bx_antispam";s:6:"method";s:13:"config_values";s:6:"params";a:1:{i:0;s:29:"disposable_email_domains_mode";}}', '', '', 10),
-(@iCategoryId, 'bx_antispam_disposable_email_domains_behaviour_join', '_bx_antispam_option_disposable_email_domains_behaviour_join', 'block', 'select', 'a:3:{s:6:"module";s:11:"bx_antispam";s:6:"method";s:13:"config_values";s:6:"params";a:1:{i:0;s:29:"disposable_email_domains_join";}}', '', '', 20);
-
-
-INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )  
-VALUES (@iTypeId, 'bx_antispam_profanity_filter', '_bx_antispam_adm_stg_cpt_category_profanity_filter', 7);
-SET @iCategoryId = LAST_INSERT_ID();
-
-INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
-(@iCategoryId, 'bx_antispam_profanity_filter_enable', '_bx_antispam_option_profanity_filter_enable', '', 'checkbox', '', '', '', 10),
-(@iCategoryId, 'bx_antispam_profanity_filter_dicts', '_bx_antispam_option_profanity_filter_dicts', '', 'list', 'a:2:{s:6:"module";s:11:"bx_antispam";s:6:"method";s:26:"get_profanity_filter_dicts";}', '', '', 15),
-(@iCategoryId, 'bx_antispam_profanity_filter_bad_words_list', '_bx_antispam_option_profanity_filter_bad_words_list', '', 'text', '', '', '', 20),
-(@iCategoryId, 'bx_antispam_profanity_filter_char_replace', '_bx_antispam_option_profanity_filter_char_replace', '*', 'digit', '', '', '', 30),
-(@iCategoryId, 'bx_antispam_profanity_filter_white_words_list', '_bx_antispam_option_profanity_filter_white_words_list', '', 'text', '', '', '', 40),
-(@iCategoryId, 'bx_antispam_profanity_filter_full_words_only', '_bx_antispam_option_profanity_filter_full_words_only', 'on', 'checkbox', '', '', '', 50);
-
-
--- page: DNSBL list
-
-INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
-('bx_antispam_dnsbl', 'antispam-dnsbl-list', '_bx_antispam_page_title_sys_dnsbl_list', '_bx_antispam_page_title_dnsbl_list', 'bx_antispam', 5, 128, 1, 'page.php?i=antispam-dnsbl-list', '', '', '', 0, 1, 0, 'BxAntispamPage', 'modules/boonex/antispam/classes/BxAntispamPage.php');
-
-INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
-('bx_antispam_dnsbl', 1, 'bx_antispam', '_bx_antispam_page_block_title_dnsbl_list', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:11:\"bx_antispam\";s:6:\"method\";s:10:\"dnsbl_list\";}', 0, 1, 1, 1);
-
--- page: ip table
-
-INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
-('bx_antispam_ip_table', 'antispam-ip-table', '_bx_antispam_page_title_sys_ip_table', '_bx_antispam_page_title_ip_table', 'bx_antispam', 5, 128, 1, 'page.php?i=antispam-ip-table', '', '', '', 0, 1, 0, 'BxAntispamPage', 'modules/boonex/antispam/classes/BxAntispamPage.php');
-
-INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
-('bx_antispam_ip_table', 1, 'bx_antispam', '_bx_antispam_page_block_title_ip_table', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:11:\"bx_antispam\";s:6:\"method\";s:8:\"ip_table\";}', 0, 1, 1, 1);
-
--- page: block log
-
-INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
-('bx_antispam_block_log', 'antispam-block-log', '_bx_antispam_page_title_sys_block_log', '_bx_antispam_page_title_block_log', 'bx_antispam', 5, 192, 1, 'page.php?i=antispam-block-log', '', '', '', 0, 1, 0, 'BxAntispamPage', 'modules/boonex/antispam/classes/BxAntispamPage.php');
-
-INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
-('bx_antispam_block_log', 1, 'bx_antispam', '_bx_antispam_page_block_title_block_log', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:11:\"bx_antispam\";s:6:\"method\";s:9:\"block_log\";}', 0, 1, 1, 1);
-
--- grid: DNSBL
-
-INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
-('bx_antispam_grid_dnsbl', 'Sql', 'SELECT `id`, `chain`, `zonedomain`, `postvresp`, `url`, `recheck`, `comment`, `added`, `active` FROM `bx_antispam_dnsbl_rules`', 'bx_antispam_dnsbl_rules', 'id', 'added', 'active', '', 16, NULL, 'start', '', 'chain,zonedomain,url,recheck', 'comment', 'auto', 'chain,zonedomain', 'comment', 128, 'BxAntispamGridDNSBL', 'modules/boonex/antispam/classes/BxAntispamGridDNSBL.php');
-
-INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
-('bx_antispam_grid_dnsbl', 'switcher', '_sys_active', '10%', 0, 0, '', 1),
-('bx_antispam_grid_dnsbl', 'chain', '_bx_antispam_field_chain', '15%', 0, 0, '', 2),
-('bx_antispam_grid_dnsbl', 'zonedomain', '_bx_antispam_field_zonedomain', '15%', 0, 0, '', 3),
-('bx_antispam_grid_dnsbl', 'comment', '_bx_antispam_field_note', '55%', 0, 0, '', 4),
-('bx_antispam_grid_dnsbl', 'actions', '_sys_actions', '5%', 0, 0, '', 5);
-
-INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `confirm`, `order`) VALUES
-('bx_antispam_grid_dnsbl', 'independent', 'log', '_bx_antispam_grid_action_log', '', 0, 1),
-('bx_antispam_grid_dnsbl', 'independent', 'recheck', '_bx_antispam_grid_action_recheck', '', 0, 2),
-('bx_antispam_grid_dnsbl', 'independent', 'add', '_bx_antispam_grid_action_add', '', 0, 3),
-('bx_antispam_grid_dnsbl', 'independent', 'help', '_bx_antispam_grid_action_help', '', 0, 4),
-('bx_antispam_grid_dnsbl', 'single', 'delete', '', 'remove',  1, 1);
-
--- grid: ip table
-
-INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_mode`, `sorting_fields`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
-('bx_antispam_grid_ip_table', 'Sql', 'SELECT `ID`, `From`, `To`, `Type`, `LastDT`, `Desc` FROM `bx_antispam_ip_table`', 'bx_antispam_ip_table', 'ID', '', '', 10, NULL, 'start', '', 'From,To,Desc', 'auto', 'From,To,Type,LastDT,Desc', 128, 'BxAntispamGridIpTable', 'modules/boonex/antispam/classes/BxAntispamGridIpTable.php');
-
-INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `params`, `order`) VALUES
-('bx_antispam_grid_ip_table', 'checkbox', '_sys_select', '2%', '', 1),
-('bx_antispam_grid_ip_table', 'From', '_bx_antispam_field_ip_from', '15%', '', 2),
-('bx_antispam_grid_ip_table', 'To', '_bx_antispam_field_ip_to', '15%', '', 3),
-('bx_antispam_grid_ip_table', 'Type', '_bx_antispam_field_action', '15%', '', 4),
-('bx_antispam_grid_ip_table', 'LastDT', '_bx_antispam_field_expiration', '15%', '', 5),
-('bx_antispam_grid_ip_table', 'Desc', '_bx_antispam_field_note', '26%', '', 6),
-('bx_antispam_grid_ip_table', 'actions', '_sys_actions', '12%', '', 7);
-
-INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `confirm`, `order`) VALUES
-('bx_antispam_grid_ip_table', 'bulk', 'delete', '_bx_antispam_grid_action_delete', '', 1, 1),
-('bx_antispam_grid_ip_table', 'single', 'edit', '', 'pencil-alt', 0, 1),
-('bx_antispam_grid_ip_table', 'single', 'delete', '', 'remove',  1, 2),
-('bx_antispam_grid_ip_table', 'independent', 'add', '_bx_antispam_grid_action_add', '', 0, 1);
-
--- grid: block log
-
-INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
-('bx_antispam_grid_block_log', 'Sql', 'SELECT `id`, `ip`, `profile_id`, `type`, `extra`, `added` FROM `bx_antispam_block_log`', 'bx_antispam_block_log', 'id', 'id', '', '', 8, NULL, 'start', '', 'type,extra', '', 'auto', 'ip,profile_id,type,extra,added', '', 192, 'BxAntispamGridBlockLog', 'modules/boonex/antispam/classes/BxAntispamGridBlockLog.php');
-
-INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
-('bx_antispam_grid_block_log', 'ip', '_bx_antispam_field_ip', '20%', 0, 0, '', 1),
-('bx_antispam_grid_block_log', 'profile_id', '_bx_antispam_field_profile_id', '20%', 0, 0, '', 2),
-('bx_antispam_grid_block_log', 'type', '_bx_antispam_field_type', '15%', 0, 0, '', 3),
-('bx_antispam_grid_block_log', 'extra', '_bx_antispam_field_note', '15%', 0, 8, '', 4),
-('bx_antispam_grid_block_log', 'added', '_bx_antispam_field_when', '30%', 0, 0, '', 5);
-
--- data list: ip table actions
-
-INSERT INTO `sys_form_pre_lists`(`module`, `key`, `title`, `use_for_sets`) VALUES 
-('bx_antispam', 'bx_antispam_ip_table_actions', '_bx_antispam_data_list_ip_table_actions', 0);
-
-INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `LKey`, `LKey2`, `Order`) VALUES 
-('bx_antispam_ip_table_actions', 'allow', '_bx_antispam_ip_allow', '', 0),
-('bx_antispam_ip_table_actions', 'deny', '_bx_antispam_ip_deny', '', 0);
-
--- form: IP table add/edit
-
-INSERT INTO `sys_objects_form`(`object`, `module`, `title`, `action`, `form_attrs`, `table`, `key`, `uri`, `uri_title`, `submit_name`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
-('bx_antispam_ip_table_form', 'bx_antispam', '_bx_antispam_form_ip_table', 'grid.php?o={grid_object}&a={grid_action}', '', 'bx_antispam_ip_table', 'ID', '', '', 'bx_antispam_ip_table_submit', '', 0, 1, '', '');
-
-INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES 
-('bx_antispam_ip_table_form', 'bx_antispam_ip_table_form_add', 'bx_antispam', 0, '_bx_antispam_form_ip_table_add'),
-('bx_antispam_ip_table_form', 'bx_antispam_ip_table_form_edit', 'bx_antispam', 0, '_bx_antispam_form_ip_table_edit');
-
-INSERT INTO `sys_form_inputs`(`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES 
-('bx_antispam_ip_table_form', 'bx_antispam', 'ID', '', '', 0, 'hidden', '_bx_antispam_field_id', '', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
-('bx_antispam_ip_table_form', 'bx_antispam', 'From', '', '', 0, 'text', '_bx_antispam_field_ip_from', '_bx_antispam_field_ip_from', '', 1, 0, 0, '', '', '', 'preg', 'a:1:{s:4:\"preg\";s:20:\"#\\d+\\.\\d+\\.\\d+\\.\\d+#\";}', '_bx_antispam_field_ip_err_msg', 'Xss', '', 1, 0),
-('bx_antispam_ip_table_form', 'bx_antispam', 'To', '', '', 0, 'text', '_bx_antispam_field_ip_to', '_bx_antispam_field_ip_to', '', 1, 0, 0, '', '', '', 'preg', 'a:1:{s:4:\"preg\";s:20:\"#\\d+\\.\\d+\\.\\d+\\.\\d+#\";}', '_bx_antispam_field_ip_err_msg', 'Xss', '', 1, 0),
-('bx_antispam_ip_table_form', 'bx_antispam', 'Type', 'allow', '#!bx_antispam_ip_table_actions', 0, 'select', '_bx_antispam_field_action', '_bx_antispam_field_action', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
-('bx_antispam_ip_table_form', 'bx_antispam', 'LastDT', '', '', 0, 'datetime', '_bx_antispam_field_expiration', '_bx_antispam_field_expiration', '', 1, 0, 0, '', '', '', 'date_time', '', '_bx_antispam_field_expiration_err_msg', 'DateTimeTs', '', 1, 0),
-('bx_antispam_ip_table_form', 'bx_antispam', 'Desc', '', '', 0, 'text', '_bx_antispam_field_note', '_bx_antispam_field_note', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
-('bx_antispam_ip_table_form', 'bx_antispam', 'bx_antispam_ip_table_submit', '_sys_submit', '', 0, 'submit', '_sys_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
-('bx_antispam_ip_table_form', 'bx_antispam', 'close', '_sys_close', '', 0, 'reset', '_sys_close', '', '', 0, 0, 0, 'a:2:{s:7:\"onclick\";s:46:\"$(\'.bx-popup-applied:visible\').dolPopupHide();\";s:5:\"class\";s:22:\"bx-def-margin-sec-left\";}', '', '', '', '', '', '', '', 1, 0),
-('bx_antispam_ip_table_form', 'bx_antispam', 'buttons', '', 'bx_antispam_ip_table_submit,close', 0, 'input_set', '_bx_antispam_form_buttons', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0);
-
-INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES 
-('bx_antispam_ip_table_form_add', 'ID', 2147483647, 0, 0),
-('bx_antispam_ip_table_form_add', 'From', 2147483647, 1, 1),
-('bx_antispam_ip_table_form_add', 'To', 2147483647, 1, 2),
-('bx_antispam_ip_table_form_add', 'Type', 2147483647, 1, 3),
-('bx_antispam_ip_table_form_add', 'LastDT', 2147483647, 1, 4),
-('bx_antispam_ip_table_form_add', 'Desc', 2147483647, 1, 5),
-('bx_antispam_ip_table_form_add', 'bx_antispam_ip_table_submit', 2147483647, 1, 6),
-('bx_antispam_ip_table_form_add', 'close', 2147483647, 1, 7),
-('bx_antispam_ip_table_form_add', 'buttons', 2147483647, 1, 8),
-('bx_antispam_ip_table_form_edit', 'ID', 2147483647, 1, 0),
-('bx_antispam_ip_table_form_edit', 'From', 2147483647, 1, 1),
-('bx_antispam_ip_table_form_edit', 'To', 2147483647, 1, 2),
-('bx_antispam_ip_table_form_edit', 'Type', 2147483647, 1, 3),
-('bx_antispam_ip_table_form_edit', 'LastDT', 2147483647, 1, 4),
-('bx_antispam_ip_table_form_edit', 'Desc', 2147483647, 1, 5),
-('bx_antispam_ip_table_form_edit', 'bx_antispam_ip_table_submit', 2147483647, 1, 6),
-('bx_antispam_ip_table_form_edit', 'close', 2147483647, 1, 7),
-('bx_antispam_ip_table_form_edit', 'buttons', 2147483647, 1, 8);
-
--- alerts
-
-INSERT INTO `sys_alerts_handlers` (`name`, `class`, `file`, `service_call`) VALUES 
-('bx_antispam', 'BxAntispamAlertsResponse', 'modules/boonex/antispam/classes/BxAntispamAlertsResponse.php', '');
-SET @iHandler := LAST_INSERT_ID();
-
-INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
-('account', 'check_login', @iHandler),
-('account', 'check_join', @iHandler),
-('system', 'check_spam', @iHandler);
-
--- email templates
-
-INSERT INTO `sys_email_templates` (`Module`, `NameSystem`, `Name`, `Subject`, `Body`) VALUES
-('bx_antispam', '_bx_antispam_spam_report_name', 'bx_antispam_spam_report', '_bx_antispam_spam_report_subject', '_bx_antispam_spam_report_body');
-
--- cron
-
-INSERT INTO `sys_cron_jobs` (`name`, `time`, `class`, `file`, `service_call`) VALUES
-('bx_antispam_pruning', '0 0 * * *', 'BxAntispamCronPruning', 'modules/boonex/antispam/classes/BxAntispamCronPruning.php', ''),
-('bx_antispam_update_disposable_email_domains', '0 0 */14 * *', 'BxAntispamCronUpdateDisposableEmailDomains', 'modules/boonex/antispam/classes/BxAntispamCronUpdateDisposableEmailDomains.php', '');
-
+
+-- settings
+
+SET @iTypeOrder = (SELECT MAX(`order`) FROM `sys_options_types` WHERE `group` = 'modules');
+INSERT INTO `sys_options_types` (`group`, `name`, `caption`, `icon`, `order`) VALUES 
+('modules', 'bx_antispam', '_bx_antispam_adm_stg_cpt_type', 'bx_antispam@modules/boonex/antispam/|std-icon.svg', IF(NOT ISNULL(@iTypeOrder), @iTypeOrder + 1, 1));
+SET @iTypeId = LAST_INSERT_ID();
+
+
+
+INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )  
+VALUES (@iTypeId, 'bx_antispam_general', '_bx_antispam_adm_stg_cpt_category_general', 1);
+SET @iCategoryId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
+(@iCategoryId, 'bx_antispam_block', '_bx_antispam_option_block', '', 'checkbox', '', '', '', 10),
+(@iCategoryId, 'bx_antispam_report', '_bx_antispam_option_report', 'on', 'checkbox', '', '', '', 20);
+
+
+
+INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )  
+VALUES (@iTypeId, 'bx_antispam_ip_table', '_bx_antispam_adm_stg_cpt_category_ip_table', 2);
+SET @iCategoryId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
+(@iCategoryId, 'bx_antispam_ip_list_type', '_bx_antispam_option_ip_list_type', '0', 'select', 'a:3:{s:6:"module";s:11:"bx_antispam";s:6:"method";s:13:"config_values";s:6:"params";a:1:{i:0;s:8:"ip_table";}}', '', '', 10);
+
+
+
+INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )  
+VALUES (@iTypeId, 'bx_antispam_dnsbl', '_bx_antispam_adm_stg_cpt_category_dnsbl', 3);
+SET @iCategoryId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
+(@iCategoryId, 'bx_antispam_dnsbl_enable', '_bx_antispam_option_dnsbl_enable', 'on', 'checkbox', '', '', '', 10),
+(@iCategoryId, 'bx_antispam_dnsbl_behaviour_login', '_bx_antispam_option_dnsbl_behaviour_login', 'block', 'select', 'a:3:{s:6:"module";s:11:"bx_antispam";s:6:"method";s:13:"config_values";s:6:"params";a:1:{i:0;s:11:"dnsbl_login";}}', '', '', 20),
+(@iCategoryId, 'bx_antispam_dnsbl_behaviour_join', '_bx_antispam_option_dnsbl_behaviour_join', 'approval', 'select', 'a:3:{s:6:"module";s:11:"bx_antispam";s:6:"method";s:13:"config_values";s:6:"params";a:1:{i:0;s:10:"dnsbl_join";}}', '', '', 30),
+(@iCategoryId, 'bx_antispam_uridnsbl_enable', '_bx_antispam_option_uridnsbl_enable', 'on', 'checkbox', '', '', '', 40);
+
+
+
+INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )  
+VALUES (@iTypeId, 'bx_antispam_akismet', '_bx_antispam_adm_stg_cpt_category_akismet', 4);
+SET @iCategoryId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
+(@iCategoryId, 'bx_antispam_akismet_enable', '_bx_antispam_option_akismet_enable', '', 'checkbox', '', '', '', 10),
+(@iCategoryId, 'bx_antispam_akismet_api_key', '_bx_antispam_option_akismet_api_key', '', 'digit', '', '', '', 20);
+
+
+
+INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )  
+VALUES (@iTypeId, 'bx_antispam_stopforumspam', '_bx_antispam_adm_stg_cpt_category_stopforumspam', 5);
+SET @iCategoryId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
+(@iCategoryId, 'bx_antispam_stopforumspam_enable', '_bx_antispam_option_stopforumspam_enable', 'on', 'checkbox', '', '', '', 10),
+(@iCategoryId, 'bx_antispam_stopforumspam_api_key', '_bx_antispam_option_stopforumspam_api_key', '', 'digit', '', '', '', 20);
+
+INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )  
+VALUES (@iTypeId, 'bx_antispam_disposable_email_domains', '_bx_antispam_adm_stg_cpt_category_disposable_email_domains', 6);
+SET @iCategoryId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
+(@iCategoryId, 'bx_antispam_disposable_email_domains_mode', '_bx_antispam_option_disposable_email_domains_mode', 'blacklist', 'select', 'a:3:{s:6:"module";s:11:"bx_antispam";s:6:"method";s:13:"config_values";s:6:"params";a:1:{i:0;s:29:"disposable_email_domains_mode";}}', '', '', 10),
+(@iCategoryId, 'bx_antispam_disposable_email_domains_behaviour_join', '_bx_antispam_option_disposable_email_domains_behaviour_join', 'block', 'select', 'a:3:{s:6:"module";s:11:"bx_antispam";s:6:"method";s:13:"config_values";s:6:"params";a:1:{i:0;s:29:"disposable_email_domains_join";}}', '', '', 20);
+
+
+INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )  
+VALUES (@iTypeId, 'bx_antispam_profanity_filter', '_bx_antispam_adm_stg_cpt_category_profanity_filter', 7);
+SET @iCategoryId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
+(@iCategoryId, 'bx_antispam_profanity_filter_enable', '_bx_antispam_option_profanity_filter_enable', '', 'checkbox', '', '', '', 10),
+(@iCategoryId, 'bx_antispam_profanity_filter_dicts', '_bx_antispam_option_profanity_filter_dicts', '', 'list', 'a:2:{s:6:"module";s:11:"bx_antispam";s:6:"method";s:26:"get_profanity_filter_dicts";}', '', '', 15),
+(@iCategoryId, 'bx_antispam_profanity_filter_bad_words_list', '_bx_antispam_option_profanity_filter_bad_words_list', '', 'text', '', '', '', 20),
+(@iCategoryId, 'bx_antispam_profanity_filter_char_replace', '_bx_antispam_option_profanity_filter_char_replace', '*', 'digit', '', '', '', 30),
+(@iCategoryId, 'bx_antispam_profanity_filter_white_words_list', '_bx_antispam_option_profanity_filter_white_words_list', '', 'text', '', '', '', 40),
+(@iCategoryId, 'bx_antispam_profanity_filter_full_words_only', '_bx_antispam_option_profanity_filter_full_words_only', 'on', 'checkbox', '', '', '', 50);
+
+
+INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )
+VALUES (@iTypeId, 'bx_antispam_toxicity_filter', '_bx_antispam_adm_stg_cpt_category_toxicity_filter', 8);
+SET @iCategoryId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
+(@iCategoryId, 'bx_antispam_toxicity_filter_enable', '_bx_antispam_option_toxicity_filter_enable', '', 'checkbox', '', '', '', 10),
+(@iCategoryId, 'bx_antispam_toxicity_filter_api_key', '_bx_antispam_option_toxicity_filter_api_key', '', 'digit', '', '', '', 20),
+(@iCategoryId, 'bx_antispam_toxicity_filter_action', '_bx_antispam_option_toxicity_filter_action', 'none', 'select', 'a:2:{s:6:"module";s:11:"bx_antispam";s:6:"method";s:27:"get_toxicity_filter_actions";}', '', '', 30),
+(@iCategoryId, 'bx_antispam_toxicity_filter_report', '_bx_antispam_option_toxicity_report', '', 'checkbox', 'on', '', '', 40),
+(@iCategoryId, 'bx_antispam_toxicity_filter_threshold', '_bx_antispam_option_toxicity_filter_threshold', '60', 'digit', '', '', '', 50);
+
+-- page: DNSBL list
+
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_antispam_dnsbl', 'antispam-dnsbl-list', '_bx_antispam_page_title_sys_dnsbl_list', '_bx_antispam_page_title_dnsbl_list', 'bx_antispam', 5, 128, 1, 'page.php?i=antispam-dnsbl-list', '', '', '', 0, 1, 0, 'BxAntispamPage', 'modules/boonex/antispam/classes/BxAntispamPage.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_antispam_dnsbl', 1, 'bx_antispam', '_bx_antispam_page_block_title_dnsbl_list', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:11:\"bx_antispam\";s:6:\"method\";s:10:\"dnsbl_list\";}', 0, 1, 1, 1);
+
+-- page: ip table
+
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_antispam_ip_table', 'antispam-ip-table', '_bx_antispam_page_title_sys_ip_table', '_bx_antispam_page_title_ip_table', 'bx_antispam', 5, 128, 1, 'page.php?i=antispam-ip-table', '', '', '', 0, 1, 0, 'BxAntispamPage', 'modules/boonex/antispam/classes/BxAntispamPage.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_antispam_ip_table', 1, 'bx_antispam', '_bx_antispam_page_block_title_ip_table', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:11:\"bx_antispam\";s:6:\"method\";s:8:\"ip_table\";}', 0, 1, 1, 1);
+
+-- page: block log
+
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_antispam_block_log', 'antispam-block-log', '_bx_antispam_page_title_sys_block_log', '_bx_antispam_page_title_block_log', 'bx_antispam', 5, 192, 1, 'page.php?i=antispam-block-log', '', '', '', 0, 1, 0, 'BxAntispamPage', 'modules/boonex/antispam/classes/BxAntispamPage.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_antispam_block_log', 1, 'bx_antispam', '_bx_antispam_page_block_title_block_log', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:11:\"bx_antispam\";s:6:\"method\";s:9:\"block_log\";}', 0, 1, 1, 1);
+
+-- grid: DNSBL
+
+INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
+('bx_antispam_grid_dnsbl', 'Sql', 'SELECT `id`, `chain`, `zonedomain`, `postvresp`, `url`, `recheck`, `comment`, `added`, `active` FROM `bx_antispam_dnsbl_rules`', 'bx_antispam_dnsbl_rules', 'id', 'added', 'active', '', 16, NULL, 'start', '', 'chain,zonedomain,url,recheck', 'comment', 'auto', 'chain,zonedomain', 'comment', 128, 'BxAntispamGridDNSBL', 'modules/boonex/antispam/classes/BxAntispamGridDNSBL.php');
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
+('bx_antispam_grid_dnsbl', 'switcher', '_sys_active', '10%', 0, 0, '', 1),
+('bx_antispam_grid_dnsbl', 'chain', '_bx_antispam_field_chain', '15%', 0, 0, '', 2),
+('bx_antispam_grid_dnsbl', 'zonedomain', '_bx_antispam_field_zonedomain', '15%', 0, 0, '', 3),
+('bx_antispam_grid_dnsbl', 'comment', '_bx_antispam_field_note', '55%', 0, 0, '', 4),
+('bx_antispam_grid_dnsbl', 'actions', '_sys_actions', '5%', 0, 0, '', 5);
+
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `confirm`, `order`) VALUES
+('bx_antispam_grid_dnsbl', 'independent', 'log', '_bx_antispam_grid_action_log', '', 0, 1),
+('bx_antispam_grid_dnsbl', 'independent', 'recheck', '_bx_antispam_grid_action_recheck', '', 0, 2),
+('bx_antispam_grid_dnsbl', 'independent', 'add', '_bx_antispam_grid_action_add', '', 0, 3),
+('bx_antispam_grid_dnsbl', 'independent', 'help', '_bx_antispam_grid_action_help', '', 0, 4),
+('bx_antispam_grid_dnsbl', 'single', 'delete', '', 'remove',  1, 1);
+
+-- grid: ip table
+
+INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_mode`, `sorting_fields`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
+('bx_antispam_grid_ip_table', 'Sql', 'SELECT `ID`, `From`, `To`, `Type`, `LastDT`, `Desc` FROM `bx_antispam_ip_table`', 'bx_antispam_ip_table', 'ID', '', '', 10, NULL, 'start', '', 'From,To,Desc', 'auto', 'From,To,Type,LastDT,Desc', 128, 'BxAntispamGridIpTable', 'modules/boonex/antispam/classes/BxAntispamGridIpTable.php');
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `params`, `order`) VALUES
+('bx_antispam_grid_ip_table', 'checkbox', '_sys_select', '2%', '', 1),
+('bx_antispam_grid_ip_table', 'From', '_bx_antispam_field_ip_from', '15%', '', 2),
+('bx_antispam_grid_ip_table', 'To', '_bx_antispam_field_ip_to', '15%', '', 3),
+('bx_antispam_grid_ip_table', 'Type', '_bx_antispam_field_action', '15%', '', 4),
+('bx_antispam_grid_ip_table', 'LastDT', '_bx_antispam_field_expiration', '15%', '', 5),
+('bx_antispam_grid_ip_table', 'Desc', '_bx_antispam_field_note', '26%', '', 6),
+('bx_antispam_grid_ip_table', 'actions', '_sys_actions', '12%', '', 7);
+
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `confirm`, `order`) VALUES
+('bx_antispam_grid_ip_table', 'bulk', 'delete', '_bx_antispam_grid_action_delete', '', 1, 1),
+('bx_antispam_grid_ip_table', 'single', 'edit', '', 'pencil-alt', 0, 1),
+('bx_antispam_grid_ip_table', 'single', 'delete', '', 'remove',  1, 2),
+('bx_antispam_grid_ip_table', 'independent', 'add', '_bx_antispam_grid_action_add', '', 0, 1);
+
+-- grid: block log
+
+INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
+('bx_antispam_grid_block_log', 'Sql', 'SELECT `id`, `ip`, `profile_id`, `type`, `extra`, `added` FROM `bx_antispam_block_log`', 'bx_antispam_block_log', 'id', 'id', '', '', 8, NULL, 'start', '', 'type,extra', '', 'auto', 'ip,profile_id,type,extra,added', '', 192, 'BxAntispamGridBlockLog', 'modules/boonex/antispam/classes/BxAntispamGridBlockLog.php');
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
+('bx_antispam_grid_block_log', 'ip', '_bx_antispam_field_ip', '20%', 0, 0, '', 1),
+('bx_antispam_grid_block_log', 'profile_id', '_bx_antispam_field_profile_id', '20%', 0, 0, '', 2),
+('bx_antispam_grid_block_log', 'type', '_bx_antispam_field_type', '15%', 0, 0, '', 3),
+('bx_antispam_grid_block_log', 'extra', '_bx_antispam_field_note', '15%', 0, 8, '', 4),
+('bx_antispam_grid_block_log', 'added', '_bx_antispam_field_when', '30%', 0, 0, '', 5);
+
+-- data list: ip table actions
+
+INSERT INTO `sys_form_pre_lists`(`module`, `key`, `title`, `use_for_sets`) VALUES 
+('bx_antispam', 'bx_antispam_ip_table_actions', '_bx_antispam_data_list_ip_table_actions', 0);
+
+INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `LKey`, `LKey2`, `Order`) VALUES 
+('bx_antispam_ip_table_actions', 'allow', '_bx_antispam_ip_allow', '', 0),
+('bx_antispam_ip_table_actions', 'deny', '_bx_antispam_ip_deny', '', 0);
+
+-- form: IP table add/edit
+
+INSERT INTO `sys_objects_form`(`object`, `module`, `title`, `action`, `form_attrs`, `table`, `key`, `uri`, `uri_title`, `submit_name`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_antispam_ip_table_form', 'bx_antispam', '_bx_antispam_form_ip_table', 'grid.php?o={grid_object}&a={grid_action}', '', 'bx_antispam_ip_table', 'ID', '', '', 'bx_antispam_ip_table_submit', '', 0, 1, '', '');
+
+INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES 
+('bx_antispam_ip_table_form', 'bx_antispam_ip_table_form_add', 'bx_antispam', 0, '_bx_antispam_form_ip_table_add'),
+('bx_antispam_ip_table_form', 'bx_antispam_ip_table_form_edit', 'bx_antispam', 0, '_bx_antispam_form_ip_table_edit');
+
+INSERT INTO `sys_form_inputs`(`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES 
+('bx_antispam_ip_table_form', 'bx_antispam', 'ID', '', '', 0, 'hidden', '_bx_antispam_field_id', '', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
+('bx_antispam_ip_table_form', 'bx_antispam', 'From', '', '', 0, 'text', '_bx_antispam_field_ip_from', '_bx_antispam_field_ip_from', '', 1, 0, 0, '', '', '', 'preg', 'a:1:{s:4:\"preg\";s:20:\"#\\d+\\.\\d+\\.\\d+\\.\\d+#\";}', '_bx_antispam_field_ip_err_msg', 'Xss', '', 1, 0),
+('bx_antispam_ip_table_form', 'bx_antispam', 'To', '', '', 0, 'text', '_bx_antispam_field_ip_to', '_bx_antispam_field_ip_to', '', 1, 0, 0, '', '', '', 'preg', 'a:1:{s:4:\"preg\";s:20:\"#\\d+\\.\\d+\\.\\d+\\.\\d+#\";}', '_bx_antispam_field_ip_err_msg', 'Xss', '', 1, 0),
+('bx_antispam_ip_table_form', 'bx_antispam', 'Type', 'allow', '#!bx_antispam_ip_table_actions', 0, 'select', '_bx_antispam_field_action', '_bx_antispam_field_action', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
+('bx_antispam_ip_table_form', 'bx_antispam', 'LastDT', '', '', 0, 'datetime', '_bx_antispam_field_expiration', '_bx_antispam_field_expiration', '', 1, 0, 0, '', '', '', 'date_time', '', '_bx_antispam_field_expiration_err_msg', 'DateTimeTs', '', 1, 0),
+('bx_antispam_ip_table_form', 'bx_antispam', 'Desc', '', '', 0, 'text', '_bx_antispam_field_note', '_bx_antispam_field_note', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
+('bx_antispam_ip_table_form', 'bx_antispam', 'bx_antispam_ip_table_submit', '_sys_submit', '', 0, 'submit', '_sys_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_antispam_ip_table_form', 'bx_antispam', 'close', '_sys_close', '', 0, 'reset', '_sys_close', '', '', 0, 0, 0, 'a:2:{s:7:\"onclick\";s:46:\"$(\'.bx-popup-applied:visible\').dolPopupHide();\";s:5:\"class\";s:22:\"bx-def-margin-sec-left\";}', '', '', '', '', '', '', '', 1, 0),
+('bx_antispam_ip_table_form', 'bx_antispam', 'buttons', '', 'bx_antispam_ip_table_submit,close', 0, 'input_set', '_bx_antispam_form_buttons', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0);
+
+INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES 
+('bx_antispam_ip_table_form_add', 'ID', 2147483647, 0, 0),
+('bx_antispam_ip_table_form_add', 'From', 2147483647, 1, 1),
+('bx_antispam_ip_table_form_add', 'To', 2147483647, 1, 2),
+('bx_antispam_ip_table_form_add', 'Type', 2147483647, 1, 3),
+('bx_antispam_ip_table_form_add', 'LastDT', 2147483647, 1, 4),
+('bx_antispam_ip_table_form_add', 'Desc', 2147483647, 1, 5),
+('bx_antispam_ip_table_form_add', 'bx_antispam_ip_table_submit', 2147483647, 1, 6),
+('bx_antispam_ip_table_form_add', 'close', 2147483647, 1, 7),
+('bx_antispam_ip_table_form_add', 'buttons', 2147483647, 1, 8),
+('bx_antispam_ip_table_form_edit', 'ID', 2147483647, 1, 0),
+('bx_antispam_ip_table_form_edit', 'From', 2147483647, 1, 1),
+('bx_antispam_ip_table_form_edit', 'To', 2147483647, 1, 2),
+('bx_antispam_ip_table_form_edit', 'Type', 2147483647, 1, 3),
+('bx_antispam_ip_table_form_edit', 'LastDT', 2147483647, 1, 4),
+('bx_antispam_ip_table_form_edit', 'Desc', 2147483647, 1, 5),
+('bx_antispam_ip_table_form_edit', 'bx_antispam_ip_table_submit', 2147483647, 1, 6),
+('bx_antispam_ip_table_form_edit', 'close', 2147483647, 1, 7),
+('bx_antispam_ip_table_form_edit', 'buttons', 2147483647, 1, 8);
+
+-- alerts
+
+INSERT INTO `sys_alerts_handlers` (`name`, `class`, `file`, `service_call`) VALUES 
+('bx_antispam', 'BxAntispamAlertsResponse', 'modules/boonex/antispam/classes/BxAntispamAlertsResponse.php', '');
+SET @iHandler := LAST_INSERT_ID();
+
+INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
+('account', 'check_login', @iHandler),
+('account', 'check_join', @iHandler),
+('system', 'check_spam', @iHandler),
+('system', 'form_check', @iHandler),
+('system', 'form_submitted', @iHandler);
+
+-- email templates
+
+INSERT INTO `sys_email_templates` (`Module`, `NameSystem`, `Name`, `Subject`, `Body`) VALUES
+('bx_antispam', '_bx_antispam_spam_report_name', 'bx_antispam_spam_report', '_bx_antispam_spam_report_subject', '_bx_antispam_spam_report_body'),
+('bx_antispam', '_bx_antispam_toxicity_blocked_report_name', 'bx_antispam_toxicity_blocked_report', '_bx_antispam_toxicity_blocked_report_subject', '_bx_antispam_toxicity_blocked_report_body'),
+('bx_antispam', '_bx_antispam_toxicity_posted_report_name', 'bx_antispam_toxicity_posted_report', '_bx_antispam_toxicity_posted_report_subject', '_bx_antispam_toxicity_posted_report_body');
+
+-- cron
+
+INSERT INTO `sys_cron_jobs` (`name`, `time`, `class`, `file`, `service_call`) VALUES
+('bx_antispam_pruning', '0 0 * * *', 'BxAntispamCronPruning', 'modules/boonex/antispam/classes/BxAntispamCronPruning.php', ''),
+('bx_antispam_update_disposable_email_domains', '0 0 */14 * *', 'BxAntispamCronUpdateDisposableEmailDomains', 'modules/boonex/antispam/classes/BxAntispamCronUpdateDisposableEmailDomains.php', '');
+

+ 207 - 170
modules/boonex/russian/data/langs/bx_antispam/ru.xml

@@ -1,170 +1,207 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources name="ru" flag="ru" title="Russian">
-
-	<string name="_bx_antispam"><![CDATA[Антиспам]]></string>
-    <string name="_bx_antispam_help"><![CDATA[Помощь]]></string>
-    <string name="_bx_antispam_help_text">
-      <![CDATA[Этот модуль помогает ограничить спам на сайте. Для этого существуют различные встроенные инструменты:
-<ul>
-    <li><b>IP table</b> - ручная (раз)блокировка IP</li>
-    <li><b>DNSBL</b> - автоматическая блокировка по IP из различных блок-списков</li>
-    <li><b>URI DNSBL</b> - автоматическая блокировка спам-контента с помощью спам-URL в тексте</li>
-    <li><b>Akismet</b> - автоматическая блокировка спам-контента с использованием <a target="_blank" href="http://akismet.com">Сервиса Akismet</a></li>
-    <li><b>StopForumSpam</b> - автоматическая блокировка спам-контента с использованием <a target="_blank" href="http://www.stopforumspam.com">Сервиса StopForumSpam</a></li>
-    <li><b>Profanity filter</b> - фильтр ненормативной лексики, основанный на заранее определенных списках слов с возможностью их расширения</a></li>
-</ul>
-]]></string>
-    <string name="_bx_antispam_help_dnsbl"><![CDATA[
-DNSBL - <a href="http://en.wikipedia.org/wiki/DNSBL">Domain Name Service Block Lists</a>.
-Эта функция позволяет блокировку по IP-адресу, если он содержится в одном из доступных блок-списков.
-<br /><br />
-URI DNSBL - это DNSBL, которые перечисляют доменные имена и IP-адреса, находящиеся по ссылкам, содержащимся в теле спама, но обычно не содержащимся внутри "правильных" сообщений.
-Этот метод антиспама сканирует публикуемый контент на предмет URL и проверяет, не являются ли они ссылками на спам-сайты. Если таковой URL будет обнаружен, то контент не будет опубликован.
-<br /><br />
-<button class="bx-btn" style="float:none;" onclick ="$('.bx-popup-applied:visible').dolPopupHide();">Закрыть</button>
-]]></string>
-    <string name="_bx_antispam_dnsbl_status"><![CDATA[
-<table style="width:100%;"><tr>
-    <td>DNSBL: {0}</td>
-    <td>URI DNSBL: {1}</td>
-    <td>Поведение при входе: {2}</td>
-    <td>Поведение при регистрации: {3}</td>
-</tr></table>
-]]></string>
-    <string name="_bx_antispam_ip_table_status"><![CDATA[IP table режим: {0}]]></string>
-    <string name="_bx_antispam_ip_blocked"><![CDATA[IP-адрес заблокирован. {0}]]></string>
-    <string name="_bx_antispam_spam_detected"><![CDATA[Обнаружен спам. {0}]]></string>
-    <string name="_bx_antispam_submit_false_positive_report"><![CDATA[Если Вы думаете, что это ошибка, пожалуйста обратитесь в поддержку: {0}]]></string>
-	<string name="_bx_antispam_ip_allow"><![CDATA[Разрешить]]></string>
-	<string name="_bx_antispam_ip_deny"><![CDATA[Запретить]]></string>
-	<string name="_bx_antispam_ip_table"><![CDATA[IP таблица]]></string>
-	<string name="_bx_antispam_dnsbl_list"><![CDATA[DNSBL список]]></string>
-	<string name="_bx_antispam_block_log"><![CDATA[Блокировать журнал]]></string>
-	<string name="_bx_antispam_chain_whitelist"><![CDATA[Белый список IP]]></string>
-	<string name="_bx_antispam_chain_spammers"><![CDATA[Чёрный список IP]]></string>
-	<string name="_bx_antispam_chain_uridns"><![CDATA[Текст спама]]></string>
-	<string name="_bx_antispam_rule_note_country"><![CDATA[Страна: {0}]]></string>
-	<string name="_bx_antispam_rule_note_spamhaus_org"><![CDATA[Определить IP спамера]]></string>
-	<string name="_bx_antispam_rule_note_zomgbl_spameatingmonkey_net"><![CDATA[Всё добавлено в Чёрный список, <u>использовать только, если что-то добавлено в Белый список!</u>]]></string>
-	<string name="_bx_antispam_rule_note_surbl_org"><![CDATA[Определить URL спамеров из SURBL (списки веб-сайтов, фигурирующих в спам-сообщениях)]]></string>
-	<string name="_bx_antispam_rule_note_dnsbl_tornevall_org"><![CDATA[Определить анонимные/элитные прокси и IP злоумышленников]]></string>
-	<string name="_bx_antispam_dnsbl"><![CDATA[DNSBL]]></string>
-	<string name="_bx_antispam_uri_dnsbl"><![CDATA[URI DNSBL]]></string>
-	<string name="_bx_antispam_type_dnsbl"><![CDATA[DNSBL]]></string>
-	<string name="_bx_antispam_type_dnsbluri"><![CDATA[URI DNSBL]]></string>
-	<string name="_bx_antispam_type_akismet"><![CDATA[Akismet]]></string>
-	<string name="_bx_antispam_type_stopforumspam"><![CDATA[StopForumSpam]]></string>
-	<string name="_bx_antispam_ip_table_disabled"><![CDATA[Отключено]]></string>
-	<string name="_bx_antispam_ip_table_all_allowed_except_listed"><![CDATA[Разрешены все, кроме перечисленных]]></string>
-	<string name="_bx_antispam_ip_table_all_blocked_except_listed"><![CDATA[Заблокированы все, кроме перечисленных]]></string>
-	<string name="_bx_antispam_dnsbl_behaviour_login_block"><![CDATA[Заблокировать]]></string>
-	<string name="_bx_antispam_dnsbl_behaviour_login_log"><![CDATA[Журнал]]></string>
-	<string name="_bx_antispam_dnsbl_behaviour_join_block"><![CDATA[Заблокировать]]></string>
-	<string name="_bx_antispam_dnsbl_behaviour_join_approval"><![CDATA[На проверку]]></string>
-	<string name="_bx_antispam_disposable_email_domains_mode_disable"><![CDATA[Отключить]]></string>
-	<string name="_bx_antispam_disposable_email_domains_mode_whitelist"><![CDATA[Пропускать только из разрешенного списка]]></string>
-	<string name="_bx_antispam_disposable_email_domains_mode_blacklist"><![CDATA[Не пропускать из черного списка]]></string>
-	<string name="_bx_antispam_disposable_email_domains_behaviour_join_block"><![CDATA[Блокирвать]]></string>
-    <string name="_bx_antispam_disposable_email_domains_behaviour_join_approval"><![CDATA[На проверку]]></string>
-    <string name="_bx_antispam_disposable_email_domains_msg_blacklisted"><![CDATA[Домен вашего емейла не разрешен для регистрации на этом сайте]]></string>
-    
-	<string name="_bx_antispam_popup_help"><![CDATA[Помощь по DNSBL]]></string>
-	<string name="_bx_antispam_popup_dnsbl_recheck"><![CDATA[Перепроверить IP/URL в DNSBL/URIDNSBL]]></string>
-	<string name="_bx_antispam_popup_dnsbl_add"><![CDATA[Добавить правило для страны]]></string>
-	<string name="_bx_antispam_popup_block_log"><![CDATA[Блокировать журнал]]></string>
-
-	<string name="_bx_antispam_page_title_sys_ip_table"><![CDATA[IP таблица]]></string>
-	<string name="_bx_antispam_page_title_ip_table"><![CDATA[IP таблица]]></string>
-	<string name="_bx_antispam_page_title_sys_dnsbl_list"><![CDATA[DNSBL список]]></string>
-	<string name="_bx_antispam_page_title_dnsbl_list"><![CDATA[DNSBL список]]></string>
-	<string name="_bx_antispam_page_title_sys_block_log"><![CDATA[Блокировать журнал]]></string>
-	<string name="_bx_antispam_page_title_block_log"><![CDATA[Блокировать журнал]]></string>
-
-	<string name="_bx_antispam_page_block_title_ip_table"><![CDATA[IP таблица]]></string>
-	<string name="_bx_antispam_page_block_title_dnsbl_list"><![CDATA[DNSBL список]]></string>
-	<string name="_bx_antispam_page_block_title_block_log"><![CDATA[Блокировать журнал]]></string>
-
-	<string name="_bx_antispam_grid_action_delete"><![CDATA[Удалить]]></string>
-	<string name="_bx_antispam_grid_action_add"><![CDATA[Добавить]]></string>
-	<string name="_bx_antispam_grid_action_log"><![CDATA[Сохранять журнал]]></string>
-	<string name="_bx_antispam_grid_action_recheck"><![CDATA[Перепроверить]]></string>
-	<string name="_bx_antispam_grid_action_help"><![CDATA[Помощь]]></string>
-
-	<string name="_bx_antispam_field_id"><![CDATA[ID]]></string>
-	<string name="_bx_antispam_field_ip"><![CDATA[IP]]></string>
-	<string name="_bx_antispam_field_ip_from"><![CDATA[IP исходящий]]></string>
-	<string name="_bx_antispam_field_ip_to"><![CDATA[IP входящий]]></string>
-	<string name="_bx_antispam_field_action"><![CDATA[Действие]]></string>
-	<string name="_bx_antispam_field_expiration"><![CDATA[Истечение срока]]></string>
-	<string name="_bx_antispam_field_note"><![CDATA[Заметка]]></string>
-	<string name="_bx_antispam_field_chain"><![CDATA[Правило]]></string>
-	<string name="_bx_antispam_field_ip_url"><![CDATA[IP для DNSBL или URL для URI DNSBL]]></string>
-	<string name="_bx_antispam_field_dnsbl_uridnsbl"><![CDATA[Проверить]]></string>
-	<string name="_bx_antispam_field_profile_id"><![CDATA[Профиль]]></string>
-	<string name="_bx_antispam_field_type"><![CDATA[Тип]]></string>
-	<string name="_bx_antispam_field_when"><![CDATA[Когда]]></string>
-	<string name="_bx_antispam_field_country"><![CDATA[Страна]]></string>
-	<string name="_bx_antispam_field_zonedomain"><![CDATA[Доменная зона]]></string>
-
-    <string name="_bx_antispam_form_ip_table"><![CDATA[Правило для IP-таблицы]]></string>
-    <string name="_bx_antispam_form_ip_table_add"><![CDATA[Добавить правило для IP-таблицы]]></string>
-    <string name="_bx_antispam_form_ip_table_edit"><![CDATA[Изменить правило для IP-таблицы]]></string>
-    <string name="_bx_antispam_form_buttons"><![CDATA[Кнопки формы]]></string>
-
-    <string name="_bx_antispam_field_ip_err_msg"><![CDATA[Пожалуйста, укажите правильный IP-адрес, например, 192.168.4.5]]></string>
-    <string name="_bx_antispam_field_expiration_err_msg"><![CDATA[Пожалуйста, укажите корректную дату и время]]></string>
-
-    <string name="_bx_antispam_data_list_ip_table_actions"><![CDATA[Действия над IP-таблицей]]></string>
-
-    <string name="_bx_antispam_adm_stg_cpt_type"><![CDATA[Антиспам]]></string>
-    <string name="_bx_antispam_adm_stg_cpt_category_general"><![CDATA[Общие]]></string>
-    <string name="_bx_antispam_adm_stg_cpt_category_ip_table"><![CDATA[IP-таблица]]></string>
-    <string name="_bx_antispam_adm_stg_cpt_category_dnsbl"><![CDATA[DNSBL]]></string>
-    <string name="_bx_antispam_adm_stg_cpt_category_akismet"><![CDATA[Akismet]]></string>
-    <string name="_bx_antispam_adm_stg_cpt_category_stopforumspam"><![CDATA[StopForumSpam]]></string>
-    <string name="_bx_antispam_adm_stg_cpt_category_disposable_email_domains"><![CDATA[Временные е-mail домены]]></string>
-    <string name="_bx_antispam_adm_stg_cpt_category_profanity_filter"><![CDATA[Фильтр ненормативной лексики]]></string>
-
-	<string name="_bx_antispam_option_block"><![CDATA[Полностью заблокировать весь спам-контент]]></string>
-	<string name="_bx_antispam_option_report"><![CDATA[Послать отчёт администратору при обнаружении спам-контента]]></string>
-	<string name="_bx_antispam_option_ip_list_type"><![CDATA[Режим IP-таблицы]]></string>
-	<string name="_bx_antispam_option_dnsbl_enable"><![CDATA[Включить Блок-списки по DNS]]></string>
-	<string name="_bx_antispam_option_dnsbl_behaviour_login"><![CDATA[Поведение при входе пользователя, если содержится в Блок-списках по DNS]]></string>
-	<string name="_bx_antispam_option_dnsbl_behaviour_join"><![CDATA[Поведение при регистрации пользователя, если содержится в Блок-списках по DNS]]></string>
-	<string name="_bx_antispam_option_uridnsbl_enable"><![CDATA[Включить Блок-списки по URI DNS]]></string>
-	<string name="_bx_antispam_option_akismet_enable"><![CDATA[Включить Akismet]]></string>
-	<string name="_bx_antispam_option_akismet_api_key"><![CDATA[Ключ для Akismet API]]></string>
-	<string name="_bx_antispam_option_stopforumspam_enable"><![CDATA[Включить "Stop Forum Spam"]]></string>
-	<string name="_bx_antispam_option_stopforumspam_api_key"><![CDATA[Ключ для "Stop Forum Spam" API]]></string>
-	<string name="_bx_antispam_option_disposable_email_domains_mode"><![CDATA[Режим]]></string>
-    <string name="_bx_antispam_option_disposable_email_domains_behaviour_join"><![CDATA[Поведение при регистрации пользователя]]></string>
-  <string name="_bx_antispam_option_profanity_filter_enable"><![CDATA[Включить фильтр ненормативной лексики]]></string>
-  <string name="_bx_antispam_option_profanity_filter_bad_words_list"><![CDATA[Список плохих слов (разделенных запятой)]]></string>
-  <string name="_bx_antispam_option_profanity_filter_char_replace"><![CDATA[Символ замены]]></string>
-  <string name="_bx_antispam_option_profanity_filter_white_words_list"><![CDATA[Список слов исключений (разделенных запятой)]]></string>
-  <string name="_bx_antispam_option_profanity_filter_dicts"><![CDATA[Словари]]></string>
-  <string name="_bx_antispam_option_profanity_filter_full_words_only"><![CDATA[Только слова целиком]]></string>
-
-  <string name="_bx_antispam_spam_report_name"><![CDATA[Сообщение отчёта о спаме]]></string>
-    <string name="_bx_antispam_spam_report_subject"><![CDATA[Автоматический отчёт о спаме]]></string>
-    <string name="_bx_antispam_spam_report_body"><![CDATA[{email_header}
-<b>Профиль:</b> <a href="{SpammerUrl}">{SpammerNickName}</a><br />
-
-<b>Страница:</b> {Page}<br /><br />
-
-<b>GET переменные:</b>
-<pre>
-{Get}
-</pre>
-
-<b>POST переменные:</b>
-<pre>
-{Post}
-</pre>
-
-<b>Спам-контент:</b>
-<pre>
-{SpamContent}
-</pre>
-{email_footer}]]></string>
-</resources>
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="ru" flag="ru" title="Russian">
+
+	<string name="_bx_antispam"><![CDATA[Антиспам]]></string>
+    <string name="_bx_antispam_help"><![CDATA[Помощь]]></string>
+    <string name="_bx_antispam_help_text">
+      <![CDATA[Этот модуль помогает ограничить спам на сайте. Для этого существуют различные встроенные инструменты:
+<ul>
+    <li><b>IP table</b> - ручная (раз)блокировка IP</li>
+    <li><b>DNSBL</b> - автоматическая блокировка по IP из различных блок-списков</li>
+    <li><b>URI DNSBL</b> - автоматическая блокировка спам-контента с помощью спам-URL в тексте</li>
+    <li><b>Akismet</b> - автоматическая блокировка спам-контента с использованием <a target="_blank" href="http://akismet.com">Сервиса Akismet</a></li>
+    <li><b>StopForumSpam</b> - автоматическая блокировка спам-контента с использованием <a target="_blank" href="http://www.stopforumspam.com">Сервиса StopForumSpam</a></li>
+    <li><b>Profanity filter</b> - фильтр ненормативной лексики, основанный на заранее определенных списках слов с возможностью их расширения</a></li>
+</ul>
+]]></string>
+    <string name="_bx_antispam_help_dnsbl"><![CDATA[
+DNSBL - <a href="http://en.wikipedia.org/wiki/DNSBL">Domain Name Service Block Lists</a>.
+Эта функция позволяет блокировку по IP-адресу, если он содержится в одном из доступных блок-списков.
+<br /><br />
+URI DNSBL - это DNSBL, которые перечисляют доменные имена и IP-адреса, находящиеся по ссылкам, содержащимся в теле спама, но обычно не содержащимся внутри "правильных" сообщений.
+Этот метод антиспама сканирует публикуемый контент на предмет URL и проверяет, не являются ли они ссылками на спам-сайты. Если таковой URL будет обнаружен, то контент не будет опубликован.
+<br /><br />
+<button class="bx-btn" style="float:none;" onclick ="$('.bx-popup-applied:visible').dolPopupHide();">Закрыть</button>
+]]></string>
+    <string name="_bx_antispam_dnsbl_status"><![CDATA[
+<table style="width:100%;"><tr>
+    <td>DNSBL: {0}</td>
+    <td>URI DNSBL: {1}</td>
+    <td>Поведение при входе: {2}</td>
+    <td>Поведение при регистрации: {3}</td>
+</tr></table>
+]]></string>
+    <string name="_bx_antispam_ip_table_status"><![CDATA[IP table режим: {0}]]></string>
+    <string name="_bx_antispam_ip_blocked"><![CDATA[IP-адрес заблокирован. {0}]]></string>
+    <string name="_bx_antispam_spam_detected"><![CDATA[Обнаружен спам. {0}]]></string>
+    <string name="_bx_antispam_submit_false_positive_report"><![CDATA[Если Вы думаете, что это ошибка, пожалуйста обратитесь в поддержку: {0}]]></string>
+	<string name="_bx_antispam_ip_allow"><![CDATA[Разрешить]]></string>
+	<string name="_bx_antispam_ip_deny"><![CDATA[Запретить]]></string>
+	<string name="_bx_antispam_ip_table"><![CDATA[IP таблица]]></string>
+	<string name="_bx_antispam_dnsbl_list"><![CDATA[DNSBL список]]></string>
+	<string name="_bx_antispam_block_log"><![CDATA[Блокировать журнал]]></string>
+	<string name="_bx_antispam_chain_whitelist"><![CDATA[Белый список IP]]></string>
+	<string name="_bx_antispam_chain_spammers"><![CDATA[Чёрный список IP]]></string>
+	<string name="_bx_antispam_chain_uridns"><![CDATA[Текст спама]]></string>
+	<string name="_bx_antispam_rule_note_country"><![CDATA[Страна: {0}]]></string>
+	<string name="_bx_antispam_rule_note_spamhaus_org"><![CDATA[Определить IP спамера]]></string>
+	<string name="_bx_antispam_rule_note_zomgbl_spameatingmonkey_net"><![CDATA[Всё добавлено в Чёрный список, <u>использовать только, если что-то добавлено в Белый список!</u>]]></string>
+	<string name="_bx_antispam_rule_note_surbl_org"><![CDATA[Определить URL спамеров из SURBL (списки веб-сайтов, фигурирующих в спам-сообщениях)]]></string>
+	<string name="_bx_antispam_rule_note_dnsbl_tornevall_org"><![CDATA[Определить анонимные/элитные прокси и IP злоумышленников]]></string>
+	<string name="_bx_antispam_dnsbl"><![CDATA[DNSBL]]></string>
+	<string name="_bx_antispam_uri_dnsbl"><![CDATA[URI DNSBL]]></string>
+	<string name="_bx_antispam_type_dnsbl"><![CDATA[DNSBL]]></string>
+	<string name="_bx_antispam_type_dnsbluri"><![CDATA[URI DNSBL]]></string>
+	<string name="_bx_antispam_type_akismet"><![CDATA[Akismet]]></string>
+	<string name="_bx_antispam_type_stopforumspam"><![CDATA[StopForumSpam]]></string>
+	<string name="_bx_antispam_ip_table_disabled"><![CDATA[Отключено]]></string>
+	<string name="_bx_antispam_ip_table_all_allowed_except_listed"><![CDATA[Разрешены все, кроме перечисленных]]></string>
+	<string name="_bx_antispam_ip_table_all_blocked_except_listed"><![CDATA[Заблокированы все, кроме перечисленных]]></string>
+	<string name="_bx_antispam_dnsbl_behaviour_login_block"><![CDATA[Заблокировать]]></string>
+	<string name="_bx_antispam_dnsbl_behaviour_login_log"><![CDATA[Журнал]]></string>
+	<string name="_bx_antispam_dnsbl_behaviour_join_block"><![CDATA[Заблокировать]]></string>
+	<string name="_bx_antispam_dnsbl_behaviour_join_approval"><![CDATA[На проверку]]></string>
+	<string name="_bx_antispam_disposable_email_domains_mode_disable"><![CDATA[Отключить]]></string>
+	<string name="_bx_antispam_disposable_email_domains_mode_whitelist"><![CDATA[Пропускать только из разрешенного списка]]></string>
+	<string name="_bx_antispam_disposable_email_domains_mode_blacklist"><![CDATA[Не пропускать из черного списка]]></string>
+	<string name="_bx_antispam_disposable_email_domains_behaviour_join_block"><![CDATA[Блокирвать]]></string>
+    <string name="_bx_antispam_disposable_email_domains_behaviour_join_approval"><![CDATA[На проверку]]></string>
+    <string name="_bx_antispam_disposable_email_domains_msg_blacklisted"><![CDATA[Домен вашего емейла не разрешен для регистрации на этом сайте]]></string>
+    
+	<string name="_bx_antispam_popup_help"><![CDATA[Помощь по DNSBL]]></string>
+	<string name="_bx_antispam_popup_dnsbl_recheck"><![CDATA[Перепроверить IP/URL в DNSBL/URIDNSBL]]></string>
+	<string name="_bx_antispam_popup_dnsbl_add"><![CDATA[Добавить правило для страны]]></string>
+	<string name="_bx_antispam_popup_block_log"><![CDATA[Блокировать журнал]]></string>
+
+	<string name="_bx_antispam_page_title_sys_ip_table"><![CDATA[IP таблица]]></string>
+	<string name="_bx_antispam_page_title_ip_table"><![CDATA[IP таблица]]></string>
+	<string name="_bx_antispam_page_title_sys_dnsbl_list"><![CDATA[DNSBL список]]></string>
+	<string name="_bx_antispam_page_title_dnsbl_list"><![CDATA[DNSBL список]]></string>
+	<string name="_bx_antispam_page_title_sys_block_log"><![CDATA[Блокировать журнал]]></string>
+	<string name="_bx_antispam_page_title_block_log"><![CDATA[Блокировать журнал]]></string>
+
+	<string name="_bx_antispam_page_block_title_ip_table"><![CDATA[IP таблица]]></string>
+	<string name="_bx_antispam_page_block_title_dnsbl_list"><![CDATA[DNSBL список]]></string>
+	<string name="_bx_antispam_page_block_title_block_log"><![CDATA[Блокировать журнал]]></string>
+
+	<string name="_bx_antispam_grid_action_delete"><![CDATA[Удалить]]></string>
+	<string name="_bx_antispam_grid_action_add"><![CDATA[Добавить]]></string>
+	<string name="_bx_antispam_grid_action_log"><![CDATA[Сохранять журнал]]></string>
+	<string name="_bx_antispam_grid_action_recheck"><![CDATA[Перепроверить]]></string>
+	<string name="_bx_antispam_grid_action_help"><![CDATA[Помощь]]></string>
+
+	<string name="_bx_antispam_field_id"><![CDATA[ID]]></string>
+	<string name="_bx_antispam_field_ip"><![CDATA[IP]]></string>
+	<string name="_bx_antispam_field_ip_from"><![CDATA[IP исходящий]]></string>
+	<string name="_bx_antispam_field_ip_to"><![CDATA[IP входящий]]></string>
+	<string name="_bx_antispam_field_action"><![CDATA[Действие]]></string>
+	<string name="_bx_antispam_field_expiration"><![CDATA[Истечение срока]]></string>
+	<string name="_bx_antispam_field_note"><![CDATA[Заметка]]></string>
+	<string name="_bx_antispam_field_chain"><![CDATA[Правило]]></string>
+	<string name="_bx_antispam_field_ip_url"><![CDATA[IP для DNSBL или URL для URI DNSBL]]></string>
+	<string name="_bx_antispam_field_dnsbl_uridnsbl"><![CDATA[Проверить]]></string>
+	<string name="_bx_antispam_field_profile_id"><![CDATA[Профиль]]></string>
+	<string name="_bx_antispam_field_type"><![CDATA[Тип]]></string>
+	<string name="_bx_antispam_field_when"><![CDATA[Когда]]></string>
+	<string name="_bx_antispam_field_country"><![CDATA[Страна]]></string>
+	<string name="_bx_antispam_field_zonedomain"><![CDATA[Доменная зона]]></string>
+
+    <string name="_bx_antispam_form_ip_table"><![CDATA[Правило для IP-таблицы]]></string>
+    <string name="_bx_antispam_form_ip_table_add"><![CDATA[Добавить правило для IP-таблицы]]></string>
+    <string name="_bx_antispam_form_ip_table_edit"><![CDATA[Изменить правило для IP-таблицы]]></string>
+    <string name="_bx_antispam_form_buttons"><![CDATA[Кнопки формы]]></string>
+
+    <string name="_bx_antispam_field_ip_err_msg"><![CDATA[Пожалуйста, укажите правильный IP-адрес, например, 192.168.4.5]]></string>
+    <string name="_bx_antispam_field_expiration_err_msg"><![CDATA[Пожалуйста, укажите корректную дату и время]]></string>
+
+    <string name="_bx_antispam_data_list_ip_table_actions"><![CDATA[Действия над IP-таблицей]]></string>
+
+    <string name="_bx_antispam_adm_stg_cpt_type"><![CDATA[Антиспам]]></string>
+    <string name="_bx_antispam_adm_stg_cpt_category_general"><![CDATA[Общие]]></string>
+    <string name="_bx_antispam_adm_stg_cpt_category_ip_table"><![CDATA[IP-таблица]]></string>
+    <string name="_bx_antispam_adm_stg_cpt_category_dnsbl"><![CDATA[DNSBL]]></string>
+    <string name="_bx_antispam_adm_stg_cpt_category_akismet"><![CDATA[Akismet]]></string>
+    <string name="_bx_antispam_adm_stg_cpt_category_stopforumspam"><![CDATA[StopForumSpam]]></string>
+    <string name="_bx_antispam_adm_stg_cpt_category_disposable_email_domains"><![CDATA[Временные е-mail домены]]></string>
+    <string name="_bx_antispam_adm_stg_cpt_category_profanity_filter"><![CDATA[Фильтр ненормативной лексики]]></string>
+
+	<string name="_bx_antispam_option_block"><![CDATA[Полностью заблокировать весь спам-контент]]></string>
+	<string name="_bx_antispam_option_report"><![CDATA[Послать отчёт администратору при обнаружении спам-контента]]></string>
+	<string name="_bx_antispam_option_ip_list_type"><![CDATA[Режим IP-таблицы]]></string>
+	<string name="_bx_antispam_option_dnsbl_enable"><![CDATA[Включить Блок-списки по DNS]]></string>
+	<string name="_bx_antispam_option_dnsbl_behaviour_login"><![CDATA[Поведение при входе пользователя, если содержится в Блок-списках по DNS]]></string>
+	<string name="_bx_antispam_option_dnsbl_behaviour_join"><![CDATA[Поведение при регистрации пользователя, если содержится в Блок-списках по DNS]]></string>
+	<string name="_bx_antispam_option_uridnsbl_enable"><![CDATA[Включить Блок-списки по URI DNS]]></string>
+	<string name="_bx_antispam_option_akismet_enable"><![CDATA[Включить Akismet]]></string>
+	<string name="_bx_antispam_option_akismet_api_key"><![CDATA[Ключ для Akismet API]]></string>
+	<string name="_bx_antispam_option_stopforumspam_enable"><![CDATA[Включить "Stop Forum Spam"]]></string>
+	<string name="_bx_antispam_option_stopforumspam_api_key"><![CDATA[Ключ для "Stop Forum Spam" API]]></string>
+	<string name="_bx_antispam_option_disposable_email_domains_mode"><![CDATA[Режим]]></string>
+    <string name="_bx_antispam_option_disposable_email_domains_behaviour_join"><![CDATA[Поведение при регистрации пользователя]]></string>
+  <string name="_bx_antispam_option_profanity_filter_enable"><![CDATA[Включить фильтр ненормативной лексики]]></string>
+  <string name="_bx_antispam_option_profanity_filter_bad_words_list"><![CDATA[Список плохих слов (разделенных запятой)]]></string>
+  <string name="_bx_antispam_option_profanity_filter_char_replace"><![CDATA[Символ замены]]></string>
+  <string name="_bx_antispam_option_profanity_filter_white_words_list"><![CDATA[Список слов исключений (разделенных запятой)]]></string>
+  <string name="_bx_antispam_option_profanity_filter_dicts"><![CDATA[Словари]]></string>
+  <string name="_bx_antispam_option_profanity_filter_full_words_only"><![CDATA[Только слова целиком]]></string>
+
+  <string name="_bx_antispam_spam_report_name"><![CDATA[Сообщение отчёта о спаме]]></string>
+    <string name="_bx_antispam_spam_report_subject"><![CDATA[Автоматический отчёт о спаме]]></string>
+    <string name="_bx_antispam_spam_report_body"><![CDATA[{email_header}
+<b>Профиль:</b> <a href="{SpammerUrl}">{SpammerNickName}</a><br />
+
+<b>Страница:</b> {Page}<br /><br />
+
+<b>GET переменные:</b>
+<pre>
+{Get}
+</pre>
+
+<b>POST переменные:</b>
+<pre>
+{Post}
+</pre>
+
+<b>Спам-контент:</b>
+<pre>
+{SpamContent}
+</pre>
+{email_footer}]]></string>
+
+
+	<string name="_bx_antispam_type_toxicity_filter"><![CDATA[Фильтр токсичности]]></string>
+	<string name="_bx_antispam_adm_stg_cpt_category_toxicity_filter"><![CDATA[Фильтр токсичности]]></string>
+	<string name="_bx_antispam_option_toxicity_filter_enable"><![CDATA[Включить фильтр токсичности]]></string>
+	<string name="_bx_antispam_option_toxicity_filter_action"><![CDATA[Действие]]></string>
+	<string name="_bx_antispam_option_toxicity_filter_action_none"><![CDATA[Нет]]></string>
+	<string name="_bx_antispam_option_toxicity_filter_action_block"><![CDATA[Блокировать токсичный контент]]></string>
+	<string name="_bx_antispam_option_toxicity_filter_action_disapprove"><![CDATA[Когда возможно, скрывать токсичный контент, остальное блокировать.]]></string>
+	<string name="_bx_antispam_option_toxicity_report"><![CDATA[Отправлять администратору уведомление о токсичном контенте]]></string>
+	<string name="_bx_antispam_option_toxicity_filter_api_key"><![CDATA[Perspective API ключ (см. <a href="https://developers.perspectiveapi.com/s/docs-get-started">эту</a> страницу о способе получения ключа)]]></string>
+	<string name="_bx_antispam_option_toxicity_filter_threshold"><![CDATA[Пороговое значение при котором текст считать токсичным (0 - 100)]]></string>
+	<string name="_bx_antispam_form_submission_error"><![CDATA[Ошибка. Похоже форма содержит токсичный контент. Пожалуйста проверьте данные формы и попробуйте снова.]]></string>
+
+	<string name="_bx_antispam_toxicity_blocked_report_name"><![CDATA[Сообщение о заблокированном токсичном контенте]]></string>
+    <string name="_bx_antispam_toxicity_blocked_report_subject"><![CDATA[Токсичный контент был заблокирован]]></string>
+    <string name="_bx_antispam_toxicity_blocked_report_body"><![CDATA[{email_header}
+<b>Профиль:</b> <a href="{AuthorUrl}">{AuthorNickName}</a><br />
+<b>Страница:</b> {Page}<br /><br />
+<b>Контент:</b>
+<pre>
+{Content}
+</pre>
+{email_footer}]]></string>
+
+	<string name="_bx_antispam_toxicity_posted_report_name"><![CDATA[Сообщение о размещенном токсичном контенте]]></string>
+    <string name="_bx_antispam_toxicity_posted_report_subject"><![CDATA[Токсичный контент был добавлен]]></string>
+    <string name="_bx_antispam_toxicity_posted_report_body"><![CDATA[{email_header}
+<b>Профиль:</b> <a href="{AuthorUrl}">{AuthorNickName}</a><br />
+<b>Страница:</b> {Page}<br /><br />
+<bx_if:content_url>
+	<b>Ссылка:</b> <a href="{c_url}">{c_url}</a><br /><br />
+</bx_if:content_url>
+<bx_if:manage_content_url>
+	<b>Управлять:</b> <a href="{m_url}">{m_url}</a><br /><br />
+</bx_if:manage_content_url>
+{email_footer}]]></string>
+</resources>