Code

Replaced hard coded base prefixes with get_ou('name').
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 2 Jan 2008 14:39:40 +0000 (14:39 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 2 Jan 2008 14:39:40 +0000 (14:39 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8179 594d385d-05f5-0310-b6e9-bd551577e9d8

23 files changed:
gosa-core/include/functions.inc
gosa-core/plugins/addons/gotomasses/class_target_list.inc
gosa-core/plugins/admin/fai/class_faiManagement.inc
gosa-core/plugins/admin/mimetypes/class_divListMimeTypes.inc
gosa-core/plugins/admin/mimetypes/class_mimetypeGeneric.inc
gosa-core/plugins/admin/mimetypes/class_mimetypeManagement.inc
gosa-core/plugins/admin/mimetypes/tabs_mimetypes.inc
gosa-core/plugins/admin/ogroups/class_ogroup.inc
gosa-core/plugins/admin/systems/class_componentGeneric.inc
gosa-core/plugins/admin/systems/class_phoneGeneric.inc
gosa-core/plugins/admin/systems/class_printGeneric.inc
gosa-core/plugins/admin/systems/class_systemManagement.inc
gosa-core/plugins/admin/systems/class_terminalGeneric.inc
gosa-core/plugins/admin/systems/class_terminalStartup.inc
gosa-core/plugins/admin/systems/class_winGeneric.inc
gosa-core/plugins/admin/systems/class_workstationGeneric.inc
gosa-core/plugins/admin/systems/class_workstationStartup.inc
gosa-core/plugins/admin/systems/tabs_component.inc
gosa-core/plugins/admin/systems/tabs_phone.inc
gosa-core/plugins/admin/systems/tabs_printers.inc
gosa-core/plugins/admin/systems/tabs_terminal.inc
gosa-core/plugins/admin/systems/tabs_workstation.inc
gosa-core/plugins/personal/environment/class_selectPrinterDialog.inc

index c849c7bd6a29edbd2c10723bc39a56287beda1c9..7201467ccb2303a8a6b4e33089b854054ae50ae0 100644 (file)
@@ -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... */
index 22c38b41ffbc18c71662e9c8825c5e927742b92d..088c208c7b249855e0efdcca8458f907d614d845 100644 (file)
@@ -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 ));
index 048d5a00db9176c1c6da8c72c9b7aaf002b20ca1..13873f9540d258e6853317b8564a2cc5b2cf4a5c 100644 (file)
@@ -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){
index 1c8677f463136f5d5a050cffa5057f77d6a6506c..c9426f75cad2abaa0a5f1c8fc4a314852a09420b 100755 (executable)
@@ -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") ;
 
 
index 38b695e9869f151644b115c56e4b790675b329dc..5d90a5ecdc3207f8fdea7711e3cd75d7f398a739 100644 (file)
@@ -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']) {
index 6fe119d92cb2075f59889d62177bcbbd331fa851..4f8caed8219eeafe6ab6e38cc8041ea7f4209028 100755 (executable)
@@ -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;
       }
     }
   
index 6c1cd34c4d6615b418d87bed3e2336fd7ca0de02..e8f53d32ec3e05730b095044bf64a1bedf113f5a 100755 (executable)
@@ -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? */
index bec6b25a629c5cb0cdb4f7a439f9db530111d6bd..ffc8674db8aab336ae17fd8304aee2bd3b53a537 100644 (file)
@@ -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"));
 
 
     /*###########
index 8a65bdd8a826160ee7ec1c21920777a53986529a..4f2657a69aefe9e410c4fd19aa35194622ee5d65 100644 (file)
@@ -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.");
index f169c0ec7928c4e589c4b0b58315622bcd1613fb..e3e279c368129ebdd202076f5ae8e60605c4aaa9 100644 (file)
@@ -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 == ""){
index 54092c670e23f287bf71cefb8b45fc6b53d18ccd..585d5e16ae89d81446eef6c474b374ef88347e7e 100644 (file)
@@ -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;
index 3f2c496034e10fb16b7f490d7e4ed6bd0ea62a2d..5e9b28605b8f2ae507873e4522e5cc954cf5c222 100644 (file)
@@ -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 */ 
index be12d590e30845225be7171cf292e06d4d00338f..ac43e3500ddeea41ef79e9e87bc6fbdac762ddb4 100644 (file)
@@ -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.");
index 0174459e3515ababdc4565ea6221c2a85219b9e0..6e71b242ed26913eebc5280ac962ba39d9e3b75c 100644 (file)
@@ -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'])){
index 8a15e930ce0c34b7e4e2d8ecf04257237ac60dd3..8e21266117cf158dfb1e08887031dc2bb10f90ef 100644 (file)
@@ -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") {
index 14641c0b7617a239781a3e90249338d17245ec3b..73333c4d1413ff82a1dd441fa986b7ad063ef528 100644 (file)
@@ -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.");
index 8e9ed52409f43e3e3902f02a7e6929ea577efa83..0e06a56f32309fd3ee39c9ab68eea0ed14af0624 100644 (file)
@@ -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'])){
index 941203e24aa8ef958e81f8bfd95dfdc83aaf69ad..c195da845b7edf901ac19c501211c158d2880d4c 100644 (file)
@@ -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){
index 13d5ac3c7f125970c8669fecc49f10c6b5e80428..3967b423054df2af75303744a7560b111bc13fd1 100644 (file)
@@ -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){
index 92963d6b01f430715fe9a63851ef06ea13e9fef6..3142146b0765f01adfde8188af3ec52d027a2ce3 100644 (file)
@@ -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){
index 3a3b77486d051d8344048e1af21bdd46519cbc5f..9f602e3709a1a1f461b43f365df74b1c9ee0abcc 100644 (file)
@@ -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){
index 6c34fd1e8d8f2984d04e81694b69d644e56d8cf6..5660acb29ebfb744805739d32ecc951860cf66a6 100644 (file)
@@ -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){
index 5e1b8a3d26dcb8a1e92dd15673e6315c8bce1f47..b1ebc49602c8e82bfab3c3041e95d12a5dc7fb95 100644 (file)
@@ -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);
     }