From c389ccecf0cbb0cc4c1bf849eb706c11a8bbede6 Mon Sep 17 00:00:00 2001 From: Lisa Marie Maginnis Date: Fri, 29 Aug 2014 13:02:48 -0400 Subject: [PATCH] Fixed blacklist logging --- trustcommerce.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/trustcommerce.php b/trustcommerce.php index f6e5e80..afa2b0d 100644 --- a/trustcommerce.php +++ b/trustcommerce.php @@ -175,12 +175,13 @@ class org_fsf_payment_trustcommerce extends CRM_Core_Payment { function _isIPBlacklisted() { $ip = $_SERVER['REMOTE_ADDR']; + $agent = $_SERVER['HTTP_USER_AGENT']; $ip = ip2long($ip); $blacklist = array(); $dao = CRM_Core_DAO::executeQuery('SELECT * FROM `trustcommerce_blacklist`'); while($dao->fetch()) { if($ip >= $dao->start && $ip <= $dao->end) { - error_log('[client '.$ip.'] [agent '.$agent.'] Blacklisted by IP rule #'.$dao->id); + error_log('[client '.long2ip($ip).'] [agent '.$agent.'] Blacklisted by IP rule #'.$dao->id); return TRUE; } } -- 2.25.1