Code

Added devices
[gosa.git] / gosa-plugins / systems / admin / systems / class_componentGeneric.inc
index 002b38b2eb4c3fe12d580b6c3e15e2b56c079d73..b3ff77e38c4df28568bca1ea8d2d5cb9496def74 100644 (file)
@@ -50,7 +50,7 @@ class componentGeneric extends plugin
       $this->base= dn2base($ui->dn);
       $this->cn= "";
     } else {
-      $this->base= preg_replace ("/^[^,]+,".normalizePreg(get_ou("componentou"))."/", "", $this->dn);
+      $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("componentRDN"), '/')."/i", "", $this->dn);
     }
     $this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses, true);
     /* Save dn for later references */
@@ -203,7 +203,7 @@ class componentGeneric extends plugin
     $message= plugin::check();
     $message= array_merge($message,$this->netConfigDNS->check());
 
-    $this->dn= "cn=".$this->cn.",".get_ou('componentou').$this->base;
+    $this->dn= "cn=".$this->cn.",".get_ou('componentRDN').$this->base;
 
     if ($this->cn == "" ){
       $message[]= msgPool::required(_("Component name"));
@@ -232,7 +232,7 @@ class componentGeneric extends plugin
           if(preg_match("/cn=dhcp,/",$attrs['dn'])){
             continue;
           }
-          if ($attrs['dn'] != $this->orig_dn){
+          if ($attrs['dn'] != $this->orig_dn && preg_match("/".preg_quote(get_ou("componentRDN"), '/')."/i",$attrs['dn'])){
             $message[]= msgPool::duplicated(_("Component name"));
             break;
           }
@@ -317,7 +317,8 @@ class componentGeneric extends plugin
           "plProvidedAcls"=> array(
             "cn"                  => _("Name"),
             "base"                => _("Base"),
-            "description"         => _("Description"))
+            "description"         => _("Description"),
+            "userPassword"      => _("Root password"))
           ));
   }
 
@@ -354,6 +355,13 @@ class componentGeneric extends plugin
       $this->netConfigDNS->ipHostNumber = $source['ipHostNumber'][0];
     }
   }
+
+
+  function is_modal_dialog()
+  {
+    return((isset($this->dialog) && $this->dialog) || (isset($this->netConfigDNS->dialog) && $this->netConfigDNS->dialog));
+  }
+
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: