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

+ 1 - 2
modules/boonex/antispam/classes/BxAntispamDNSBlacklists.php

@@ -81,9 +81,8 @@ class BxAntispamDNSBlacklists extends BxDol
     public function onPositiveDetection ($sIP, $sNote = '', $sType = 'dnsbl')
     {
         $iIP = sprintf("%u", ip2long($sIP));
-        $iMemberId = getLoggedId();
         $oDb = BxDolDb::getInstance();
-        $sQuery = $oDb->prepare("INSERT INTO `bx_antispam_block_log` SET `ip` = ?, `member_id` = ?, `type` = ?, `extra` = ?, `added` = ?", $iIP, $iMemberId, $sType, $sNote, time());
+        $sQuery = $oDb->prepare("INSERT INTO `bx_antispam_block_log` SET `ip` = ?, `profile_id` = ?, `type` = ?, `extra` = ?, `added` = ?", $iIP, bx_get_logged_profile_id(), $sType, $sNote, time());
         return $oDb->query($sQuery);
     }
 

+ 5 - 3
modules/boonex/antispam/classes/BxAntispamGridBlockLog.php

@@ -11,6 +11,7 @@
 
 require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
 
+bx_import('BxDolProfile');
 bx_import('BxTemplGrid');
 
 class BxAntispamGridBlockLog extends BxTemplGrid 
@@ -24,11 +25,12 @@ class BxAntispamGridBlockLog extends BxTemplGrid
     {
         return parent::_getCellDefault (long2ip($mixedValue), $sKey, $aField, $aRow);
     }
-    protected function _getCellMemberId ($mixedValue, $sKey, $aField, $aRow) 
+    protected function _getCellProfileId ($mixedValue, $sKey, $aField, $aRow) 
     {
         $s = '<span class="bx-def-font-grayed">' . _t('_undefined') . '</span>';
-        if ($mixedValue)
-            $s = $mixedValue; // TODO: link to profile
+        if ($mixedValue && ($oProfile = BxDolProfile::getInstance((int)$mixedValue)))
+            $s = '<a href="' . $oProfile->getUrl() . '">' . $oProfile->getDisplayName() . '</span>';
+
         return parent::_getCellDefault ($s, $sKey, $aField, $aRow);
     }
     protected function _getCellType ($mixedValue, $sKey, $aField, $aRow) 

+ 1 - 1
modules/boonex/antispam/install/langs/en.xml

@@ -75,7 +75,7 @@ This antispam method scan submitted content for the URLs and check them if any o
 	<string name="_bx_antispam_field_chain"><![CDATA[Rule]]></string>
 	<string name="_bx_antispam_field_ip_url"><![CDATA[IP for DNSBL or URL for URI DNSBL]]></string>
 	<string name="_bx_antispam_field_dnsbl_uridnsbl"><![CDATA[Check in]]></string>
-	<string name="_bx_antispam_field_member_id"><![CDATA[Member]]></string>
+	<string name="_bx_antispam_field_profile_id"><![CDATA[Profile]]></string>
 	<string name="_bx_antispam_field_type"><![CDATA[Type]]></string>
 	<string name="_bx_antispam_field_when"><![CDATA[When]]></string>
 	<string name="_bx_antispam_field_country"><![CDATA[Country]]></string>

+ 2 - 2
modules/boonex/antispam/install/sql/enable.sql

@@ -124,11 +124,11 @@ INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `conf
 -- 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`, `member_id`, `type`, `extra`, `added` FROM `bx_antispam_block_log`', 'bx_antispam_block_log', 'id', 'id', '', '', 8, NULL, 'start', '', 'type,extra', '', 'auto', 'ip,member_id,type,extra,added', '', 64, 'BxAntispamGridBlockLog', 'modules/boonex/antispam/classes/BxAntispamGridBlockLog.php');
+('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', '', 64, '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', 'member_id', '_bx_antispam_field_member_id', '20%', 0, 0, '', 2),
+('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);

+ 2 - 2
modules/boonex/antispam/install/sql/install.sql

@@ -39,13 +39,13 @@ CREATE TABLE `bx_antispam_dnsbluri_zones` (
 CREATE TABLE `bx_antispam_block_log` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `ip` int(10) unsigned NOT NULL,
-  `member_id` int(10) unsigned NOT NULL,
+  `profile_id` int(10) unsigned NOT NULL,
   `type` varchar(32) NOT NULL,
   `extra` text NOT NULL,
   `added` int(11) NOT NULL,
   PRIMARY KEY (`id`),
   KEY `ip` (`ip`),
-  KEY `member_id` (`member_id`)
+  KEY `profile_id` (`profile_id`)
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
 
 -- Studio page and widget