示例#1
0
 private function checkIps()
 {
     if (!class_exists('ShopFunctions')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'shopfunctions.php';
     }
     $paybox_ips = array('194.2.122.158', '195.25.7.166', '195.101.99.76');
     $clientIp = ShopFunctions::getClientIP();
     if (!in_array($clientIp, $paybox_ips)) {
         $text = "Error with REMOTE IP ADDRESS = " . $clientIp . ".\n                        The remote address of the script posting to this notify script does not match a valid Paybox IP address\n\n            These are the valid Paybox IP Addresses: " . implode(",", $paybox_ips);
         $this->plugin->debugLog('FUNCTION checkIps' . $text, 'error');
         return false;
     }
     return true;
 }
示例#2
0
 /**
  * Switch for enabling / disabling Hidden Button Mode.
  * @return bool
  */
 private function isValidIP()
 {
     if (empty($this->_currentMethod->ip_whitelist)) {
         return true;
     }
     if (!class_exists('ShopFunctions')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'shopfunctions.php';
     }
     $clientIp = ShopFunctions::getClientIP();
     $ip_whitelist = explode(";", $this->_currentMethod->ip_whitelist);
     if (in_array($clientIp, $ip_whitelist)) {
         return true;
     }
     return false;
 }
示例#3
0
 function getRemoteIPAddress()
 {
     if (!class_exists('ShopFunctions')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'shopfunctions.php';
     }
     return ShopFunctions::getClientIP();
 }
示例#4
0
 function _setBillingInformation($usrBT)
 {
     if (!class_exists('ShopFunctions')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'shopfunctions.php';
     }
     $clientIp = ShopFunctions::getClientIP();
     // Customer Name and Billing Address
     return array('x_email' => isset($usrBT->email) ? $this->_getField($usrBT->email, 100) : '', 'x_first_name' => isset($usrBT->first_name) ? $this->_getField($usrBT->first_name, 50) : '', 'x_last_name' => isset($usrBT->last_name) ? $this->_getField($usrBT->last_name, 50) : '', 'x_company' => isset($usrBT->company) ? $this->_getField($usrBT->company, 50) : '', 'x_address' => isset($usrBT->address_1) ? $this->_getField($usrBT->address_1, 60) : '', 'x_city' => isset($usrBT->city) ? $this->_getField($usrBT->city, 40) : '', 'x_zip' => isset($usrBT->zip) ? $this->_getField($usrBT->zip, 20) : '', 'x_state' => isset($usrBT->virtuemart_state_id) ? $this->_getField(ShopFunctions::getStateByID($usrBT->virtuemart_state_id), 40) : '', 'x_country' => isset($usrBT->virtuemart_country_id) ? $this->_getField(ShopFunctions::getCountryByID($usrBT->virtuemart_country_id), 60) : '', 'x_phone' => isset($usrBT->phone_1) ? $this->_getField($usrBT->phone_1, 25) : '', 'x_fax' => isset($usrBT->fax) ? $this->_getField($usrBT->fax, 25) : '', 'x_customer_ip' => $clientIp);
 }