Piwik\Plugins\UserCountry\UserCountry::isGeoLocationAdminEnabled PHP Method

isGeoLocationAdminEnabled() public static method

public static isGeoLocationAdminEnabled ( )
    public static function isGeoLocationAdminEnabled()
    {
        return (bool) Config::getInstance()->General['enable_geolocation_admin'];
    }

Usage Example

Example #1
0
File: API.php Project: piwik/piwik
 /**
  * Set the location provider
  *
  * @param string $providerId  The ID of the provider to use  eg 'default', 'geoip_php', ...
  * @throws Exception if ID is invalid
  */
 public function setLocationProvider($providerId)
 {
     Piwik::checkUserHasSuperUserAccess();
     if (!UserCountry::isGeoLocationAdminEnabled()) {
         throw new \Exception('Setting geo location has been disabled in config.');
     }
     $provider = LocationProvider::setCurrentProvider($providerId);
     if ($provider === false) {
         throw new Exception("Invalid provider ID: '{$providerId}'.");
     }
 }
All Usage Examples Of Piwik\Plugins\UserCountry\UserCountry::isGeoLocationAdminEnabled