Code

Updated sambaLogonHours to use new timezone functions.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 16 Jul 2007 07:06:31 +0000 (07:06 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 16 Jul 2007 07:06:31 +0000 (07:06 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6869 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_timezones.inc
plugins/personal/samba/class_sambaLogonHours.inc

index c928de5abe16e43bb184e00125df54a7fa45c26e..b3db5a33467aea5afed517a21d108fafc9471b9a 100644 (file)
@@ -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;  
index f9ffa96012d4bfd03189917ec724aa3b498c470e..f889e95cfc2c1e475206c9a2f7483aab259d9276 100644 (file)
@@ -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");