Alex Trofimov 12 лет назад
Родитель
Сommit
72a4eeab2e

+ 6 - 4
modules/boonex/antispam/classes/BxAntispamGridDNSBL.php

@@ -53,9 +53,11 @@ class BxAntispamGridDNSBL extends BxTemplGrid
      */
     public function performActionLog()
     {
-        bx_import('BxDolGrid');
-        $oGrid = BxDolGrid::getObjectInstance('bx_antispam_grid_block_log');
-        if (!$oGrid) {
+        bx_import('BxDolModule');
+        $oModule = BxDolModule::getInstance('bx_antispam');
+        $sGrid = $oModule->serviceBlockLog();
+
+        if (!$sGrid) {
             $this->_echoResultJson(array('msg' => _t('_sys_txt_error_occured')), true);
             exit;
         }
@@ -64,7 +66,7 @@ class BxAntispamGridDNSBL extends BxTemplGrid
         $s = BxTemplFunctions::getInstance()->popupBox(
             'bx_antispam_popup_block_log',
             _t('_bx_antispam_popup_block_log'), 
-            $oGrid->getCode() . '<button class="bx-btn" style="float:none;" onclick ="$(\'.bx-popup-applied:visible\').dolPopupHide();">' . _t('_sys_close') . '</button>'
+            $sGrid . '<button class="bx-btn" style="float:none;" onclick ="$(\'.bx-popup-applied:visible\').dolPopupHide();">' . _t('_sys_close') . '</button>'
         );
 
         $this->_echoResultJson(array('popup' => array('html' => $s)), true);

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

@@ -30,6 +30,11 @@ class BxAntispamModule extends BxDolModule
         return $this->_grid('bx_antispam_grid_dnsbl');
     }
 
+    function serviceBlockLog () 
+    {
+        return $this->_grid('bx_antispam_grid_block_log');
+    }
+
     /**
      * Check text for spam.
      * First it check if IP is whitelisted(or under cron execution or user is admin) - for whitelisted IPs check for spam isn't performed,

+ 1 - 0
modules/boonex/antispam/classes/BxAntispamStudioPage.php

@@ -28,6 +28,7 @@ class BxAntispamStudioPage extends BxTemplStudioModule
     	    array('name' => 'general', 'icon' => 'cogs', 'title' => '_adm_lmi_cpt_settings'),
     	    array('name' => 'ip_table', 'icon' => 'align-justify', 'title' => '_bx_antispam_ip_table', 'link' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=antispam-ip-table')),
     	    array('name' => 'dnsbl_list', 'icon' => 'align-justify', 'title' => '_bx_antispam_dnsbl_list', 'link' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=antispam-dnsbl-list')),
+    	    array('name' => 'block_log', 'icon' => 'clock-o', 'title' => '_bx_antispam_block_log', 'link' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=antispam-block-log')),
         );
     }
 

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

@@ -20,6 +20,7 @@ This antispam method scan submitted content for the URLs and check them if any o
 	<string name="_bx_antispam_ip_deny"><![CDATA[Deny]]></string>
 	<string name="_bx_antispam_ip_table"><![CDATA[IP table]]></string>
 	<string name="_bx_antispam_dnsbl_list"><![CDATA[DNSBL list]]></string>
+	<string name="_bx_antispam_block_log"><![CDATA[Block log]]></string>
 	<string name="_bx_antispam_chain_whitelist"><![CDATA[IP whitelist]]></string>
 	<string name="_bx_antispam_chain_spammers"><![CDATA[IP blacklist]]></string>
 	<string name="_bx_antispam_chain_uridns"><![CDATA[Spam text]]></string>
@@ -44,9 +45,12 @@ This antispam method scan submitted content for the URLs and check them if any o
 	<string name="_bx_antispam_page_title_ip_table"><![CDATA[IP table]]></string>
 	<string name="_bx_antispam_page_title_sys_dnsbl_list"><![CDATA[DNSBL list]]></string>
 	<string name="_bx_antispam_page_title_dnsbl_list"><![CDATA[DNSBL list]]></string>
+	<string name="_bx_antispam_page_title_sys_block_log"><![CDATA[Block log]]></string>
+	<string name="_bx_antispam_page_title_block_log"><![CDATA[Block log]]></string>
 
 	<string name="_bx_antispam_page_block_title_ip_table"><![CDATA[IP table]]></string>
 	<string name="_bx_antispam_page_block_title_dnsbl_list"><![CDATA[DNSBL list]]></string>
+	<string name="_bx_antispam_page_block_title_block_log"><![CDATA[Block log]]></string>
 
 	<string name="_bx_antispam_grid_action_delete"><![CDATA[Delete]]></string>
 	<string name="_bx_antispam_grid_action_add"><![CDATA[Add]]></string>

+ 8 - 0
modules/boonex/antispam/install/sql/enable.sql

@@ -73,6 +73,14 @@ INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module
 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, 64, 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