isGeoLocationAdminEnabled() public static method

public static isGeoLocationAdminEnabled ( )
Beispiel #1
0
 /**
  * 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}'.");
     }
 }
Beispiel #2
0
 public function configureAdminMenu(MenuAdmin $menu)
 {
     if (UserCountry::isGeoLocationAdminEnabled() && Piwik::hasUserSuperUserAccess()) {
         $menu->addSettingsItem('UserCountry_Geolocation', $this->urlForAction('adminIndex'), $order = 9);
     }
 }
Beispiel #3
0
 private function dieIfGeolocationAdminIsDisabled()
 {
     if (!UserCountry::isGeoLocationAdminEnabled()) {
         throw new \Exception('Geo location setting page has been disabled.');
     }
 }
Beispiel #4
0
 public function configureAdminMenu(MenuAdmin $menu)
 {
     if (UserCountry::isGeoLocationAdminEnabled()) {
         $menu->add('General_Settings', 'UserCountry_Geolocation', array('module' => 'UserCountry', 'action' => 'adminIndex'), Piwik::hasUserSuperUserAccess(), $order = 8);
     }
 }