/** * Wrapper function to set all remotehost information, by default this will execute if the invocationType is * not set to "xml-rpc" (xml-rpc calls this after re-populating the $_SERVER array) * * @param boolean $run Ignore invocationType checking? */ function MAX_remotehostSetInfo($run = false) { if (empty($GLOBALS['_OA']['invocationType']) || $run || $GLOBALS['_OA']['invocationType'] != 'xmlrpc') { MAX_remotehostProxyLookup(); MAX_remotehostReverseLookup(); //MAX_remotehostSetClientInfo(); // now moved into plugin MAX_remotehostSetGeoInfo(); } }
/** * @todo concerns a plugin * * A function to set the viewer's geotargeting information in the * $GLOBALS['_MAX']['CLIENT_GEO'] global variable, if a plugin for * geotargeting information is configured. * * @todo This is a workaround to avoid having to include the entire plugin architecure * just to be able to load the config information. The plugin system should be * refactored to allow the Delivery Engine to load the information independently */ function test_MAX_remotehostSetGeoInfo() { $return = MAX_remotehostSetGeoInfo(); $this->assertTrue(true); }
| License: GPLv2 or later, see the LICENSE.txt file. | +---------------------------------------------------------------------------+ */ require_once MAX_PATH . '/lib/OA/Dal.php'; require_once MAX_PATH . '/www/admin/lib-banner.inc.php'; require_once LIB_PATH . '/Plugin/Component.php'; require_once MAX_PATH . '/lib/max/Dal/Admin/Acls.php'; if (!isset($GLOBALS['_MAX']['FILES']['/lib/max/Delivery/remotehost.php'])) { // Required by PHP5.1.2 require_once MAX_PATH . '/lib/max/Delivery/remotehost.php'; } // Initialize the client info to enable client targeting options MAX_remotehostProxyLookup(); MAX_remotehostReverseLookup(); //MAX_remotehostSetClientInfo(); // moved to plugin MAX_remotehostSetGeoInfo(); /** * @todo I believe the following is unnecessary with the "MAX_remotehostSetGeoInfo()" above * However the isAllowed() methods for the Geo-Plugins will have to be updated */ // Register the geotargeting information if necessary if (!isset($GLOBALS['_MAX']['GEO_DATA']) && (!empty($conf['geotargeting']['type']) && $conf['geotargeting']['type'] != 'none')) { $oGeoComponent = OX_Component::factoryByComponentIdentifier($conf['geotargeting']['type']); // Get geotargeting info if ($oGeoComponent) { // Set the geotargeting IP to the fixed test address // (IP Address used to determine which (if any) MaxMind databases are installed) $GLOBALS['_MAX']['GEO_IP'] = '24.24.24.24'; // Get the geotargeting config $geoTargetingType = $oGeoPlugin->name; // Look up the Geotargeting data