本文整理匯總了PHP中ShopFunctions::getClientIP方法的典型用法代碼示例。如果您正苦於以下問題:PHP ShopFunctions::getClientIP方法的具體用法?PHP ShopFunctions::getClientIP怎麽用?PHP ShopFunctions::getClientIP使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ShopFunctions
的用法示例。
在下文中一共展示了ShopFunctions::getClientIP方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: checkIps
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: isValidIP
/**
* 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: getRemoteIPAddress
function getRemoteIPAddress()
{
if (!class_exists('ShopFunctions')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'shopfunctions.php';
}
return ShopFunctions::getClientIP();
}
示例4: _setBillingInformation
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);
}