From eb408fc70a4aecbe3dd58bb3e98ea7fc3a366539 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 10 May 2010 13:33:13 +0000 Subject: [PATCH] Updated get_ou it receives values from the config registry now. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18275 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/systems/class_componentGeneric.inc | 6 +++--- .../admin/systems/class_filterSYSTEMS.inc | 2 +- .../admin/systems/class_servGeneric.inc | 12 ++++++------ .../admin/systems/class_systemManagement.inc | 18 +++++++++--------- .../systems/admin/systems/class_termDNS.inc | 14 +++++++------- .../systemSelect/class_systemSelect.inc | 2 +- .../systems/admin/systems/tabs_component.inc | 2 +- .../systems/admin/systems/tabs_server.inc | 2 +- 8 files changed, 29 insertions(+), 29 deletions(-) diff --git a/gosa-plugins/systems/admin/systems/class_componentGeneric.inc b/gosa-plugins/systems/admin/systems/class_componentGeneric.inc index 209b14fca..24e614dbb 100644 --- a/gosa-plugins/systems/admin/systems/class_componentGeneric.inc +++ b/gosa-plugins/systems/admin/systems/class_componentGeneric.inc @@ -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; } diff --git a/gosa-plugins/systems/admin/systems/class_filterSYSTEMS.inc b/gosa-plugins/systems/admin/systems/class_filterSYSTEMS.inc index d794cc807..f20158e13 100644 --- a/gosa-plugins/systems/admin/systems/class_filterSYSTEMS.inc +++ b/gosa-plugins/systems/admin/systems/class_filterSYSTEMS.inc @@ -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'])){ diff --git a/gosa-plugins/systems/admin/systems/class_servGeneric.inc b/gosa-plugins/systems/admin/systems/class_servGeneric.inc index d8891da71..1c6ac0c29 100644 --- a/gosa-plugins/systems/admin/systems/class_servGeneric.inc +++ b/gosa-plugins/systems/admin/systems/class_servGeneric.inc @@ -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[] = ""; diff --git a/gosa-plugins/systems/admin/systems/class_systemManagement.inc b/gosa-plugins/systems/admin/systems/class_systemManagement.inc index d6934e9e2..5c2c7887c 100644 --- a/gosa-plugins/systems/admin/systems/class_systemManagement.inc +++ b/gosa-plugins/systems/admin/systems/class_systemManagement.inc @@ -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'], "Selected ogroup:"); 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", diff --git a/gosa-plugins/systems/admin/systems/class_termDNS.inc b/gosa-plugins/systems/admin/systems/class_termDNS.inc index dc37a1897..b12a4ef58 100644 --- a/gosa-plugins/systems/admin/systems/class_termDNS.inc +++ b/gosa-plugins/systems/admin/systems/class_termDNS.inc @@ -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']); diff --git a/gosa-plugins/systems/admin/systems/systemSelect/class_systemSelect.inc b/gosa-plugins/systems/admin/systems/systemSelect/class_systemSelect.inc index c46ce6286..514767832 100644 --- a/gosa-plugins/systems/admin/systems/systemSelect/class_systemSelect.inc +++ b/gosa-plugins/systems/admin/systems/systemSelect/class_systemSelect.inc @@ -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")){ diff --git a/gosa-plugins/systems/admin/systems/tabs_component.inc b/gosa-plugins/systems/admin/systems/tabs_component.inc index 5dfc787cc..7a227af14 100644 --- a/gosa-plugins/systems/admin/systems/tabs_component.inc +++ b/gosa-plugins/systems/admin/systems/tabs_component.inc @@ -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"){ diff --git a/gosa-plugins/systems/admin/systems/tabs_server.inc b/gosa-plugins/systems/admin/systems/tabs_server.inc index ea977581a..4435c6cfb 100644 --- a/gosa-plugins/systems/admin/systems/tabs_server.inc +++ b/gosa-plugins/systems/admin/systems/tabs_server.inc @@ -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"){ -- 2.30.2