本文整理汇总了PHP中requestUtils::getRemoteAddress方法的典型用法代码示例。如果您正苦于以下问题:PHP requestUtils::getRemoteAddress方法的具体用法?PHP requestUtils::getRemoteAddress怎么用?PHP requestUtils::getRemoteAddress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类requestUtils
的用法示例。
在下文中一共展示了requestUtils::getRemoteAddress方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
$this->setIp(requestUtils::getRemoteAddress());
$this->setReferrer(isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : null);
$this->setUserAgent(isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : null);
$this->setKs(kCurrentContext::$ks_object ? kCurrentContext::$ks_object : null);
}
示例2: saveAsNewUploadToken
/**
* Set default values and save the new upload token
*/
public function saveAsNewUploadToken()
{
$this->_uploadToken->setStatus(UploadToken::UPLOAD_TOKEN_PENDING);
$this->_uploadToken->setUploadedFileSize(null);
$this->_uploadToken->setUploadTempPath(null);
$this->_uploadToken->setUserIp(requestUtils::getRemoteAddress());
$this->_uploadToken->setDc(kDataCenterMgr::getCurrentDcId());
$this->_uploadToken->save();
}
示例3: notifyProxy
private static function notifyProxy($msg)
{
$server = kConf::get("image_proxy_url");
if ($server && requestUtils::getRemoteAddress() != $server) {
$sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
if ($sock) {
$secret = kConf::get("image_proxy_secret");
$port = kConf::get("image_proxy_port");
$data = md5($secret . $msg) . $msg;
socket_sendto($sock, $data, strlen($data), 0, $server, $port);
socket_close($sock);
}
}
}
示例4: collectAction
function collectAction(KalturaStatsEvent $event)
{
$evenLogFullPath = kConf::get("event_log_file_path");
// if no file path - do nothing
if (!$evenLogFullPath) {
return;
}
$http_referrer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : "";
$users_timestamp = $event->eventTimestamp;
$eventLine = $event->clientVer . self::SEPARATOR . $event->eventType . self::SEPARATOR . date("Y-m-d H:i:s", time()) . self::SEPARATOR . $event->sessionId . self::SEPARATOR . $event->partnerId . self::SEPARATOR . $event->entryId . self::SEPARATOR . $event->uniqueViewer . self::SEPARATOR . $event->widgetId . self::SEPARATOR . $event->uiconfId . self::SEPARATOR . $event->userId . self::SEPARATOR . $event->currentPoint . self::SEPARATOR . $event->duration . self::SEPARATOR . requestUtils::getRemoteAddress() . self::SEPARATOR . $event->processDuration . self::SEPARATOR . $event->controlId . self::SEPARATOR . $event->seek . self::SEPARATOR . $event->newPoint . self::SEPARATOR . ($event->referrer ? $event->referrer : "") . self::SEPARATOR . $users_timestamp . self::SEPARATOR . PHP_EOL;
try {
$res = $this->writeToFile($evenLogFullPath, $eventLine);
if (!$res) {
KalturaLog::err("Error while trying to write event to log. Event:\n" . $eventLine);
}
} catch (Exception $ex) {
KalturaLog::err("Error while trying to write event to log. Event:\n" . $eventLine);
}
return true;
}
示例5: dispatch
public function dispatch($service, $action, $params = array())
{
KalturaLog::debug("Dispatching service [" . $service . "], action [" . $action . "] with params " . print_r($params, true));
$start = microtime(true);
// prevent impersonate to partner zero
$p = isset($params["p"]) && $params["p"] ? $params["p"] : null;
if (!$p) {
$p = isset($params["partnerId"]) && $params["partnerId"] ? $params["partnerId"] : null;
}
$GLOBALS["partnerId"] = $p;
// set for logger
$userId = "";
$ksStr = isset($params["ks"]) ? $params["ks"] : null;
if (!$service) {
throw new KalturaAPIException(KalturaErrors::SERVICE_NOT_SPECIFIED);
}
try {
// load the service reflector
$reflector = new KalturaServiceReflector($service);
} catch (Exception $ex) {
throw new KalturaAPIException(KalturaErrors::SERVICE_DOES_NOT_EXISTS, $service);
}
// check if action exists
if (!$action) {
throw new KalturaAPIException(KalturaErrors::ACTION_NOT_SPECIFIED, $service);
}
if (!$reflector->isActionExists($action)) {
throw new KalturaAPIException(KalturaErrors::ACTION_DOES_NOT_EXISTS, $action, $service);
}
$actionParams = $reflector->getActionParams($action);
// services.ct - check if partner is allowed to access service ...
// validate it's ok to access this service
$deserializer = new KalturaRequestDeserializer($params);
$arguments = $deserializer->buildActionArguments($actionParams);
$serviceInstance = $reflector->getServiceInstance();
kCurrentContext::$host = isset($_SERVER["HOSTNAME"]) ? $_SERVER["HOSTNAME"] : null;
kCurrentContext::$user_ip = requestUtils::getRemoteAddress();
kCurrentContext::$ps_vesion = "ps3";
kCurrentContext::$service = $reflector->getServiceName();
kCurrentContext::$action = $action;
kCurrentContext::$client_lang = isset($params['clientTag']) ? $params['clientTag'] : null;
kCurrentContext::initKsPartnerUser($ksStr, $p, $userId);
kPermissionManager::init(kConf::get('enable_cache'));
// initialize the service before invoking the action on it
$serviceInstance->initService($reflector->getServiceId(), $reflector->getServiceName(), $action);
$invokeStart = microtime(true);
KalturaLog::debug("Invoke start");
$res = $reflector->invoke($action, $arguments);
KalturaLog::debug("Invoke took - " . (microtime(true) - $invokeStart) . " seconds");
KalturaLog::debug("Disptach took - " . (microtime(true) - $start) . " seconds");
$this->clearMemory();
return $res;
}
示例6: dispatch
public function dispatch($service, $action, $params = array())
{
$start = microtime(true);
// prevent impersonate to partner zero
$p = isset($params["p"]) && $params["p"] ? $params["p"] : null;
if (!$p) {
$p = isset($params["partnerId"]) && $params["partnerId"] ? $params["partnerId"] : null;
}
$GLOBALS["partnerId"] = $p;
// set for logger
$userId = "";
$ksStr = isset($params["ks"]) ? $params["ks"] : null;
if (!$service) {
throw new KalturaAPIException(KalturaErrors::SERVICE_NOT_SPECIFIED);
}
//strtolower on service - map is indexed according to lower-case service IDs
$service = strtolower($service);
$serviceActionItem = KalturaServicesMap::retrieveServiceActionItem($service, $action);
$action = strtolower($action);
if (!isset($serviceActionItem->actionMap[$action])) {
KalturaLog::crit("Action does not exist!");
throw new KalturaAPIException(KalturaErrors::ACTION_DOES_NOT_EXISTS, $action, $service);
}
try {
$actionReflector = new KalturaActionReflector($service, $action, $serviceActionItem->actionMap[$action]);
} catch (Exception $e) {
throw new Exception("Could not create action reflector for service [{$service}], action [{$action}]. Received error: " . $e->getMessage());
}
$actionParams = $actionReflector->getActionParams();
$actionInfo = $actionReflector->getActionInfo();
// services.ct - check if partner is allowed to access service ...
kCurrentContext::$host = isset($_SERVER["HOSTNAME"]) ? $_SERVER["HOSTNAME"] : gethostname();
kCurrentContext::$user_ip = requestUtils::getRemoteAddress();
kCurrentContext::$ps_vesion = "ps3";
kCurrentContext::$service = $serviceActionItem->serviceInfo->serviceName;
kCurrentContext::$action = $action;
kCurrentContext::$client_lang = isset($params['clientTag']) ? $params['clientTag'] : null;
kCurrentContext::initKsPartnerUser($ksStr, $p, $userId);
// validate it's ok to access this service
$deserializer = new KalturaRequestDeserializer($params);
$this->arguments = $deserializer->buildActionArguments($actionParams);
KalturaLog::debug("Dispatching service [" . $service . "], action [" . $action . "], reqIndex [" . kCurrentContext::$multiRequest_index . "] with params " . print_r($this->arguments, true));
$responseProfile = $deserializer->getResponseProfile();
if ($responseProfile) {
KalturaLog::debug("Response profile: " . print_r($responseProfile, true));
}
kPermissionManager::init(kConf::get('enable_cache'));
kEntitlementUtils::initEntitlementEnforcement();
$disableTags = $actionInfo->disableTags;
if ($disableTags && is_array($disableTags) && count($disableTags)) {
foreach ($disableTags as $disableTag) {
KalturaCriterion::disableTag($disableTag);
}
}
if ($actionInfo->validateUserObjectClass && $actionInfo->validateUserIdParamName && isset($actionParams[$actionInfo->validateUserIdParamName])) {
// // TODO maybe if missing should throw something, maybe a bone?
// if(!isset($actionParams[$actionInfo->validateUserIdParamName]))
// throw new KalturaAPIException(KalturaErrors::MISSING_MANDATORY_PARAMETER, $actionInfo->validateUserIdParamName);
KalturaLog::debug("validateUserIdParamName: " . $actionInfo->validateUserIdParamName);
$objectId = $params[$actionInfo->validateUserIdParamName];
$this->validateUser($actionInfo->validateUserObjectClass, $objectId, $actionInfo->validateUserPrivilege, $actionInfo->validateOptions);
}
// initialize the service before invoking the action on it
// action reflector will init the service to maintain the pluginable action transparency
$actionReflector->initService($responseProfile);
$invokeStart = microtime(true);
KalturaLog::debug("Invoke start");
try {
$res = $actionReflector->invoke($this->arguments);
} catch (KalturaAPIException $e) {
if ($actionInfo->returnType != 'file') {
throw $e;
}
KalturaResponseCacher::adjustApiCacheForException($e);
$res = new kRendererDieError($e->getCode(), $e->getMessage());
}
kEventsManager::flushEvents();
KalturaLog::debug("Invoke took - " . (microtime(true) - $invokeStart) . " seconds");
KalturaLog::debug("Dispatch took - " . (microtime(true) - $start) . " seconds, memory: " . memory_get_peak_usage(true));
return $res;
}
示例7: setServiceConfigFromPartner
private function setServiceConfigFromPartner($partner)
{
$service_name = str_replace("Action", "", get_class($this));
// service name is the class name without the word Action
if ($partner && $partner->getStatus() == Partner::PARTNER_STATUS_CONTENT_BLOCK) {
$partner_services_config = $partner->getServiceConfigId();
$partner->setServiceConfigId(Partner::CONTENT_BLOCK_SERVICE_CONFIG_ID);
$this->service_config = myPartnerUtils::getServiceConfig($partner);
$partner->setServiceConfigId($partner_services_config);
} elseif ($partner && $partner->getStatus() == Partner::PARTNER_STATUS_FULL_BLOCK) {
$partner_services_config = $partner->getServiceConfigId();
$partner->setServiceConfigId(Partner::FULL_BLOCK_SERVICE_CONFIG_ID);
$this->service_config = myPartnerUtils::getServiceConfig($partner);
$partner->setServiceConfigId($partner_services_config);
} else {
$this->service_config = myPartnerUtils::getServiceConfig($partner);
}
kCurrentContext::$host = isset($_SERVER["HOSTNAME"]) ? $_SERVER["HOSTNAME"] : gethostname();
kCurrentContext::$user_ip = requestUtils::getRemoteAddress();
kCurrentContext::$ps_vesion = "ps2";
kCurrentContext::$service = "partnerservices2";
kCurrentContext::$action = $service_name;
$this->service_config->setServiceName($service_name);
}
示例8: execute
public function execute()
{
$this->forceSystemAuthentication();
$secret = "";
$str = $this->getP("str");
$algo = $this->getP("algo", "wiki_decode");
$res = "";
$key = null;
if ($algo == "wiki_encode") {
$res = str_replace(array("|", "/"), array("|01", "|02"), base64_encode(serialize($str)));
} elseif ($algo == "wiki_decode") {
$res = @unserialize(base64_decode(str_replace(array("|02", "|01"), array("/", "|"), $str)));
} elseif ($algo == "wiki_decode_no_serialize") {
$res = base64_decode(str_replace(array("|02", "|01"), array("/", "|"), $str));
} elseif ($algo == "base64_encode") {
$res = base64_encode($str);
} elseif ($algo == "base64_decode") {
$res = base64_decode($str);
} elseif ($algo == "base64_3des_encode") {
$key = $this->getP("des_key");
echo "[{$key}]";
$input = $str;
$td = mcrypt_module_open('tripledes', '', 'ecb', '');
$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
$key = substr($key, 0, mcrypt_enc_get_key_size($td));
mcrypt_generic_init($td, $key, $iv);
$encrypted_data = mcrypt_generic($td, $input);
mcrypt_generic_deinit($td);
mcrypt_module_close($td);
$res = base64_encode($encrypted_data);
$this->des_key = $key;
} elseif ($algo == "base64_3des_decode") {
$key = $this->getP("des_key");
echo "[{$key}]";
$input = base64_decode($str);
$td = mcrypt_module_open('tripledes', '', 'ecb', '');
$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
$key = substr($key, 0, mcrypt_enc_get_key_size($td));
mcrypt_generic_init($td, $key, $iv);
$encrypted_data = mdecrypt_generic($td, $input);
mcrypt_generic_deinit($td);
mcrypt_module_close($td);
$res = $encrypted_data;
$this->des_key = $key;
} elseif ($algo == "ks") {
$ks = ks::fromSecureString($str);
$res = print_r($ks, true);
if ($ks != null) {
$expired = $ks->valid_until;
$expired_str = self::formatThisData($expired);
$now = time();
$now_str = self::formatThisData($now);
$res .= "<br>" . "valid until: " . $expired_str . "<br>now: {$now} ({$now_str})";
}
} elseif ($algo == "kwid") {
$kwid_str = @base64_decode($str);
if (!$kwid_str) {
// invalid string
return "";
}
/* $kwid = new kwid();
list ( $kwid->kshow_id , $kwid->partner_id , $kwid->subp_id ,$kwid->article_name ,$kwid->widget_id , $kwid->hash ) =
@explode ( self::KWID_SEPARATOR , $str );
*/
$cracked = @explode("|", $kwid_str);
$names = array("kshow_id", "partner_id", "subp_id", "article_name", "widget_id", "hash");
$combined = array_combine($names, $cracked);
$secret = $this->getP("secret");
$md5 = md5($combined["kshow_id"] . $combined["partner_id"] . $combined["subp_id"] . $combined["article_name"] . $combined["widget_id"] . $secret);
$combined["secret"] = $secret;
$combined["calculated hash"] = substr($md5, 1, 10);
$res = print_r($combined, true);
} elseif ($algo == "ip") {
$ip_geo = new myIPGeocoder();
if ($str) {
$remote_addr = $str;
} else {
$remote_addr = requestUtils::getRemoteAddress();
}
$res = $ip_geo->iptocountry($remote_addr);
}
$this->key = $key;
$this->secret = $secret;
$this->str = $str;
$this->res = $res;
$this->algo = $algo;
}
示例9: execute
/**
* Will forward to the regular swf player according to the widget_id
*/
public function execute()
{
$uiconf_id = $this->getRequestParameter('uiconf_id');
if (!$uiconf_id) {
KExternalErrors::dieError(KExternalErrors::MISSING_PARAMETER, 'uiconf_id');
}
$uiConf = uiConfPeer::retrieveByPK($uiconf_id);
if (!$uiConf) {
KExternalErrors::dieError(KExternalErrors::UI_CONF_NOT_FOUND);
}
$partner_id = $this->getRequestParameter('partner_id', $uiConf->getPartnerId());
if (!$partner_id) {
KExternalErrors::dieError(KExternalErrors::MISSING_PARAMETER, 'partner_id');
}
$widget_id = $this->getRequestParameter("widget_id", '_' . $partner_id);
$protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? "https" : "http";
$host = myPartnerUtils::getCdnHost($partner_id, $protocol, 'api');
$ui_conf_html5_url = $uiConf->getHtml5Url();
if (kConf::hasMap("optimized_playback")) {
$optimizedPlayback = kConf::getMap("optimized_playback");
if (array_key_exists($partner_id, $optimizedPlayback)) {
// force a specific kdp for the partner
$params = $optimizedPlayback[$partner_id];
if (array_key_exists('html5_url', $params)) {
$ui_conf_html5_url = $params['html5_url'];
}
}
}
$autoEmbed = $this->getRequestParameter('autoembed');
$iframeEmbed = $this->getRequestParameter('iframeembed');
$scriptName = $iframeEmbed ? 'mwEmbedFrame.php' : 'mwEmbedLoader.php';
if ($ui_conf_html5_url && $iframeEmbed) {
$ui_conf_html5_url = str_replace('mwEmbedLoader.php', 'mwEmbedFrame.php', $ui_conf_html5_url);
}
$relativeUrl = true;
// true if ui_conf html5_url is relative (doesnt start with an http prefix)
if (kString::beginsWith($ui_conf_html5_url, "http")) {
$relativeUrl = false;
$url = $ui_conf_html5_url;
// absolute URL
} else {
if (!$iframeEmbed) {
$host = "{$protocol}://" . kConf::get('html5lib_host') . "/";
}
if ($ui_conf_html5_url) {
$url = $host . $ui_conf_html5_url;
} else {
$html5_version = kConf::get('html5_version');
$url = "{$host}/html5/html5lib/{$html5_version}/" . $scriptName;
}
}
// append uiconf_id and partner id for optimizing loading of html5 library. append them only for "standard" urls by looking for the mwEmbedLoader.php/mwEmbedFrame.php suffix
if (kString::endsWith($url, $scriptName)) {
$url .= "/p/{$partner_id}/uiconf_id/{$uiconf_id}";
if (!$autoEmbed) {
$entry_id = $this->getRequestParameter('entry_id');
if ($entry_id) {
$url .= "/entry_id/{$entry_id}";
}
}
}
header("pragma:");
if ($iframeEmbed) {
$url .= (strpos($url, "?") === false ? "?" : "&") . 'wid=' . $widget_id . '&' . $_SERVER["QUERY_STRING"];
} else {
$params = "protocol={$protocol}&" . $_SERVER["QUERY_STRING"];
$url .= (strpos($url, "?") === false ? "?" : "&") . $params;
if ($relativeUrl) {
header('Content-Type: application/javascript');
kFileUtils::dumpUrl($url, true, false, array("X-Forwarded-For" => requestUtils::getRemoteAddress()));
}
}
requestUtils::sendCachingHeaders(60, true, time());
kFile::cacheRedirect($url);
header("Location:{$url}");
KExternalErrors::dieGracefully();
}
示例10: authKey
protected function authKey()
{
$ip = requestUtils::getRemoteAddress();
$hash = kConf::get("system_pages_login_password");
return sha1($hash . $ip);
}
示例11: execute
//.........这里部分代码省略.........
if ($widget_type == 10) {
$swf_url = $host . "/swf/weplay.swf";
} else {
$swf_url = $host . "/swf/kplayer.swf";
}
$partner_id = $widget->getPartnerId();
$subp_id = $widget->getSubpId();
if (!$subp_id) {
$subp_id = 0;
}
$uiConf = uiConfPeer::retrieveByPK($widget_type);
// new ui_confs which are deleted should stop the script
// the check for >100000 is for supporting very old mediawiki and such players
if (!$uiConf && $widget_type > 100000) {
die;
}
if ($uiConf) {
$ui_conf_swf_url = $uiConf->getSwfUrl();
if (kString::beginsWith($ui_conf_swf_url, "http")) {
$swf_url = $ui_conf_swf_url;
// absolute URL
} else {
$use_cdn = $uiConf->getUseCdn();
$host = $use_cdn ? $partner_cdnHost : $partner_host;
$swf_url = $host . myPartnerUtils::getUrlForPartner($partner_id, $subp_id) . $ui_conf_swf_url;
}
if ($debug_kdp) {
$swf_url = str_replace("/kdp/", "/kdp_debug/", $swf_url);
}
}
if ($show_version < 0) {
$show_version = null;
}
$ip = requestUtils::getRemoteAddress();
// to convert back, use long2ip
// the widget log should change to reflect the new data, but for now - i used $widget_id instead of the widgget_type
// WidgetLog::createWidgetLog( $referer , $ip , $kshow_id , $entry_id , $kmedia_type , $widget_id );
if ($entry_id == -1) {
$entry_id = null;
}
$kdp3 = false;
$base_wrapper_swf = myContentStorage::getFSFlashRootPath() . "/kdpwrapper/" . kConf::get('kdp_wrapper_version') . "/kdpwrapper.swf";
$widgetIdStr = "widget_id={$widget_id}";
$partnerIdStr = "partner_id={$partner_id}&subp_id={$subp_id}";
if ($uiConf) {
$ks_flashvars = "";
$conf_vars = $uiConf->getConfVars();
if ($conf_vars) {
$conf_vars = "&" . $conf_vars;
}
$wrapper_swf = $base_wrapper_swf;
$partner = PartnerPeer::retrieveByPK($partner_id);
if ($partner) {
$partner_type = $partner->getType();
}
if (version_compare($uiConf->getSwfUrlVersion(), "3.0", ">=")) {
$kdp3 = true;
// further in the code, $wrapper_swf is being used and not $base_wrapper_swf
$wrapper_swf = $base_wrapper_swf = myContentStorage::getFSFlashRootPath() . '/kdp3wrapper/' . kConf::get('kdp3_wrapper_version') . '/kdp3wrapper.swf';
$widgetIdStr = "widgetId={$widget_id}";
$uiconf_id_str = "&uiConfId={$uiconf_id}";
$partnerIdStr = "partnerId={$partner_id}&subpId={$subp_id}";
}
// if we are loaded without a wrapper (directly in flex)
// 1. dont create the ks - keep url the same for caching
// 2. dont patch the uiconf - patching is done only to wrapper anyway
示例12: getRemoteAddressAction
/**
* @action getRemoteAddress
* @return string
*
*/
public function getRemoteAddressAction()
{
$remote_addr = requestUtils::getRemoteAddress();
return $remote_addr;
}
示例13: microtime
$start = microtime(true);
set_time_limit(0);
// check cache before loading anything
require_once __DIR__ . "/../lib/KalturaResponseCacher.php";
$expiry = kConf::hasParam("v3cache_getfeed_default_expiry") ? kConf::get("v3cache_getfeed_default_expiry") : 86400;
$cache = new KalturaResponseCacher(null, kCacheManager::CACHE_TYPE_API_V3_FEED, $expiry);
$cache->checkOrStart();
ob_start();
// Database
DbManager::setConfig(kConf::getDB());
DbManager::initialize();
KalturaLog::debug(">------------------------------------- syndicationFeedRenderer -------------------------------------");
KalturaLog::info("syndicationFeedRenderer-start ");
KalturaLog::debug("getFeed Params [" . print_r(requestUtils::getRequestParams(), true) . "]");
kCurrentContext::$host = isset($_SERVER["HOSTNAME"]) ? $_SERVER["HOSTNAME"] : null;
kCurrentContext::$user_ip = requestUtils::getRemoteAddress();
kCurrentContext::$ps_vesion = "ps3";
$feedId = getRequestParameter('feedId');
$entryId = getRequestParameter('entryId');
$limit = getRequestParameter('limit');
$ks = getRequestParameter('ks');
$feedProcessingKey = "feedProcessing_{$feedId}_{$entryId}_{$limit}";
if (function_exists('apc_fetch')) {
if (apc_fetch($feedProcessingKey)) {
KExternalErrors::dieError(KExternalErrors::PROCESSING_FEED_REQUEST);
}
}
try {
$syndicationFeedRenderer = new KalturaSyndicationFeedRenderer($feedId, $feedProcessingKey, $ks);
$syndicationFeedRenderer->addFlavorParamsAttachedFilter();
kCurrentContext::$partner_id = $syndicationFeedRenderer->syndicationFeed->partnerId;
示例14: partialInit
/**
* @return accessControlScope
*/
public static function partialInit()
{
$scope = new accessControlScope();
$scope->setIp(requestUtils::getRemoteAddress());
$scope->setReferrer(isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : null);
return $scope;
}