Code

Updated copy & paste handling for terminals
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 1 Oct 2009 14:41:11 +0000 (14:41 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 1 Oct 2009 14:41:11 +0000 (14:41 +0000)
-Moved tftpd fix

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14450 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc
gosa-plugins/goto/admin/systems/goto/class_terminalService.inc
gosa-plugins/goto/admin/systems/goto/class_terminalStartup.inc

index ab2207e8304b246e20851d8f348a86aa4e3b357a..ad651b856978854b0e19740c4744cea4fc6bce12 100644 (file)
@@ -500,6 +500,37 @@ class termgeneric extends plugin
         $this->gotoMode != $this->saved_attributes['gotoMode'] &&
         $this->gotoMode == "active" &&
         tests::is_ip($this->netConfigDNS->ipHostNumber)) || $this->auto_activate;
+
+    /* Find proper terminal path for tftp configuration
+       FIXME: This is suboptimal when the default has changed to
+       another location! */
+    if ($this->gotoTerminalPath == "default"){
+      $ldap= $this->config->get_ldap_link();
+
+      /* Strip relevant part from dn, keep trailing ',' */
+      $tmp= preg_replace("/^cn=[^,]+,".get_ou('terminalRDN')."/i", "", $this->dn);
+      $tmp= preg_replace("/".$this->config->current['BASE']."$/i", "", $tmp);
+
+      /* Walk from top to base and try to load default values for
+         'gotoTerminalPath'. Abort when an entry is found. */
+      while (TRUE){
+        $tmp= preg_replace ("/^[^,]+,/", "", $tmp);
+
+        $ldap->cat("cn=default,".get_ou('terminalRDN').$tmp.
+            $this->config->current['BASE'], array('gotoTerminalPath'));
+        $attrs= $ldap->fetch();
+        if (isset($attrs['gotoTerminalPath'])){
+          $this->gotoTerminalPath= $attrs['gotoTerminalPath'][0];
+          break;
+        }
+
+        /* Nothing left? */
+        if ($tmp == ""){
+          break;
+        }
+      }
+    }
+
     plugin::save();
 
     /* Strip out 'default' values */
index 2f4c305158a3d2c335aef4e822473f5dd7f2d9be..b78b35c71c56bab7b3aff6bcbbbef752d2550878 100644 (file)
@@ -683,6 +683,19 @@ class termservice extends plugin
   }
 
 
+  function PrepareForCopyPaste($source)
+  {
+    plugin::PrepareForCopyPaste($source);
+
+    $source_o = new termservice ($this->config, $source['dn']);
+
+    foreach(array("gotoXdmcpServer","selected_xdmcp_servers") as $attr){
+      $this->$attr = $source_o->$attr;
+    }
+  }
+
+
+
   /* Return plugin informations for acl handling */
   static function plInfo()
   {
index c55ce9824b8192c538616c920504c26b44fc6bdb..31c8ea97e1bebe6e7e03854f86f9750b7778f50c 100644 (file)
@@ -375,35 +375,6 @@ class termstartup extends plugin
       exit();
     }
 
-    /* Find proper terminal path for tftp configuration
-       FIXME: This is suboptimal when the default has changed to
-       another location! */
-    if ($this->gotoTerminalPath == "default-inherit"){
-      $ldap= $this->config->get_ldap_link();
-
-      /* Strip relevant part from dn, keep trailing ',' */
-      $tmp= preg_replace("/^cn=[^,]+,".get_ou('terminalRDN')."/i", "", $this->dn);
-      $tmp= preg_replace("/".$this->config->current['BASE']."$/i", "", $tmp);
-
-      /* Walk from top to base and try to load default values for
-         'gotoTerminalPath'. Abort when an entry is found. */
-      while (TRUE){
-        $tmp= preg_replace ("/^[^,]+,/", "", $tmp);
-
-        $ldap->cat("cn=default,".get_ou('terminalRDN').$tmp.
-            $this->config->current['BASE'], array('gotoTerminalPath'));
-        $attrs= $ldap->fetch();
-        if (isset($attrs['gotoTerminalPath'])){
-          $this->gotoTerminalPath= $attrs['gotoTerminalPath'][0];
-          break;
-        }
-
-        /* Nothing left? */
-        if ($tmp == ""){
-          break;
-        }
-      }
-    }
     
     plugin::save();
 
@@ -501,7 +472,12 @@ class termstartup extends plugin
 
     $source_o = new termstartup ($this->config, $source['dn']);
 
-    foreach(array("gotoModules", "gotoKernelParameters","gotoShares","gotoKernelParameters","gotoTerminalPath","gotoShares","goLdapServerList","gotoBootKernel","gotoLdapServer","gotoBootKernels") as $attr){
+    foreach(array("gotoModules", "gotoKernelParameters","gotoShare",
+                  "gotoKernelParameters","gotoShares",
+                  "goLdapServerList","gotoBootKernel","gotoLdapServer",
+                  "gotoBootKernels","gotoLdapServers","gotoLdapServers",
+                  "gotoLdapServerList","gotoLdap_inherit","gotoShareSelections",
+                  "gotoAvailableShares") as $attr){
       $this->$attr = $source_o->$attr;
     }
   }