Code

Updated get_ou it receives values from the config registry now.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 10 May 2010 13:33:13 +0000 (13:33 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 10 May 2010 13:33:13 +0000 (13:33 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18275 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/systems/admin/systems/class_componentGeneric.inc
gosa-plugins/systems/admin/systems/class_filterSYSTEMS.inc
gosa-plugins/systems/admin/systems/class_servGeneric.inc
gosa-plugins/systems/admin/systems/class_systemManagement.inc
gosa-plugins/systems/admin/systems/class_termDNS.inc
gosa-plugins/systems/admin/systems/systemSelect/class_systemSelect.inc
gosa-plugins/systems/admin/systems/tabs_component.inc
gosa-plugins/systems/admin/systems/tabs_server.inc

index 209b14fca746c7e8de51080e52e72219c4f1c72e..24e614dbbd4485b6d29350071c46c01b27779203 100644 (file)
@@ -51,7 +51,7 @@ class componentGeneric extends plugin
       $this->base= dn2base(session::global_is_set("CurrentMainBase")?"cn=dummy,".session::global_get("CurrentMainBase"):$ui->dn);
       $this->cn= "";
     } else {
-      $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("componentRDN"), '/')."/i", "", $this->dn);
+      $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("componentGeneric", "componentRDN") , '/')."/i", "", $this->dn);
     }
     $this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses, true);
     /* Save dn for later references */
@@ -181,7 +181,7 @@ class componentGeneric extends plugin
     $message= plugin::check();
     $message= array_merge($message,$this->netConfigDNS->check());
 
-    $this->dn= "cn=".$this->cn.",".get_ou('componentRDN').$this->base;
+    $this->dn= "cn=".$this->cn.",".get_ou("componentGeneric", "componentRDN") .$this->base;
 
     if ($this->cn == "" ){
       $message[]= msgPool::required(_("Component name"));
@@ -210,7 +210,7 @@ class componentGeneric extends plugin
           if(preg_match("/cn=dhcp,/",$attrs['dn'])){
             continue;
           }
-          if ($attrs['dn'] != $this->orig_dn && preg_match("/".preg_quote(get_ou("componentRDN"), '/')."/i",$attrs['dn'])){
+          if ($attrs['dn'] != $this->orig_dn && preg_match("/".preg_quote(get_ou("componentGeneric", "componentRDN") , '/')."/i",$attrs['dn'])){
             $message[]= msgPool::duplicated(_("Component name"));
             break;
           }
index d794cc807424ed315f00d06e2ea689428d6b2850..f20158e1305b08920dff079699296daf7d01d7a1 100644 (file)
@@ -14,7 +14,7 @@ class filterSYSTEMS {
 
 
         foreach($entries as $key => $entry){
-            if(preg_match("/".preg_quote(get_ou('systemIncomingRDN'),'/')."/i", $entry['dn'])){
+            if(preg_match("/".preg_quote(get_ou("ArpNewDevice", "systemIncomingRDN") ,'/')."/i", $entry['dn'])){
 
                 // Detect incoming types
                 if(in_array('gotoWorkstation', $entry['objectClass'])){
index d8891da71c6f4c9143e83e24466de7270bfc34fe..1c6ac0c291a4b0885965a16b79f185bf0ef0ee85 100644 (file)
@@ -84,10 +84,10 @@ class servgeneric extends plugin
       $ui= get_userinfo();
       $this->base= dn2base(session::global_is_set("CurrentMainBase")?"cn=dummy,".session::global_get("CurrentMainBase"):$ui->dn);
       $this->cn= "";
-    } elseif(preg_match("/".preg_quote(get_ou("systemIncomingRDN"), '/')."/i", $this->dn)){
-      $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("systemIncomingRDN"), '/')."/i", "", $this->dn);
+    } elseif(preg_match("/".preg_quote(get_ou("servgeneric", "serverRDN") , '/')."/i", $this->dn)){
+      $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("servgeneric", "serverRDN") , '/')."/i", "", $this->dn);
     } else {
-      $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("serverRDN"), '/')."/i", "", $this->dn);
+      $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("servgeneric", "serverRDN") , '/')."/i", "", $this->dn);
     }
     $this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses);
     $this->netConfigDNS->set_acl_category("server");
@@ -312,7 +312,7 @@ class servgeneric extends plugin
     /* Call common method to give check the hook */
     $message= plugin::check();
     $message= array_merge($message, $this->netConfigDNS->check());
-    $this->dn= "cn=".$this->cn.",".get_ou('serverRDN').$this->base;
+    $this->dn= "cn=".$this->cn.",".get_ou("servgeneric", "serverRDN") .$this->base;
 
     /* must: cn */
     if ($this->cn == ""){
@@ -336,7 +336,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("/,".preg_quote(get_ou('systemIncomingRDN'), '/')."/i",$attrs['dn']) && preg_match("/,".preg_quote(get_ou('serverRDN'), '/')."/i",$attrs['dn'])){
+            if(!preg_match("/cn=dhcp,/",$attrs['dn']) && !preg_match("/,".preg_quote(get_ou("servgeneric", "serverRDN") , '/')."/i",$attrs['dn']) && preg_match("/,".preg_quote(get_ou("servgeneric", "serverRDN") , '/')."/i",$attrs['dn'])){
               $message[]= msgPool::duplicated(_("Server name"));
               break;
             }
@@ -346,7 +346,7 @@ class servgeneric extends plugin
     }
 
     /* Warn the user, that this host is currently installing */
-    if($this->currently_installing && !$this->currently_installing_warned && !preg_match("/".preg_quote(get_ou("systemIncomingRDN"), '/')."/i",$this->orig_dn)){
+    if($this->currently_installing && !$this->currently_installing_warned && !preg_match("/".preg_quote(get_ou("servgeneric", "serverRDN") , '/')."/i",$this->orig_dn)){
 
       /* Force aborting without message dialog */
       $message[] = "";
index d6934e9e2507e86073ba72418f22c5d5560d00f7..5c2c7887c207e4d6b60b9660c185468224d17d3a 100644 (file)
@@ -543,7 +543,7 @@ class systemManagement extends management
    */
   static function incomingFilterConverter($filter)
   {
-    $rdn = preg_replace("/^[^=]*=/", "", get_ou('systemIncomingRDN'));
+    $rdn = preg_replace("/^[^=]*=/", "", get_ou("group", "ogroupRDN") );
     $rdn = preg_replace("/,.*$/","",$rdn);
     return(preg_replace("/%systemIncomingRDN/", $rdn,$filter));
   }
@@ -849,7 +849,7 @@ class systemManagement extends management
               $data['OG'], "<b>Selected ogroup:</b>");
 
           if($data['OG'] != "none"){
-            $this->tabObject->base = preg_replace("/^[^,]+,".preg_quote(get_ou('ogroupRDN'), '/')."/i", "", $data['OG']);
+            $this->tabObject->base = preg_replace("/^[^,]+,".preg_quote(get_ou("group", "ogroupRDN") , '/')."/i", "", $data['OG']);
             $this->tabObject->by_object[$plugClass]->baseSelector->setBase($this->tabObject->base);
           } else {
             $this->tabObject->by_object[$plugClass]->baseSelector->setBase($headpage->getBase());
@@ -1269,7 +1269,7 @@ class systemManagement extends management
           "aclCategory" => "opsi"),
 
         "goServer" => array(
-          "ou"          => get_ou('serverRDN'),
+          "ou"          => get_ou("group", "ogroupRDN") ,
           "plugClass"   => "servgeneric",
           "tabClass"    => "servtabs",
           "tabDesc"     => "SERVTABS",
@@ -1278,7 +1278,7 @@ class systemManagement extends management
           "aclCategory" => "server"),
 
         "gotoWorkstation" => array(
-          "ou"          => get_ou('workstationRDN'),
+          "ou"          => get_ou("group", "ogroupRDN") ,
           "plugClass"   => "workgeneric",
           "tabClass"    => "worktabs",
           "tabDesc"     => "WORKTABS",
@@ -1287,7 +1287,7 @@ class systemManagement extends management
           "aclCategory" => "workstation"),
 
         "gotoTerminal" => array(
-            "ou"          => get_ou('terminalRDN'),
+            "ou"          => get_ou("group", "ogroupRDN") ,
             "plugClass"   => "termgeneric",
             "tabClass"    => "termtabs",
             "sendEvents"  => TRUE,
@@ -1296,7 +1296,7 @@ class systemManagement extends management
             "aclCategory" => "terminal"),
 
         "gotoPrinter" => array(
-            "ou"          => get_ou('printerRDN'),
+            "ou"          => get_ou("group", "ogroupRDN") ,
             "plugClass"   => "printgeneric",
             "tabClass"    => "printtabs",
             "tabDesc"     => "PRINTTABS",
@@ -1305,7 +1305,7 @@ class systemManagement extends management
             "aclCategory" => "printer"),
 
         "FAKE_OC_NewDevice" => array(
-            "ou"          => get_ou('systemIncomingRDN'),
+            "ou"          => get_ou("group", "ogroupRDN") ,
             "plugClass"   => "termgeneric",
             "tabClass"    => "termtabs",
             "sendEvents"  => TRUE,
@@ -1314,7 +1314,7 @@ class systemManagement extends management
             "aclCategory" => "terminal"),
 
         "goFonHardware" => array(
-            "ou"          => get_ou('phoneRDN'),
+            "ou"          => get_ou("group", "ogroupRDN") ,
             "plugClass"   => "phoneGeneric",
             "tabClass"    => "phonetabs",
             "tabDesc"     => "PHONETABS",
@@ -1332,7 +1332,7 @@ class systemManagement extends management
             "aclCategory" => "winworkstation"),
 
         "ieee802Device" => array(
-            "ou"          => get_ou('componentRDN'),
+            "ou"          => get_ou("group", "ogroupRDN") ,
             "plugClass"   => "componentGeneric",
             "sendEvents"  => FALSE,
             "tabClass"    => "componenttabs",
index dc37a189764298d1204f79dda65bfe547c31b61e..b12a4ef586e0b9ca0d04cbec4bc8c8f4be0f665e 100644 (file)
@@ -189,13 +189,13 @@ class termDNS extends plugin
        over the whole ldap server was 10 to 20 times slower.
      */
     $deps  = array();
-    $ou = preg_replace("/,.*$/","",get_ou("systemRDN"));
-    $a_ous = array(get_ou("serverRDN"),
-                  get_ou("terminalRDN"),
-                  get_ou("workstationRDN"),
-                  get_ou("printerRDN"),
-                  get_ou("phoneRDN"),
-                  get_ou("componentRDN"));
+    $ou = preg_replace("/,.*$/","",get_ou("servgeneric", "serverRDN") );
+    $a_ous = array(get_ou("servgeneric", "serverRDN") ,
+                  get_ou("servgeneric", "serverRDN") ,
+                  get_ou("servgeneric", "serverRDN") ,
+                  get_ou("servgeneric", "serverRDN") ,
+                  get_ou("servgeneric", "serverRDN") ,
+                  get_ou("servgeneric", "serverRDN") );
   
     $ldap = $this->config->get_ldap_link();
     $ldap->cd($this->config->current['BASE']);
index c46ce62863705d28a5d6484e6b0035d02fbd1d8f..514767832ec4e3105f78c4e232666ec1232958f8 100644 (file)
@@ -32,7 +32,7 @@ class systemSelect extends management
   {
     $this->config = $config;
     $this->ui = $ui;
-    $this->storagePoints = array(get_ou("serverRDN"), get_ou("workstationRDN"), get_ou('terminalRDN'));
+    $this->storagePoints = array(get_ou("servgeneric", "serverRDN") , get_ou("servgeneric", "serverRDN") , get_ou("servgeneric", "serverRDN") );
 
     // Build filter
     if (session::global_is_set(get_class($this)."_filter")){
index 5dfc787ccf7b029404c4fe6163534fee7559b9b5..7a227af14b74e31b89b5866bbeccf7401d23cab5 100644 (file)
@@ -45,7 +45,7 @@ class componenttabs extends tabs
     /* Check for new 'dn', in order to propagate the
        'dn' to all plugins */
     $baseobject= $this->by_object['componentGeneric'];
-    $this->dn= "cn=$baseobject->cn,".get_ou('componentRDN').$baseobject->base;
+    $this->dn= "cn=$baseobject->cn,".get_ou("componentGeneric", "componentRDN") .$baseobject->base;
 
     if($this->dn != $baseobject->orig_dn && $baseobject->orig_dn != "new"){
 
index ea977581a05597e6bf26fc7f8819b7873ffab1d4..4435c6cfb262da4417ae636a4b43e8e451f30533 100644 (file)
@@ -101,7 +101,7 @@ class servtabs extends tabs
     /* Check for new 'dn', in order to propagate the
        'dn' to all plugins */
     $baseobject= $this->by_object['servgeneric'];
-    $this->dn= "cn=$baseobject->cn,".get_ou('serverRDN').$baseobject->base;
+    $this->dn= "cn=$baseobject->cn,".get_ou("servgeneric", "serverRDN") .$baseobject->base;
 
     /* cn is not case sensitive for ldap, but for php it is!! */
     if($baseobject->orig_dn != "new"){