Code

Updated "inherit" fields
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 29 May 2006 04:53:57 +0000 (04:53 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 29 May 2006 04:53:57 +0000 (04:53 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3533 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_config.inc
plugins/admin/systems/class_workstationStartup.inc

index d13bcf5d919b2d3e1c477dbccc692ea8736de9b5..6d028a11b5cfe9a39317bb30b868ff631b57cbf0 100644 (file)
@@ -412,7 +412,7 @@ class config  {
     }
 
     /* Ldap Server */
-    $this->data['SERVERS']['LDAP']= array("default");
+    $this->data['SERVERS']['LDAP']= array();
     $ldap->cd ($this->current['BASE']);
     $ldap->search ("(objectClass=goLdapServer)");
     while ($attrs= $ldap->fetch()){
index 71e39672ed1f42554b1c74262b62f6c2cf0f6168..2a03e655478a2bb74cbe3bf3a94fcf66c87e30b2 100644 (file)
@@ -53,8 +53,8 @@ class workstartup extends plugin
      */
     $ldap   = $this->config->get_ldap_link();
     $ldap->cd($this->config->current['BASE']);
-   
-    $this->goLdapServerList = array("default" =>"["._("inherited")."]");
+
+    $this->goLdapServerList= $this->config->data['SERVERS']['LDAP'];
    
     $_SESSION['getAvailableClassesForThisRelease_CACHE'] = array();
     $_SESSION['getAvailableClassesForThisRelease_CACHED_CLASSES'] = array();
@@ -276,6 +276,46 @@ class workstartup extends plugin
       
     }
 
+    /* Load hardware list */
+    $ldap= $this->config->get_ldap_link();
+    $ldap->cd($this->config->current['BASE']);
+    $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".$this->dn."))");
+    if ($ldap->count() == 1){
+      $map= array("gotoLdapServer");
+      $attrs= $ldap->fetch();
+
+      foreach ($map as $name){
+        if (!isset($attrs[$name][0])){
+          continue;
+        }
+
+print_a($attrs);
+        switch ($name){
+          case 'gotoLdapServer':
+            $this->goLdapServerList= array_merge(array('default' => _("inherited").' ['.$attrs[$name][0].']' ), $this->goLdapServerList);
+            break;
+#          case 'gotoXColordepth':
+#            $this->XColordepths= array_merge(array('default' => $attrs[$name][0].' ['._("inherited").']' ), $this->XColordepths);
+#            break;
+#          case 'gotoXKbModel':
+#            $this->XKbModels= array_merge(array('default' => $attrs[$name][0].' ['._("inherited").']' ), $this->XKbModels);
+#            break;
+#          case 'gotoXKbLayout':
+#            $this->XKbLayouts= array_merge(array('default' => $attrs[$name][0].' ['._("inherited").']' ), $this->XKbLayouts);
+#            break;
+#          case 'gotoXKbVariant':
+#            $this->XKBvariants= array_merge(array('default' => $attrs[$name][0].' ['._("inherited").']' ), $this->XKbVariants);
+#            break;
+#          case 'gotoMouseType':
+#            $this->XMouseTypes= array_merge(array('default' => $attrs[$name][0].' ['._("inherited").']' ), $this->XMouseTypes);
+#            break;
+#          case 'gotoMousePort':
+#            $this->XMousePorts= array_merge(array('default' => $attrs[$name][0].' ['._("inherited").']' ), $this->XMousePorts);
+#            break;
+        }
+      }
+    }
+
   }
 
   
@@ -582,7 +622,7 @@ class workstartup extends plugin
     $smarty->assign("gotoBootKernels",$this->gotoBootKernels);
 
     /* Arrays */
-    $tmp = $this->config->data['SERVERS']['LDAP'];
+    $tmp = $this->goLdapServerList;
 
     /* Create divSelectBox for ldap server selection
      */
@@ -608,11 +648,7 @@ class workstartup extends plugin
         $use = " checked ";
       };
 
-      if($server == "default"){
-        $display = "["._("inherited")."]";
-      }else{
-        $display = $server;
-      }
+      $display = $server;
 
       $SelectBoxLdapServer->AddEntry(
           array(