本文整理汇总了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);
}