Ejemplo n.º 1
0
 /**
  * (non-PHPDoc)
  * @see ApplicationBootstrap::detectTimezone() For the method documentation.
  */
 protected function detectTimezone()
 {
     $auth = Auth::getInstance();
     if (!$auth->isAuthenticated() || ($timezone = $auth->getUser()->getPreferences()->getValue('icingaweb', 'timezone')) === null) {
         $detect = new TimezoneDetect();
         $timezone = $detect->getTimezoneName();
     }
     return $timezone;
 }
Ejemplo n.º 2
0
 /**
  * Return the current default timezone
  *
  * @return  string
  */
 protected function getDefaultTimezone()
 {
     $detect = new TimezoneDetect();
     if ($detect->success()) {
         return $detect->getTimezoneName();
     } else {
         return @date_default_timezone_get();
     }
 }