Code

Run code to update printer objects not only when a printer is added
[gosa.git] / trunk / gosa-plugins / goto / personal / environment / class_environment.inc
index c6f82a34a4c0346c4dc53fa5e53571771b847288..b809805b5067557383e7aba94f458f525d0d1d78 100644 (file)
@@ -64,7 +64,31 @@ class environment extends plugin
   /* general settings */
   // Sets the attributes which will kept on page reload, which will be saved, ...
 
-  var $CopyPasteVars      = array("gotoHotplugDevices","gotoAvailableShares","gotoShareSelections","gotoPrinterSel","gotoProfileFlagL","gotoXResolutions","gotoProfileFlagC","gotoProfileServers","useProfile","is_group","in_dialog","OrigCn","gotoKioskProfile_Server","gotoKioskProfile_Profile");
+  var $CopyPasteVars      = array(
+                            "gotoProfileServer",
+                            "gotoProfileFlags",
+                            "gotoProfileFlagC",
+                            "gotoProfileFlagL",
+                            "useProfile",
+                            "gotoHotplugDeviceDN",
+                            "gotoXResolution",
+                            "gotoProfileQuota",
+                            "gotoLogonScripts",
+                            "gotoLogonScript",
+                            "gotoPrinter",
+                            "gotoPrinterSel",
+                            "gosaDefaultPrinter",
+                            "gotoHotplugDevices",
+                            "gotoShares",
+                            "gotoShare",
+                            "gotoShareSelections",
+                            "gotoAvailableShares",
+                            "gotoKioskProfile",
+                            "gotoKioskProfile_Server",
+                            "gotoKioskProfile_Profile",
+                            "is_group",
+                            "in_dialog",
+                            );
 
   var $attributes         = array("uid","gotoProfileServer","gotoProfileFlags","gotoHotplugDeviceDN",
       "gotoXResolution","gotoProfileQuota",
@@ -1184,7 +1208,7 @@ class environment extends plugin
     
     $this->detect_grouptype();
 
-    if($this->add_del_printer_member_was_called){
+    if($this->add_del_printer_member_was_called || $this->OrigCn != $this->cn){
 
       $types = array( "gotoUserPrinter"       => "AddUser",
           "gotoGroupPrinter"      => "AddGroup",
@@ -1240,7 +1264,7 @@ class environment extends plugin
     /* Prepare HotPlug devices */
     $this->attrs['gotoHotplugDeviceDN'] = array();
     foreach($this->gotoHotplugDevices as $name => $device){
-      $this->attrs['gotoHotplugDeviceDN'][]= $device['dn'];
+      $this->attrs['gotoHotplugDeviceDN'][]= LDAP::fix($device['dn']);
     }
 
     /* Prepare LogonScripts */
@@ -1383,6 +1407,11 @@ class environment extends plugin
     foreach($this->CopyPasteVars as $attr){
       $this->$attr = $o_source->$attr;  
     }
+
+    /* Force adding the new object to eventually
+     * existing printer objects */
+    $this->add_del_printer_member_was_called = TRUE;
+
   }