Code

updated templates
[gosa.git] / gosa-plugins / goto / admin / systems / goto / class_workstationGeneric.inc
index 08d898d06a0b329f04f8a8d73649c2b92481e1ae..47369ae9aa3acf7d19584c3a9aaff3c1ddbaa2b7 100644 (file)
@@ -144,7 +144,9 @@ class workgeneric extends plugin
     if ($this->dn == "new"){
       $ui= get_userinfo();
       $this->base= dn2base(session::global_is_set("CurrentMainBase")?"cn=dummy,".session::global_get("CurrentMainBase"):$ui->dn);
-    } else {
+    } 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);
     }
 
@@ -442,6 +444,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);