From 1475738aaa5e01330a431f353f29584c7512ed87 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 2 Jan 2008 14:39:40 +0000 Subject: [PATCH] Replaced hard coded base prefixes with get_ou('name'). git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8179 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/functions.inc | 5 ++++ .../addons/gotomasses/class_target_list.inc | 2 +- .../plugins/admin/fai/class_faiManagement.inc | 4 +-- .../mimetypes/class_divListMimeTypes.inc | 4 +-- .../admin/mimetypes/class_mimetypeGeneric.inc | 4 +-- .../mimetypes/class_mimetypeManagement.inc | 6 ++--- .../admin/mimetypes/tabs_mimetypes.inc | 6 ++--- .../plugins/admin/ogroups/class_ogroup.inc | 18 ++++++------- .../admin/systems/class_componentGeneric.inc | 2 +- .../admin/systems/class_phoneGeneric.inc | 2 +- .../admin/systems/class_printGeneric.inc | 22 ++++++++-------- .../admin/systems/class_systemManagement.inc | 25 ++++++++++--------- .../admin/systems/class_terminalGeneric.inc | 2 +- .../admin/systems/class_terminalStartup.inc | 4 +-- .../admin/systems/class_winGeneric.inc | 2 +- .../systems/class_workstationGeneric.inc | 2 +- .../systems/class_workstationStartup.inc | 4 +-- .../plugins/admin/systems/tabs_component.inc | 2 +- .../plugins/admin/systems/tabs_phone.inc | 2 +- .../plugins/admin/systems/tabs_printers.inc | 2 +- .../plugins/admin/systems/tabs_terminal.inc | 2 +- .../admin/systems/tabs_workstation.inc | 2 +- .../environment/class_selectPrinterDialog.inc | 2 +- 23 files changed, 66 insertions(+), 60 deletions(-) diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc index c849c7bd6..7201467cc 100644 --- a/gosa-core/include/functions.inc +++ b/gosa-core/include/functions.inc @@ -1036,6 +1036,11 @@ function get_ou($name) $map = array( "applicationou" => "ou=apps,", "serverou" => "ou=servers,ou=systems,", + "terminalou" => "ou=terminals,ou=systems,", + "workstationou" => "ou=workstations,ou=systems,", + "printerou" => "ou=printers,ou=systems,", + "phoneou" => "ou=phones,ou=systems,", + "componentou" => "ou=netdevices,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 22c38b41f..088c208c7 100644 --- a/gosa-core/plugins/addons/gotomasses/class_target_list.inc +++ b/gosa-core/plugins/addons/gotomasses/class_target_list.inc @@ -255,7 +255,7 @@ class target_list extends MultiSelectWindow }else{ $res= get_list($filter, "ogroups", get_groups_ou().$base, array("cn","objectClass","ipHostNumber","description"), GL_SIZELIMIT ); - $res= array_merge($res,get_list($filter, "workstation", "ou=workstations,ou=systems,".$base, + $res= array_merge($res,get_list($filter, "workstation", get_ou('workstationou').$base, array("cn","objectClass","ipHostNumber","description"), GL_SIZELIMIT )); $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/admin/fai/class_faiManagement.inc b/gosa-core/plugins/admin/fai/class_faiManagement.inc index 048d5a00d..13873f954 100644 --- a/gosa-core/plugins/admin/fai/class_faiManagement.inc +++ b/gosa-core/plugins/admin/fai/class_faiManagement.inc @@ -558,8 +558,8 @@ class faiManagement extends plugin $appsrc = preg_replace("/ou=fai,ou=configs,ou=systems,/",get_ou('applicationou'),$baseToUse); $appdst = preg_replace("/ou=fai,ou=configs,ou=systems,/",get_ou('applicationou'),"ou=".$name.",".$baseToUse) ; - $mimesrc = preg_replace("/ou=fai,ou=configs,ou=systems,/","ou=mime,",$baseToUse); - $mimedst = preg_replace("/ou=fai,ou=configs,ou=systems,/","ou=mime,","ou=".$name.",".$baseToUse) ; + $mimesrc = preg_replace("/ou=fai,ou=configs,ou=systems,/",get_ou('mimetypeou'),$baseToUse); + $mimedst = preg_replace("/ou=fai,ou=configs,ou=systems,/",get_ou('mimetypeou'),"ou=".$name.",".$baseToUse) ; /* Check if source depeartments exist */ foreach(array($baseToUse,$appsrc,$mimesrc) as $dep){ diff --git a/gosa-core/plugins/admin/mimetypes/class_divListMimeTypes.inc b/gosa-core/plugins/admin/mimetypes/class_divListMimeTypes.inc index 1c8677f46..c9426f75c 100755 --- a/gosa-core/plugins/admin/mimetypes/class_divListMimeTypes.inc +++ b/gosa-core/plugins/admin/mimetypes/class_divListMimeTypes.inc @@ -26,7 +26,7 @@ class divListMimeTypes extends MultiSelectWindow MultiSelectWindow::MultiSelectWindow($config, "Mimetypes", "mimetypes"); /* initialize required attributes */ - $this->selectedRelease = "ou=mime,".$_SESSION['CurrentMainBase']; + $this->selectedRelease = get_ou('mimetypeou').$_SESSION['CurrentMainBase']; $this->parent = &$parent; $this->ui = get_userinfo(); $this->AvailableReleases= $this->parent->getReleases($this->selectedBase); @@ -143,7 +143,7 @@ class divListMimeTypes extends MultiSelectWindow /* Get acls */ $ui = get_userinfo(); - $acl = $ui->get_permissions("cn=dummy,ou=mimetypes,".$this->selectedBase,"mimetypes/mimetype"); + $acl = $ui->get_permissions("cn=dummy,".get_ou('mimetypeou').$this->selectedBase,"mimetypes/mimetype"); $acl_all = $ui->has_complete_category_acls($this->selectedBase,"mimetypes") ; diff --git a/gosa-core/plugins/admin/mimetypes/class_mimetypeGeneric.inc b/gosa-core/plugins/admin/mimetypes/class_mimetypeGeneric.inc index 38b695e98..5d90a5ecd 100644 --- a/gosa-core/plugins/admin/mimetypes/class_mimetypeGeneric.inc +++ b/gosa-core/plugins/admin/mimetypes/class_mimetypeGeneric.inc @@ -539,7 +539,7 @@ class mimetype extends plugin $ldap->cd($this->config->current["BASE"]); if($this->isReleaseMimeType && (isset($_SESSION['mimefilter']['release']))){ $baseDn = str_replace($this->config->current['BASE'],$this->base,$_SESSION['mimefilter']['release']); - $baseDn = preg_replace("/ou=mime,.*/","ou=mime,".$this->base,$_SESSION['mimefilter']['release']); + $baseDn = preg_replace("/".get_ou('mimetypeou').".*/",get_ou('mimetypeou').$this->base,$_SESSION['mimefilter']['release']); $ldap->ls("(&(objectClass=gotoMimeType)(cn=".$this->cn."))",$baseDn,array("cn")); if($ldap->count()){ $attrs = $ldap->fetch(); @@ -548,7 +548,7 @@ class mimetype extends plugin } } }else{ - $ldap->ls("(&(objectClass=gotoMimeType)(cn=".$this->cn."))","ou=mime,".$this->base,array("cn")); + $ldap->ls("(&(objectClass=gotoMimeType)(cn=".$this->cn."))",get_ou('mimetypeou').$this->base,array("cn")); if ($ldap->count()){ $attrs = $ldap->fetch(); if($this->dn != $attrs['dn']) { diff --git a/gosa-core/plugins/admin/mimetypes/class_mimetypeManagement.inc b/gosa-core/plugins/admin/mimetypes/class_mimetypeManagement.inc index 6fe119d92..4f8caed82 100755 --- a/gosa-core/plugins/admin/mimetypes/class_mimetypeManagement.inc +++ b/gosa-core/plugins/admin/mimetypes/class_mimetypeManagement.inc @@ -64,9 +64,9 @@ class mimetypeManagement extends plugin function getReleases($base) { $ldap = $this->config->get_ldap_link(); - $dn = "ou=mime,".$base; + $dn = get_ou('mimetypeou').$base; $ret = array(); - $ret ["ou=mime,".$base] = "/"; + $ret [get_ou('mimetypeou').$base] = "/"; $ldap->cd($dn); $ldap->search("objectClass=organizationalUnit",array("ou")); @@ -521,7 +521,7 @@ class mimetypeManagement extends plugin $Flags |= GL_SUBSEARCH; }else{ if(!$this->enableReleaseManagement){ - $use_base ="ou=mime,".$use_base; + $use_base = get_ou('mimetypeou').$use_base; } } diff --git a/gosa-core/plugins/admin/mimetypes/tabs_mimetypes.inc b/gosa-core/plugins/admin/mimetypes/tabs_mimetypes.inc index 6c1cd34c4..e8f53d32e 100755 --- a/gosa-core/plugins/admin/mimetypes/tabs_mimetypes.inc +++ b/gosa-core/plugins/admin/mimetypes/tabs_mimetypes.inc @@ -14,7 +14,7 @@ class mimetabs extends tabs function set_release($newRelease) { - $this->Release= preg_replace('/,ou=mime,.*$/', '', $newRelease); + $this->Release= preg_replace('/,'.get_ou('mimetypeou').'.*$/', '', $newRelease); if ($this->Release != ""){ $this->Release= ",".$this->Release; } @@ -30,12 +30,12 @@ class mimetabs extends tabs if((!empty($tmp)) && (isset($_SESSION['mimefilter']['release']))){ if(!$baseobject->isReleaseMimeType){ - $new_dn= "cn=".$baseobject->cn.",ou=mime,".$baseobject->base; + $new_dn= "cn=".$baseobject->cn.",".get_ou('mimetypeou').$baseobject->base; }else{ $new_dn ="cn=".$baseobject->cn.",".$_SESSION['mimefilter']['release']; } }else{ - $new_dn= "cn=".$baseobject->cn.",ou=mime,".$baseobject->base; + $new_dn= "cn=".$baseobject->cn.",".get_ou('mimetypeou').$baseobject->base; } /* Move group? */ diff --git a/gosa-core/plugins/admin/ogroups/class_ogroup.inc b/gosa-core/plugins/admin/ogroups/class_ogroup.inc index bec6b25a6..ffc8674db 100644 --- a/gosa-core/plugins/admin/ogroups/class_ogroup.inc +++ b/gosa-core/plugins/admin/ogroups/class_ogroup.inc @@ -385,15 +385,15 @@ class ogroup extends plugin Generate Filter ###########*/ - $p_f= array("accounts" => array("CLASS"=>"gosaAccount" ,"DN"=> get_people_ou() ,"ACL" => "users"), - "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"=> 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"), - "phones" => array("CLASS"=>"goFonHardware" ,"DN"=> "ou=phones,ou=systems," ,"ACL" => "phone")); + $p_f= array("accounts" => array("CLASS"=>"gosaAccount" ,"DN"=> get_people_ou() ,"ACL" => "users"), + "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"=> get_ou('serverou') ,"ACL" => "server"), + "workstations" => array("CLASS"=>"gotoWorkstation","DN"=> get_ou('workstationou') ,"ACL" => "workstation"), + "terminals" => array("CLASS"=>"gotoTerminal" ,"DN"=> get_ou('terminalou') ,"ACL" => "terminal"), + "printers" => array("CLASS"=>"gotoPrinter" ,"DN"=> get_ou('printerou') ,"ACL" => "printer"), + "phones" => array("CLASS"=>"goFonHardware" ,"DN"=> get_ou('phoneou') ,"ACL" => "phone")); /*########### diff --git a/gosa-core/plugins/admin/systems/class_componentGeneric.inc b/gosa-core/plugins/admin/systems/class_componentGeneric.inc index 8a65bdd8a..4f2657a69 100644 --- a/gosa-core/plugins/admin/systems/class_componentGeneric.inc +++ b/gosa-core/plugins/admin/systems/class_componentGeneric.inc @@ -180,7 +180,7 @@ class componentGeneric extends plugin $message= plugin::check(); $message= array_merge($message,$this->netConfigDNS->check()); - $this->dn= "cn=".$this->cn.",ou=netdevices,ou=systems,".$this->base; + $this->dn= "cn=".$this->cn.",".get_ou('componentou').$this->base; if ($this->cn == "" ){ $message[]= _("The required field 'Component name' is not set."); diff --git a/gosa-core/plugins/admin/systems/class_phoneGeneric.inc b/gosa-core/plugins/admin/systems/class_phoneGeneric.inc index f169c0ec7..e3e279c36 100644 --- a/gosa-core/plugins/admin/systems/class_phoneGeneric.inc +++ b/gosa-core/plugins/admin/systems/class_phoneGeneric.inc @@ -323,7 +323,7 @@ class phoneGeneric extends plugin $message= plugin::check(); $message= array_merge($message, $this->netConfigDNS->check()); - $this->dn= "cn=".$this->cn.",ou=phones,ou=systems,".$this->base; + $this->dn= "cn=".$this->cn.",".get_ou('phoneou').$this->base; /* To check for valid ip*/ if($this->netConfigDNS->ipHostNumber == ""){ diff --git a/gosa-core/plugins/admin/systems/class_printGeneric.inc b/gosa-core/plugins/admin/systems/class_printGeneric.inc index 54092c670..585d5e16a 100644 --- a/gosa-core/plugins/admin/systems/class_printGeneric.inc +++ b/gosa-core/plugins/admin/systems/class_printGeneric.inc @@ -66,11 +66,11 @@ class printgeneric extends plugin /* Update dn, to ensure storing as printer instead of WS / terminal */ if(preg_match("/Terminal/i",$this->BelongsTo) || preg_match("/TerminalTemplate/i",$this->BelongsTo)){ - $this->dn= preg_replace("/ou=terminals,/","ou=printers,",$this->dn); + $this->dn= preg_replace("/".normalizePreg(get_ou('terminalou'))."/",get_ou('printerou'),$this->dn); } if(preg_match("/Workstation/i",$this->BelongsTo) || preg_match("/WorkstationTemplate/i",$this->BelongsTo)){ - $this->dn= preg_replace("/ou=workstations,/","ou=printers,",$this->dn); + $this->dn= preg_replace("/".normalizePreg(get_ou('workstationou'))."/",get_ou('printerou'),$this->dn); } $this->orig_dn = $this->dn; @@ -102,7 +102,7 @@ class printgeneric extends plugin if(preg_match("/ou=incoming,/",$this->dn)){ $this->base= preg_replace("/ou=incoming,/","",dn2base($this->dn)); }else{ - $this->base= preg_replace("/ou=printers,ou=systems,/","",dn2base($this->dn)); + $this->base= preg_replace("/".normalizePreg(get_ou('printerou')).",/","",dn2base($this->dn)); } if(!isset($this->config->idepartments[$this->base])){ @@ -222,11 +222,11 @@ class printgeneric extends plugin /* Update dn, to ensure storing as printer instead of WS / terminal */ if(preg_match("/terminal/i",$this->BelongsTo)){ - $this->dn= preg_replace("/ou=terminals,/","ou=printers,",$this->dn); + $this->dn= preg_replace("/".normalizePreg(get_ou('terminalou'))."/",get_ou('printerou'),$this->dn); } if(preg_match("/workstation/i",$this->BelongsTo)){ - $this->dn= preg_replace("/ou=workstations,/","ou=printers,",$this->dn); + $this->dn= preg_replace("/".normalizePreg(get_ou('workstationou'))."/",get_ou('printerou'),$this->dn); } /* Detect if this is a valid printer account; @@ -571,11 +571,11 @@ class printgeneric extends plugin /* Update dn, to ensure storing as printer instead of WS / terminal */ if(preg_match("/terminal/i",$this->BelongsTo)){ - $this->dn= preg_replace("/ou=terminals,/","ou=printers,",$this->dn); + $this->dn= preg_replace("/".normalizePreg(get_ou('terminalou')).",/",get_ou('printerou'),$this->dn); } if(preg_match("/workstation/i",$this->BelongsTo)){ - $this->dn= preg_replace("/ou=workstations,/","ou=printers,",$this->dn); + $this->dn= preg_replace("/".normalizePreg(get_ou('workstationou'))."/",get_ou('printerou'),$this->dn); } /* Check if this dn points to a printer, to avoid deleting something else */ @@ -663,7 +663,7 @@ class printgeneric extends plugin } } - $dn= "cn=".$this->cn.",ou=printers,ou=systems,".$this->base; + $dn= "cn=".$this->cn.get_ou('printerou').",".$this->base; /* must: cn */ if(($this->BelongsTo == "Printer") && (empty($this->cn))){ @@ -684,7 +684,7 @@ class printgeneric extends plugin if (($this->orig_dn != $dn)&&( preg_match("/printer/i",$this->BelongsTo))){ $ldap= $this->config->get_ldap_link(); $ldap->cd ($this->base); - $ldap->ls("(cn=".$this->cn.")","ou=printers,ou=systems,".$this->base, array("cn")); + $ldap->ls("(cn=".$this->cn.")",get_ou('printerou').$this->base, array("cn")); if ($ldap->count() != 0){ while ($attrs= $ldap->fetch()){ if(preg_match("/cn=dhcp,/",$attrs['dn'])){ @@ -708,11 +708,11 @@ class printgeneric extends plugin /* Update dn, to ensure storing as printer instead of WS / terminal */ if(preg_match("/terminal/i",$this->BelongsTo)){ - $this->dn= preg_replace("/ou=terminals,/","ou=printers,",$this->dn); + $this->dn= preg_replace("/".normalizePreg(get_ou('terminalou')).",/",get_ou('printerou'),$this->dn); } if(preg_match("/workstation/i",$this->BelongsTo)){ - $this->dn= preg_replace("/ou=workstations,/","ou=printers,",$this->dn); + $this->dn= preg_replace("/".normalizePreg(get_ou('workstationou'))."/",get_ou('printerou'),$this->dn); } if(!$this->is_account) return; diff --git a/gosa-core/plugins/admin/systems/class_systemManagement.inc b/gosa-core/plugins/admin/systems/class_systemManagement.inc index 3f2c49603..5e9b28605 100644 --- a/gosa-core/plugins/admin/systems/class_systemManagement.inc +++ b/gosa-core/plugins/admin/systems/class_systemManagement.inc @@ -896,14 +896,14 @@ class systems extends plugin /* Check acls, if we are not allowed to create and write each plugin tab, skip this object */ $tabs = array( - "terminal" => "ou=terminals,ou=systems,", - "workstation" => "ou=workstations,ou=systems,", + "terminal" => get_ou('terminalou'), + "workstation" => get_ou('workstationou'), "incoming" => "ou=incoming,", - "server" => get_ou('serverou'), - "printer" => "ou=printers,ou=systems,", - "phone" => "ou=phones,ou=systems,", + "server" => get_ou('serverou'), + "printer" => get_ou('printerou'), + "phone" => get_ou('phoneou'), "winworkstation" => get_winstations_ou(), - "component" => "ou=netdevices,ou=systems," + "component" => get_ou('componentou') ); foreach($tabs as $acl_cat => $dn){ @@ -972,12 +972,13 @@ class systems extends plugin } /* This array represents the combination between checkboxes and search filters */ - $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," ), - "ShowPhones" => array("CLASS" => "goFonHardware" ,"TREE" => "ou=phones,ou=systems," ), - "ShowWorkstations" => array("CLASS" => "gotoWorkstation" ,"TREE" => "ou=workstations,ou=systems," ), + $objs = array( + "ShowServers" => array("CLASS" => "goServer" ,"TREE" => get_ou('serverou')), + "ShowTerminals" => array("CLASS" => "gotoTerminal" ,"TREE" => get_ou('terminalou')), + "ShowPrinters" => array("CLASS" => "gotoPrinter" ,"TREE" => get_ou('printerou')), + "ShowDevices" => array("CLASS" => "ieee802Device" ,"TREE" => get_ou('componentou')), + "ShowPhones" => array("CLASS" => "goFonHardware" ,"TREE" => get_ou('phoneou')), + "ShowWorkstations" => array("CLASS" => "gotoWorkstation" ,"TREE" => get_ou('workstationou')), "ShowWinWorkstations"=> array("CLASS" => $samba ,"TREE" => get_winstations_ou() )); /* Include the 'Display Systems of user' attribute */ diff --git a/gosa-core/plugins/admin/systems/class_terminalGeneric.inc b/gosa-core/plugins/admin/systems/class_terminalGeneric.inc index be12d590e..ac43e3500 100644 --- a/gosa-core/plugins/admin/systems/class_terminalGeneric.inc +++ b/gosa-core/plugins/admin/systems/class_terminalGeneric.inc @@ -448,7 +448,7 @@ class termgeneric extends plugin } /* Permissions for that base? */ - $this->dn= "cn=".$this->cn.",ou=terminals,ou=systems,".$this->base; + $this->dn= "cn=".$this->cn.",".get_ou('terminalou').$this->base; if ($this->cn == ""){ $message[]= _("The required field 'Terminal name' is not set."); diff --git a/gosa-core/plugins/admin/systems/class_terminalStartup.inc b/gosa-core/plugins/admin/systems/class_terminalStartup.inc index 0174459e3..6e71b242e 100644 --- a/gosa-core/plugins/admin/systems/class_terminalStartup.inc +++ b/gosa-core/plugins/admin/systems/class_terminalStartup.inc @@ -391,7 +391,7 @@ class termstartup extends plugin $ldap= $this->config->get_ldap_link(); /* Strip relevant part from dn, keep trailing ',' */ - $tmp= preg_replace("/^cn=[^,]+,ou=terminals,ou=systems,/i", "", $this->dn); + $tmp= preg_replace("/^cn=[^,]+,".get_ou('terminalou')."/i", "", $this->dn); $tmp= preg_replace("/".$this->config->current['BASE']."$/i", "", $tmp); /* Walk from top to base and try to load default values for @@ -399,7 +399,7 @@ class termstartup extends plugin while (TRUE){ $tmp= preg_replace ("/^[^,]+,/", "", $tmp); - $ldap->cat("cn=default,ou=terminals,ou=systems,$tmp". + $ldap->cat("cn=default,".get_ou('terminalou').$tmp. $this->config->current['BASE'], array('gotoTerminalPath')); $attrs= $ldap->fetch(); if (isset($attrs['gotoTerminalPath'])){ diff --git a/gosa-core/plugins/admin/systems/class_winGeneric.inc b/gosa-core/plugins/admin/systems/class_winGeneric.inc index 8a15e930c..8e2126611 100644 --- a/gosa-core/plugins/admin/systems/class_winGeneric.inc +++ b/gosa-core/plugins/admin/systems/class_winGeneric.inc @@ -198,7 +198,7 @@ class wingeneric 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=netdevices,ou=systems,".$this->base; + $this->dn= "cn=".$this->cn.",".get_ou('componentou').$this->base; /* Set new acl base */ if($this->dn == "new") { diff --git a/gosa-core/plugins/admin/systems/class_workstationGeneric.inc b/gosa-core/plugins/admin/systems/class_workstationGeneric.inc index 14641c0b7..73333c4d1 100644 --- a/gosa-core/plugins/admin/systems/class_workstationGeneric.inc +++ b/gosa-core/plugins/admin/systems/class_workstationGeneric.inc @@ -429,7 +429,7 @@ class workgeneric extends plugin $message= array_merge($message, $this->netConfigDNS->check()); } - $this->dn= "cn=".$this->cn.",ou=workstations,ou=systems,".$this->base; + $this->dn= "cn=".$this->cn.",".get_ou('workstationou').$this->base; if ($this->cn == ""){ $message[]= _("The required field 'Workstation name' is not set."); diff --git a/gosa-core/plugins/admin/systems/class_workstationStartup.inc b/gosa-core/plugins/admin/systems/class_workstationStartup.inc index 8e9ed5240..0e06a56f3 100644 --- a/gosa-core/plugins/admin/systems/class_workstationStartup.inc +++ b/gosa-core/plugins/admin/systems/class_workstationStartup.inc @@ -1109,7 +1109,7 @@ class workstartup extends plugin $ldap= $this->config->get_ldap_link(); /* Strip relevant part from dn, keep trailing ',' */ - $tmp= preg_replace("/^cn=[^,]+,ou=terminals,ou=systems,/i", "", $this->dn); + $tmp= preg_replace("/^cn=[^,]+,".get_ou('terminalou')."/i", "", $this->dn); $tmp= preg_replace("/".$this->config->current['BASE']."$/i", "", $tmp); /* Walk from top to base and try to load default values for @@ -1117,7 +1117,7 @@ class workstartup extends plugin while (TRUE){ $tmp= preg_replace ("/^[^,]+,/", "", $tmp); - $ldap->cat("cn=default,ou=terminals,ou=systems,$tmp". + $ldap->cat("cn=default,".get_ou('terminalou').$tmp. $this->config->current['BASE'], array('gotoTerminalPath')); $attrs= $ldap->fetch(); if (isset($attrs['gotoTerminalPath'])){ diff --git a/gosa-core/plugins/admin/systems/tabs_component.inc b/gosa-core/plugins/admin/systems/tabs_component.inc index 941203e24..c195da845 100644 --- a/gosa-core/plugins/admin/systems/tabs_component.inc +++ b/gosa-core/plugins/admin/systems/tabs_component.inc @@ -22,7 +22,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,ou=netdevices,ou=systems,".$baseobject->base; + $this->dn= "cn=$baseobject->cn,".get_ou('componentou').$baseobject->base; $baseobject->dn= $this->dn; foreach ($this->by_object as $key => $obj){ diff --git a/gosa-core/plugins/admin/systems/tabs_phone.inc b/gosa-core/plugins/admin/systems/tabs_phone.inc index 13d5ac3c7..3967b4230 100644 --- a/gosa-core/plugins/admin/systems/tabs_phone.inc +++ b/gosa-core/plugins/admin/systems/tabs_phone.inc @@ -22,7 +22,7 @@ class phonetabs extends tabs /* Check for new 'dn', in order to propagate the 'dn' to all plugins */ $baseobject= $this->by_object['phoneGeneric']; - $this->dn= "cn=$baseobject->cn,ou=phones,ou=systems,".$baseobject->base; + $this->dn= "cn=$baseobject->cn,".get_ou('phoneou').$baseobject->base; $baseobject->dn= $this->dn; foreach ($this->by_object as $key => $obj){ diff --git a/gosa-core/plugins/admin/systems/tabs_printers.inc b/gosa-core/plugins/admin/systems/tabs_printers.inc index 92963d6b0..3142146b0 100644 --- a/gosa-core/plugins/admin/systems/tabs_printers.inc +++ b/gosa-core/plugins/admin/systems/tabs_printers.inc @@ -46,7 +46,7 @@ class printtabs extends tabs /* Check for new 'dn', in order to propagate the 'dn' to all plugins */ $baseobject= $this->by_object['printgeneric']; - $this->dn= "cn=$baseobject->cn,ou=printers,ou=systems,".$baseobject->base; + $this->dn= "cn=$baseobject->cn,".get_ou('printerou').$baseobject->base; $baseobject->dn= $this->dn; foreach ($this->by_object as $key => $obj){ diff --git a/gosa-core/plugins/admin/systems/tabs_terminal.inc b/gosa-core/plugins/admin/systems/tabs_terminal.inc index 3a3b77486..9f602e370 100644 --- a/gosa-core/plugins/admin/systems/tabs_terminal.inc +++ b/gosa-core/plugins/admin/systems/tabs_terminal.inc @@ -55,7 +55,7 @@ class termtabs extends tabs /* Check for new 'dn', in order to propagate the 'dn' to all plugins */ $baseobject= $this->by_object['termgeneric']; - $this->dn= "cn=".$baseobject->cn.",ou=terminals,ou=systems,".$baseobject->base; + $this->dn= "cn=".$baseobject->cn.",".get_ou('terminalou').$baseobject->base; $baseobject->dn= $this->dn; foreach ($this->by_object as $key => $obj){ diff --git a/gosa-core/plugins/admin/systems/tabs_workstation.inc b/gosa-core/plugins/admin/systems/tabs_workstation.inc index 6c34fd1e8..5660acb29 100644 --- a/gosa-core/plugins/admin/systems/tabs_workstation.inc +++ b/gosa-core/plugins/admin/systems/tabs_workstation.inc @@ -52,7 +52,7 @@ class worktabs extends tabs /* Check for new 'dn', in order to propagate the 'dn' to all plugins */ $baseobject= $this->by_object['workgeneric']; - $this->dn= "cn=".$baseobject->cn.",ou=workstations,ou=systems,".$baseobject->base; + $this->dn= "cn=".$baseobject->cn.",".get_ou('workstationou').$baseobject->base; $baseobject->dn= $this->dn; foreach ($this->by_object as $key => $obj){ diff --git a/gosa-core/plugins/personal/environment/class_selectPrinterDialog.inc b/gosa-core/plugins/personal/environment/class_selectPrinterDialog.inc index 5e1b8a3d2..b1ebc4960 100644 --- a/gosa-core/plugins/personal/environment/class_selectPrinterDialog.inc +++ b/gosa-core/plugins/personal/environment/class_selectPrinterDialog.inc @@ -134,7 +134,7 @@ class selectPrinterDialog extends plugin if ($this->subtreesearch){ $res = get_list($filter,$module,$base,$attrs, GL_SIZELIMIT | GL_SUBSEARCH); } else { - $base= "ou=printers,ou=systems,".$base; + $base= get_ou('printerou').$base; $res = get_list($filter,$module,$base,$attrs, GL_SIZELIMIT); } -- 2.30.2