From 440b42320767018b66c064df96b016373d559b32 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 16 Jul 2007 07:06:31 +0000 Subject: [PATCH] Updated sambaLogonHours to use new timezone functions. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6869 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_timezones.inc | 14 +++----------- .../personal/samba/class_sambaLogonHours.inc | 18 +++--------------- 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/include/class_timezones.inc b/include/class_timezones.inc index c928de5ab..b3db5a334 100644 --- a/include/class_timezones.inc +++ b/include/class_timezones.inc @@ -471,7 +471,7 @@ function _timezones_array($selected = NULL) 'Pacific/Wallis' => 43200, 'Pacific/Yap' => 36000 ); - $timezones_dst = array ( + $_unused_timezones = array ( 'America/Adak' => 1, 'America/Atka' => 1, 'America/Anchorage' => 1, @@ -642,20 +642,12 @@ function _timezones_array($selected = NULL) if($selected != NULL){ foreach($timezones as $timezone => $value) { if (preg_match("#".normalizePreg($timezone)."#i",$selected)){ - return($tz_arr[$timezone] = array('name'=>$timezone,'value'=>$value)); + return($tz_arr[$timezone] = array('name'=>$timezone,'value'=>$value / (60*60))); } } - foreach($timezones_dst as $timezone => $value){ - if (preg_match("/".normalizePreg($timezone)."/i",$selected)){ - return($tz_arr[$timezone] = array('name'=>$timezone,'value'=>$value)); - } - } }else{ foreach($timezones as $timezone => $value) { - $tz_arr[$timezone] = array('name'=>$timezone,'value'=>$value); - } - foreach($timezones_dst as $timezone => $value) { - $tz_arr[$timezone] = array('name'=>$timezone,'value'=>$value); + $tz_arr[$timezone] = array('name'=>$timezone,'value'=>($value / (60*60))); } } return $tz_arr; diff --git a/plugins/personal/samba/class_sambaLogonHours.inc b/plugins/personal/samba/class_sambaLogonHours.inc index f9ffa9601..f889e95cf 100644 --- a/plugins/personal/samba/class_sambaLogonHours.inc +++ b/plugins/personal/samba/class_sambaLogonHours.inc @@ -13,19 +13,9 @@ class sambaLogonHours extends plugin plugin::plugin($config,$dn); $this->sambaLogonHours = $slh; - /* Get Timezone to be able to shift to the correct beginning */ - if(isset($this->config->current['TIMEZONE'])){ - $this->timezone = $this->config->current['TIMEZONE']; - $tz = $this->config->current['TIMEZONE']; - $tz_a = timezones_array($tz); - - if(!count($tz_a)){ - $this->timezone = 0; - print_red(sprintf(_("The configured timezone '%s' seems not to valid."),$tz)); - }else{ - $this->timezone = $tz_a['value'] / (60*60); - } - } + /* Get default timezone */ + $zone = get_default_timezone(); + $this->timezone = $zone['value']; /* Convert to bin */ $tmp = ''; @@ -67,8 +57,6 @@ class sambaLogonHours extends plugin function execute() { - print_a(get_timezone("Europe/Berlin")); - print_a(get_default_timezone()); $week_days = array(); $week_days[0]= _("Sunday"); -- 2.30.2