Code

Followup commit for #4146
authorpsc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 5 May 2010 10:50:27 +0000 (10:50 +0000)
committerpsc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 5 May 2010 10:50:27 +0000 (10:50 +0000)
Fix problem that in some cases wrong error messages
are printed.

git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@18146 594d385d-05f5-0310-b6e9-bd551577e9d8

trunk/gosa-plugins/goto/admin/systems/goto/class_workstationService.inc

index b5c8e3488a8c06a191593def1f3958031191f15a..f42eb7dbd1fabc9f33a204290ba549072476ac21 100644 (file)
@@ -49,7 +49,7 @@ class workservice extends plugin
   var $XKbLayouts       =array();
   var $XKbVariants      =array();
 
-  var $InheritXYSync = FALSE;
+  var $InheritXYSync = TRUE;
 
   function workservice (&$config, $dn= NULL, $parent= NULL)
   {
@@ -182,8 +182,16 @@ class workservice extends plugin
       }
     }
 
-    if(isset($this->attrs['gotoXHsync']) && isset($this->attrs['gotoXYsync'])) {
-      $this->InheritXYSync = FALSE;
+    if(preg_match("/\+/",$this->gotoXHsync)){
+      $this->AutoSync = true;
+      $this->gotoXHsync = preg_replace("/\+/","-",$this->gotoXHsync);
+      $this->gotoXVsync = preg_replace("/\+/","-",$this->gotoXVsync);
+    }
+
+    if (isset($this->attrs['gotoXHsync']) && isset($this->attrs['gotoXVsync'])) {
+        if(!empty($this->attrs['gotoXHsync'][0]) && !empty($this->attrs['gotoXVsync'][0])) {
+        $this->InheritXYSync = FALSE;
+       }
     }
 
     /* Workaround to fill in inherited values if we've specified an objectclass */
@@ -470,9 +478,7 @@ class workservice extends plugin
     if($this->InheritXYSync) {
       $this->attrs['gotoXHsync'] = array();
       $this->attrs['gotoXVsync'] = array();
-    }
-
-    if($this->AutoSync){
+    } elseif ($this->AutoSync) {
       $this->attrs['gotoXHsync'] = "30+55";
       $this->attrs['gotoXVsync'] = "50+70";
     }