Code

Updated listing of FAI classes
[gosa.git] / gosa-plugins / goto / admin / systems / goto / class_workstationGeneric.inc
index a93579f8c188a2e2186c64216f75e9ac442b159a..dbda55d9198bef61bbbfb8ac7dfcb99d744d9222 100644 (file)
@@ -143,8 +143,10 @@ class workgeneric extends plugin
     /* Set base */
     if ($this->dn == "new"){
       $ui= get_userinfo();
-      $this->base= dn2base($ui->dn);
-    } else {
+      $this->base= dn2base(session::global_is_set("CurrentMainBase")?"cn=dummy,".session::global_get("CurrentMainBase"):$ui->dn);
+    } elseif(preg_match("/".preg_quote(get_ou("systemIncomingRDN"), '/')."/i", $this->dn)){
+      $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("systemIncomingRDN"), '/')."/i", "", $this->dn);
+    }else{
       $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("workstationRDN"), '/')."/i", "", $this->dn);
     }
 
@@ -260,7 +262,6 @@ class workgeneric extends plugin
     $smarty->assign("cn", $this->cn);
     $smarty->assign("description", $this->description);
     $smarty->assign("l", $this->l);
-    $smarty->assign("staticAddress", "");
 
     $tmp = array();
     foreach($this->gotoNtpServers as $server){
@@ -442,6 +443,11 @@ class workgeneric extends plugin
       $message[] = msgPool::invalid(_("Name"));
     }
 
+    // Check if a wrong base was supplied
+    if(!$this->baseSelector->checkLastBaseUpdate()){
+      $message[]= msgPool::check_base();
+    }
+
     if ($this->orig_dn != $this->dn){
       $ldap= $this->config->get_ldap_link();
       $ldap->cd ($this->base);