diff --git a/app/code/community/Sitewards/B2BProfessional/Helper/Customer.php b/app/code/community/Sitewards/B2BProfessional/Helper/Customer.php index 8db06a3..266acaf 100644 --- a/app/code/community/Sitewards/B2BProfessional/Helper/Customer.php +++ b/app/code/community/Sitewards/B2BProfessional/Helper/Customer.php @@ -17,6 +17,11 @@ class Sitewards_B2BProfessional_Helper_Customer extends Sitewards_B2BProfessiona */ const CONFIG_EXTENSION_REQUIRES_LOGIN = 'b2bprofessional/requirelogin/requirelogin'; + /** + * Path for the config for extension allowed ip addresses that don't need to login + */ + //const CONFIG_EXTENSION_REQUIRES_LOGIN_IPADDRESSES = 'b2bprofessional/exemptips/ipaddresses'; + /** * Path for the config for extension is active by customer group */ @@ -157,7 +162,17 @@ public function isCustomerGroupActive() */ public function isLoginRequired() { + //added by Philip pd@dwdonline.com DWD + $allowedIPAddresses = Mage::getStoreConfig('b2bprofessional/exemptips/ipaddresses'); + $ip = $_SERVER['REMOTE_ADDR']; + $allowed = explode(",",$allowedIPAddresses); + + if (in_array($ip, $allowed)) { + return $this->getStoreFlag('0', 'bLoginRequired'); + } else { return $this->getStoreFlag(self::CONFIG_EXTENSION_REQUIRES_LOGIN, 'bLoginRequired'); + } + //end added by Philip pd@dwdonline.com DWD } /** diff --git a/app/code/community/Sitewards/B2BProfessional/etc/system.xml b/app/code/community/Sitewards/B2BProfessional/etc/system.xml index ed9d312..134aeb7 100644 --- a/app/code/community/Sitewards/B2BProfessional/etc/system.xml +++ b/app/code/community/Sitewards/B2BProfessional/etc/system.xml @@ -96,6 +96,25 @@ + + + text + 3 + 1 + 1 + 1 + + + + text + 3 + 1 + 1 + 1 + + + + text