From 0b329f79fcae3d38a7659a027174bdba47f55f3e Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 2 Jan 2008 13:27:38 +0000 Subject: [PATCH] Replaced hard coded "ou=servers,ou=systems," with get_ou('serverou') git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8175 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/html/getxls.php | 4 ++-- gosa-core/include/functions.inc | 1 + gosa-core/plugins/addons/gotomasses/class_target_list.inc | 2 +- gosa-core/plugins/addons/ldapmanager/class_exportxls.inc | 2 +- gosa-core/plugins/admin/ogroups/class_ogroup.inc | 2 +- gosa-core/plugins/admin/systems/class_servGeneric.inc | 4 ++-- gosa-core/plugins/admin/systems/class_systemManagement.inc | 4 ++-- .../plugins/admin/systems/services/nfs/class_servNfs.inc | 2 +- .../admin/systems/services/shares/class_goShareServer.inc | 2 +- gosa-core/plugins/admin/systems/tabs_server.inc | 2 +- 10 files changed, 13 insertions(+), 12 deletions(-) diff --git a/gosa-core/html/getxls.php b/gosa-core/html/getxls.php index de3607c82..5c2f13a07 100644 --- a/gosa-core/html/getxls.php +++ b/gosa-core/html/getxls.php @@ -181,7 +181,7 @@ function dump_ldap ($mode= 0) /* SYSTEMS Get all systems from th $dn and put them into the xls work sheet */ - case "ou=servers,ou=systems,": $servers= $ldap->gen_xls($dn,"(objectClass=*)",array("cn")); + case get_ou('serverou'): $servers= $ldap->gen_xls($dn,"(objectClass=*)",array("cn")); $intitul=array(_("Server name").":"); //name of the xls file @@ -286,7 +286,7 @@ function dump_ldap ($mode= 0) $computers= $ldap->gen_xls("ou=computers,".$dn,"(objectClass=*)",array("cn","description","uid")); $computers_intitul=array(_("Description").":",_("UID").":"); //data about servers - $servers= $ldap->gen_xls("ou=servers,ou=systems,".$dn,"(objectClass=*)",array("cn")); + $servers= $ldap->gen_xls(get_ou('serverou').$dn,"(objectClass=*)",array("cn")); $servers_intitul=array(_("Name").":"); //data about addressbook $address= $ldap->gen_xls("dc=addressbook,".$dn,"(objectClass=*)", diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc index e27fc0e65..c849c7bd6 100644 --- a/gosa-core/include/functions.inc +++ b/gosa-core/include/functions.inc @@ -1035,6 +1035,7 @@ function get_ou($name) global $config; $map = array( "applicationou" => "ou=apps,", + "serverou" => "ou=servers,ou=systems,", "mimetypeou" => "ou=mime,"); /* Preset ou... */ diff --git a/gosa-core/plugins/addons/gotomasses/class_target_list.inc b/gosa-core/plugins/addons/gotomasses/class_target_list.inc index 6ecd300ef..22c38b41f 100644 --- a/gosa-core/plugins/addons/gotomasses/class_target_list.inc +++ b/gosa-core/plugins/addons/gotomasses/class_target_list.inc @@ -257,7 +257,7 @@ class target_list extends MultiSelectWindow array("cn","objectClass","ipHostNumber","description"), GL_SIZELIMIT ); $res= array_merge($res,get_list($filter, "workstation", "ou=workstations,ou=systems,".$base, array("cn","objectClass","ipHostNumber","description"), GL_SIZELIMIT )); - $res= array_merge($res,get_list($filter, "server", "ou=servers,ou=systems,".$base, + $res= array_merge($res,get_list($filter, "server", get_ou('serverou').$base, array("cn","objectClass","ipHostNumber","description"), GL_SIZELIMIT )); } diff --git a/gosa-core/plugins/addons/ldapmanager/class_exportxls.inc b/gosa-core/plugins/addons/ldapmanager/class_exportxls.inc index 3331cbacd..2f392faea 100644 --- a/gosa-core/plugins/addons/ldapmanager/class_exportxls.inc +++ b/gosa-core/plugins/addons/ldapmanager/class_exportxls.inc @@ -78,7 +78,7 @@ class xlsexport extends plugin $smarty->assign("choicelist",array( get_people_ou() =>"users" , "ou=groups," =>"groups" , "ou=systems," =>"computers", - "ou=servers,ou=systems," =>"servers", + get_ou('serverou') =>"servers", "dc=addressbook," =>"addressbook")); // Get the LDAP link, to generate the Export diff --git a/gosa-core/plugins/admin/ogroups/class_ogroup.inc b/gosa-core/plugins/admin/ogroups/class_ogroup.inc index 2660a81a5..bec6b25a6 100644 --- a/gosa-core/plugins/admin/ogroups/class_ogroup.inc +++ b/gosa-core/plugins/admin/ogroups/class_ogroup.inc @@ -389,7 +389,7 @@ class ogroup extends plugin "groups" => array("CLASS"=>"posixGroup" ,"DN"=> get_groups_ou() ,"ACL" => "groups"), "applications" => array("CLASS"=>"gosaApplication","DN"=> get_ou('applicationou') ,"ACL" => "application"), "departments" => array("CLASS"=>"gosaDepartment" ,"DN"=> "" ,"ACL" => "department"), - "servers" => array("CLASS"=>"goServer" ,"DN"=> "ou=servers,ou=systems," ,"ACL" => "server"), + "servers" => array("CLASS"=>"goServer" ,"DN"=> get_ou('serverou') ,"ACL" => "server"), "workstations" => array("CLASS"=>"gotoWorkstation","DN"=> "ou=workstations,ou=systems," ,"ACL" => "workstation"), "terminals" => array("CLASS"=>"gotoTerminal" ,"DN"=> "ou=terminals,ou=systems," ,"ACL" => "terminal"), "printers" => array("CLASS"=>"gotoPrinter" ,"DN"=> "ou=printers,ou=systems," ,"ACL" => "printer"), diff --git a/gosa-core/plugins/admin/systems/class_servGeneric.inc b/gosa-core/plugins/admin/systems/class_servGeneric.inc index 9d29f5e59..8497ed865 100644 --- a/gosa-core/plugins/admin/systems/class_servGeneric.inc +++ b/gosa-core/plugins/admin/systems/class_servGeneric.inc @@ -289,7 +289,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.",ou=servers,ou=systems,".$this->base; + $this->dn= "cn=".$this->cn.",".get_ou('serverou').$this->base; /* must: cn */ if ($this->cn == ""){ @@ -308,7 +308,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("/,ou=incoming,/",$attrs['dn']) && preg_match("/,ou=servers,ou=systems,/",$attrs['dn'])){ + if(!preg_match("/cn=dhcp,/",$attrs['dn']) && !preg_match("/,ou=incoming,/",$attrs['dn']) && preg_match("/,".get_ou('serverou')."/",$attrs['dn'])){ $message[]= sprintf (_("There is already an entry '%s' in the base choosen by you"), $this->cn); break; } diff --git a/gosa-core/plugins/admin/systems/class_systemManagement.inc b/gosa-core/plugins/admin/systems/class_systemManagement.inc index 7b0484404..3f2c49603 100644 --- a/gosa-core/plugins/admin/systems/class_systemManagement.inc +++ b/gosa-core/plugins/admin/systems/class_systemManagement.inc @@ -899,7 +899,7 @@ class systems extends plugin "terminal" => "ou=terminals,ou=systems,", "workstation" => "ou=workstations,ou=systems,", "incoming" => "ou=incoming,", - "server" => "ou=servers,ou=systems,", + "server" => get_ou('serverou'), "printer" => "ou=printers,ou=systems,", "phone" => "ou=phones,ou=systems,", "winworkstation" => get_winstations_ou(), @@ -972,7 +972,7 @@ class systems extends plugin } /* This array represents the combination between checkboxes and search filters */ - $objs = array( "ShowServers" => array("CLASS" => "goServer" ,"TREE" => "ou=servers,ou=systems," ), + $objs = array( "ShowServers" => array("CLASS" => "goServer" ,"TREE" => get_ou('serverou')), "ShowTerminals" => array("CLASS" => "gotoTerminal" ,"TREE" => "ou=terminals,ou=systems,"), "ShowPrinters" => array("CLASS" => "gotoPrinter" ,"TREE" => "ou=printers,ou=systems," ), "ShowDevices" => array("CLASS" => "ieee802Device" ,"TREE" => "ou=netdevices,ou=systems," ), diff --git a/gosa-core/plugins/admin/systems/services/nfs/class_servNfs.inc b/gosa-core/plugins/admin/systems/services/nfs/class_servNfs.inc index 1386de1fc..575686627 100644 --- a/gosa-core/plugins/admin/systems/services/nfs/class_servNfs.inc +++ b/gosa-core/plugins/admin/systems/services/nfs/class_servNfs.inc @@ -119,7 +119,7 @@ class servnfs extends plugin $smarty->assign("mount_checked", "checked"); } else { $tmp = split(",", $this->dn); - $clip = $tmp[0] . ",ou=servers,ou=systems,"; + $clip = $tmp[0] . ",".get_ou('serverou'); $mountsdn = "cn=mounts," . substr($this->dn, strlen($clip)); switch ($this->type) { case "netatalk" : { diff --git a/gosa-core/plugins/admin/systems/services/shares/class_goShareServer.inc b/gosa-core/plugins/admin/systems/services/shares/class_goShareServer.inc index 354d78037..105076c95 100644 --- a/gosa-core/plugins/admin/systems/services/shares/class_goShareServer.inc +++ b/gosa-core/plugins/admin/systems/services/shares/class_goShareServer.inc @@ -242,7 +242,7 @@ class goShareServer extends goService{ function process_mounts() { - $clip = "cn=" . $this->cn . ",ou=servers,ou=systems,"; + $clip = "cn=" . $this->cn . ",".get_ou('serverou'); $mountsdn = "cn=mounts," . substr($this->dn, strlen($clip)); $mounts = array( diff --git a/gosa-core/plugins/admin/systems/tabs_server.inc b/gosa-core/plugins/admin/systems/tabs_server.inc index 564e92588..608a02fd1 100644 --- a/gosa-core/plugins/admin/systems/tabs_server.inc +++ b/gosa-core/plugins/admin/systems/tabs_server.inc @@ -45,7 +45,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,ou=servers,ou=systems,".$baseobject->base; + $this->dn= "cn=$baseobject->cn,".get_ou('serverou').$baseobject->base; $baseobject->dn= $this->dn; foreach ($this->by_object as $key => $obj){ -- 2.30.2