Code

Fixed regex for opsi hosts
[gosa.git] / gosa-plugins / systems / admin / systems / class_servGeneric.inc
index a4fc61fa2ef8ace9a06e3a3d17ae888e1ee65aef..9bfa325eb9c2e2a516340e38e961dd0e7e6a0944 100644 (file)
@@ -92,7 +92,7 @@ class servgeneric extends plugin
       $this->base= dn2base($ui->dn);
       $this->cn= "";
     } else {
-      $this->base= preg_replace ("/^[^,]+,".normalizePreg(get_ou("serverRDN"))."/", "", $this->dn);
+      $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("serverRDN"), '/')."/", "", $this->dn);
     }
     $this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses);
     $this->netConfigDNS->set_acl_category("server");
@@ -351,7 +351,7 @@ class servgeneric extends plugin
       if ($ldap->count() != 0){
         while ($attrs= $ldap->fetch()){
           if ($attrs['dn'] != $this->orig_dn){
-            if(!preg_match("/cn=dhcp,/",$attrs['dn']) && !preg_match("/,".get_ou('incomingou')."/",$attrs['dn']) && preg_match("/,".get_ou('serverRDN')."/",$attrs['dn'])){
+            if(!preg_match("/cn=dhcp,/",$attrs['dn']) && !preg_match("/,".get_ou('systemIncomingRDN')."/",$attrs['dn']) && preg_match("/,".get_ou('serverRDN')."/",$attrs['dn'])){
               $message[]= msgPool::duplicated(_("Server name"));
               break;
             }
@@ -361,7 +361,7 @@ class servgeneric extends plugin
     }
 
     /* Warn the user, that this host is currently installing */
-    if($this->currently_installing && !$this->currently_installing_warned && !preg_match("/".normalizePreg(get_ou("incomingou"))."/",$this->orig_dn)){
+    if($this->currently_installing && !$this->currently_installing_warned && !preg_match("/".preg_quote(get_ou("systemIncomingRDN"), '/')."/",$this->orig_dn)){
 
       /* Force aborting without message dialog */
       $message[] = "";
@@ -509,11 +509,13 @@ class servgeneric extends plugin
           "plCategory"    => array("server" => array("description"  => _("Server"),
                                                      "objectClass"  => "goServer")),
           "plProvidedAcls"=> array(
-            "cn"           => _("Name"),
-            "description"  => _("Description"),
-            "gotoMode"     => _("Goto mode"),
-            "base"         => _("Base"),
-            "FAIstate"     => _("Action flag"))
+            "cn"            => _("Name"),
+            "description"   => _("Description"),
+            "base"          => _("Base"),
+
+            "gotoMode"      => _("Goto mode"),
+            "userPassword"=> _("Root password"),
+            "FAIstate"      => _("Action flag"))
           ));
   }
 }