Code

Replaced hard coded department links with get_ou() calls
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 3 Jan 2008 07:40:07 +0000 (07:40 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 3 Jan 2008 07:40:07 +0000 (07:40 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8187 594d385d-05f5-0310-b6e9-bd551577e9d8

31 files changed:
gosa-core/html/getxls.php
gosa-core/include/functions.inc
gosa-core/include/functions_FAI.inc
gosa-core/plugins/addons/ldapmanager/class_exportxls.inc
gosa-core/plugins/admin/acl/class_aclManagement.inc
gosa-core/plugins/admin/acl/tabs_acl_role.inc
gosa-core/plugins/admin/fai/class_askClassName.inc
gosa-core/plugins/admin/fai/class_faiManagement.inc
gosa-core/plugins/admin/fai/class_faiPackage.inc
gosa-core/plugins/admin/fai/class_faiProfile.inc
gosa-core/plugins/admin/fai/class_faiProfileEntry.inc
gosa-core/plugins/admin/fai/class_faiSummaryTab.inc
gosa-core/plugins/admin/fai/tabsHook.inc
gosa-core/plugins/admin/fai/tabsPackage.inc
gosa-core/plugins/admin/fai/tabsPartition.inc
gosa-core/plugins/admin/fai/tabsProfile.inc
gosa-core/plugins/admin/fai/tabsScript.inc
gosa-core/plugins/admin/fai/tabsTemplate.inc
gosa-core/plugins/admin/fai/tabsVariable.inc
gosa-core/plugins/admin/groups/class_groupGeneric.inc
gosa-core/plugins/admin/systems/class_printGeneric.inc
gosa-core/plugins/admin/systems/class_servGeneric.inc
gosa-core/plugins/admin/systems/class_systemManagement.inc
gosa-core/plugins/admin/systems/class_terminalGeneric.inc
gosa-core/plugins/admin/systems/class_workstationGeneric.inc
gosa-core/plugins/admin/systems/class_workstationStartup.inc
gosa-core/plugins/gofax/blocklists/class_blocklistGeneric.inc
gosa-core/plugins/gofax/blocklists/class_blocklistManagement.inc
gosa-core/plugins/gofax/blocklists/tabs_blocklist.inc
gosa-core/plugins/gofon/conference/class_phoneConferenceGeneric.inc
gosa-core/plugins/gofon/conference/tabs_conference.inc

index 5c2f13a072c54ec1ba3783f10a9c6258c9a26cd2..a9427a3ca8c7c39bd9bf94287e70d2412820f507 100644 (file)
@@ -80,7 +80,7 @@ function dump_ldap ($mode= 0)
       /* PEOPLE 
           Get all peoples from this $dn 
           and put them into the xls work sheet */
-      case "ou=people," : 
+      case get_people_ou() : 
 
         $user    =  $ldap->gen_xls($dn,"(objectClass=*)",array("uid","dateOfBirth","gender","givenName","preferredLanguage"));
         $intitul =  array(_("Birthday").":", _("Sex").":", _("Surname")."/"._("Given name").":",_("Language").":");
@@ -114,7 +114,7 @@ function dump_ldap ($mode= 0)
       /* GROUPS 
           Get all groups from th $dn 
           and put them into the xls work sheet */
-      case "ou=groups,"
+      case get_groups_ou()
 
         /* Get group data */
         $groups    = $ldap->gen_xls($dn,"(objectClass=*)",array("cn","memberUid"),TRUE,1);
@@ -150,7 +150,7 @@ function dump_ldap ($mode= 0)
      /* SYSTEMS 
         Get all systems from th $dn
         and put them into the xls work sheet */
-     case "ou=systems,"
+     case get_ou('systemsou')
 
        $name_section=_("Servers");
        $computers= $ldap->gen_xls($dn,"(&(objectClass=*)(cn=*))",array("cn","description","uid"));
@@ -277,10 +277,10 @@ function dump_ldap ($mode= 0)
     $dn =  base64_decode($_GET['dn']);
 
     //data about users
-    $user= $ldap->gen_xls("ou=people,".$dn,"(objectClass=*)",array("uid","dateOfBirth","gender","givenName","preferredLanguage"));
+    $user= $ldap->gen_xls( get_people_ou().$dn,"(objectClass=*)",array("uid","dateOfBirth","gender","givenName","preferredLanguage"));
     $user_intitul=array(_("Day of birth").":",_("Sex").":",_("Surname")."/"._("Given name").":",_("Language").":");
     //data about groups
-    $groups= $ldap->gen_xls("ou=groups,".$dn,"(objectClass=*)",array("cn","memberUid"),TRUE,1);
+    $groups= $ldap->gen_xls(get_groups_ou().$dn,"(objectClass=*)",array("cn","memberUid"),TRUE,1);
     $groups_intitul=array(_("Members").":");
     //data about computers
     $computers= $ldap->gen_xls("ou=computers,".$dn,"(objectClass=*)",array("cn","description","uid"));
index 131c4a282d9ac9955d7855515c86a6ab2020ff5f..77ccf4d134300976211759b3f7378fecfeb3ca3a 100644 (file)
@@ -1034,14 +1034,28 @@ function get_ou($name)
   global $config;
 
   $map = array( "applicationou" => "ou=apps,",
+                "systemsou"     => "ou=systems,",
                 "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,",
+                "blocklistou"   => "ou=gofax,ou=systems,",
+                "incomingou"    => "ou=incoming,",
+                "aclroleou"     => "ou=aclroles,",
                 "macroou"       => "ou=macros,ou=asterisk,ou=configs,ou=systems,",
                 "conferenceou"  => "ou=conferences,ou=asterisk,ou=configs,ou=systems,",
+
+                "faiou"         => "ou=fai,ou=configs,ou=systems,",
+                "faiscriptou"   => "ou=scripts,",
+                "faihookou"     => "ou=hooks,",
+                "faitemplateou" => "ou=templates,",
+                "faivariableou" => "ou=variables,",
+                "faiprofileou"  => "ou=profiles,",
+                "faipackageou"  => "ou=packages,",
+                "faipartitionou"=> "ou=disk,",
+
                 "deviceou"      => "ou=devices,",
                 "mimetypeou"    => "ou=mime,");
 
@@ -1052,6 +1066,7 @@ function get_ou($name)
     $ou = $map[$name];
     return($ou);
   } else {
+    trigger_error("No department mapping found for type ".$name);
     return "";
   }
  
index 26c0a572659f10287d156965b74bdb68579e2095..d01cfbc7e36a1302620bf4b962aac0f1a5af63a6 100644 (file)
@@ -105,8 +105,8 @@ function get_all_releases_from_base($dn,$appendedName=false)
 {
   global $config;
     
-  if(!preg_match("/ou=fai,ou=configs,ou=systems,/",$dn)){
-    $base = "ou=fai,ou=configs,ou=systems,".$dn;
+  if(!preg_match("/".normalizePreg(get_ou('faiou'))."/",$dn)){
+    $base = get_ou('faiou').$dn;
   }else{
     $base = $dn;
   }
@@ -117,7 +117,7 @@ function get_all_releases_from_base($dn,$appendedName=false)
   $ldap->search("(objectClass=FAIbranch)",array("ou","dn"));
   while($attrs = $ldap->fetch()){
     if($appendedName){
-      $res[$attrs['dn']] = convert_department_dn(preg_replace("/,ou=fai,ou=configs,ou=system.*$/","",$attrs['dn']));
+      $res[$attrs['dn']] = convert_department_dn(preg_replace("/,".normalizePreg(get_ou('faiou')).".*$/","",$attrs['dn']));
     }else{
       $res[$attrs['dn']] = $attrs['ou'][0];
     }
index 2f392faeafddeb310ab96a9aad1aded3657d40a1..90bab709acfa37ee7fea5f7c859ccb4359628b61 100644 (file)
@@ -76,8 +76,8 @@ class xlsexport extends plugin
     }
     $smarty->assign("deplist", $bases);
     $smarty->assign("choicelist",array( get_people_ou()             =>"users" ,
-                                        "ou=groups,"                =>"groups" ,
-                                        "ou=systems,"               =>"computers",
+                                        get_groups_ou()             =>"groups" ,
+                                        get_ou('systemsou')         =>"computers",
                                         get_ou('serverou')          =>"servers",
                                         "dc=addressbook,"           =>"addressbook"));
 
index d8854020652cd24dc937ac84e36886814b575afd..7a1b2ab2b2895bab6bd00b6f4aa156b161e0dc13 100644 (file)
@@ -468,7 +468,7 @@ class aclManagement extends plugin
     /* Fetch following structures, this will be used if !$SubSearch */
     $fetch_this = array(
       "ME"      => array("TYPE" => "cat"    , "FLAGS" => GL_SIZELIMIT                ,"BASE"=>""),
-      "SYSTEMS" => array("TYPE" => "search" , "FLAGS" => GL_SIZELIMIT | GL_SUBSEARCH ,"BASE"=>"ou=systems,"),
+      "SYSTEMS" => array("TYPE" => "search" , "FLAGS" => GL_SIZELIMIT | GL_SUBSEARCH ,"BASE"=>get_ou('systemsou')),
       "APPS"    => array("TYPE" => "search" , "FLAGS" => GL_SIZELIMIT | GL_SUBSEARCH ,"BASE"=>get_ou('applicationou')),
       "PEOPLE"  => array("TYPE" => "search" , "FLAGS" => GL_SIZELIMIT | GL_SUBSEARCH ,"BASE"=>get_people_ou()),
       "GROUPS"  => array("TYPE" => "search" , "FLAGS" => GL_SIZELIMIT | GL_SUBSEARCH ,"BASE"=>get_groups_ou()));
@@ -490,7 +490,7 @@ class aclManagement extends plugin
 
     }else{
 
-      $tmp_roles = get_list($FilterRoles,  "acl", "ou=aclroles,".$base, $Attrs,GL_SIZELIMIT);
+      $tmp_roles = get_list($FilterRoles,  "acl", get_ou('aclroleou').$base, $Attrs,GL_SIZELIMIT);
 
       foreach($tmp_roles as $entry){
         $res[] = $entry;
index b1132357d14828b93a7d2bb638e3e95c3b9adc14..3c119d164098a09553f128d1143a1f099d995dcd 100644 (file)
@@ -15,7 +15,7 @@ class aclroletab extends tabs
 
     /* Check for new 'dn', in order to propagate the
        'dn' to all plugins */
-    $new_dn= 'cn='.$baseobject->cn.",ou=aclroles,".$baseobject->base;
+    $new_dn= 'cn='.$baseobject->cn.",".get_ou('aclroleou').$baseobject->base;
 
     if ($this->dn != $new_dn){
 
index 4225869cc0acbbeee5bc6eda79fdc51f9acac948..54ec897fbd380a9268459ae5f32bde566815f843 100644 (file)
@@ -45,7 +45,7 @@ class askClassName extends plugin
      * With a second search detect all object that belong to the different ous. 
      */
 
-    $base = "ou=fai,ou=configs,ou=systems,".$_SESSION['CurrentMainBase'];
+    $base = get_ou('faiou').$_SESSION['CurrentMainBase'];
     if($faifilter['branch'] != "main"){
       $base = $faifilter['branch'];
     }
index 13873f9540d258e6853317b8564a2cc5b2cf4a5c..3fea1c5c070886b2476cf195d0e005cbdf8fd1a0 100644 (file)
@@ -456,7 +456,7 @@ class faiManagement extends plugin
           $name = $br[$bb];
           $ldap->cd($bb);
           $ldap->recursive_remove();
-          $ldap->cd(preg_replace('/,ou=fai,ou=configs,ou=systems,/', ','.get_ou('applicationou'), $bb));
+          $ldap->cd(preg_replace('/,'.get_ou('faiou').'/', ','.get_ou('applicationou'), $bb));
           $ldap->recursive_remove();
           $this->DivListFai->selectedBranch = "main";
 
@@ -488,7 +488,7 @@ class faiManagement extends plugin
       $name = $_POST['BranchName'];
       $is_ok = true;
       $smarty->assign("BranchName",$name);
-      $base= "ou=fai,ou=configs,ou=systems,".$this->DivListFai->selectedBase;
+      $base= get_ou('faiou').$this->DivListFai->selectedBase;
 
       /* Check used characters */
       if(preg_match("/[^0-9a-z \ö\ä\ü\.-_:,]/i",$name)){
@@ -555,11 +555,11 @@ 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) ; 
+        $appsrc = preg_replace("/".normalizePreg(get_ou('faiou'))."/",get_ou('applicationou'),$baseToUse); 
+        $appdst = preg_replace("/".normalizePreg(get_ou('faiou'))."/",get_ou('applicationou'),"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) ; 
+        $mimesrc = preg_replace("/".normalizePreg(get_ou('faiou'))."/",get_ou('mimetypeou'),$baseToUse); 
+        $mimedst = preg_replace("/".normalizePreg(get_ou('faiou'))."/",get_ou('mimetypeou'),"ou=".$name.",".$baseToUse) ; 
 
         /* Check if source depeartments exist */
         foreach(array($baseToUse,$appsrc,$mimesrc) as $dep){
@@ -861,12 +861,12 @@ class faiManagement extends plugin
   function get_used_snapshot_bases()
   {
     $tmp = array();
-    $types = array("hooks","scripts","disk","packages","profiles","templates","variables");
+    $types = array("faipartitionou","faiscriptou","faitemplateou","faihookou","faiprofileou","faivariableou","faipackageou");
     foreach($types as $type){
       if($this->DivListFai->selectedBranch == "main"){
-        $tmp[] = "ou=".$type.",ou=fai,ou=configs,ou=systems,".$this->DivListFai->selectedBase;
+        $tmp[] = get_ou($type).get_ou('faiou').$this->DivListFai->selectedBase;
       }else{
-        $tmp[] = "ou=".$type.",".$this->DivListFai->selectedBranch;
+        $tmp[] = get_ou($type).$this->DivListFai->selectedBranch;
       }
     }
     return($tmp);
@@ -914,13 +914,13 @@ class faiManagement extends plugin
     $this->objects  = array();
 
     /* Get base */
-    $base = "ou=fai,ou=configs,ou=systems,".$this->DivListFai->selectedBase;
+    $base = get_ou('faiou').$this->DivListFai->selectedBase;
     if($this->DivListFai->selectedBranch != "main"){
       $br = $this->getBranches();
       if(isset($br[$this->DivListFai->selectedBranch])){
         $base = $this->DivListFai->selectedBranch;
       }else{
-        $base = "ou=fai,ou=configs,ou=systems,".$this->DivListFai->selectedBase;
+        $base = get_ou('faiou').$this->DivListFai->selectedBase;
       }
     }
     $this->base = $base;
@@ -932,13 +932,13 @@ class faiManagement extends plugin
      * Generate List of Partitions,Hooks,Scripts,Templates,Profiles ... 
      */
     $ObjectTypes = array(
-        "FAIpartitionTable"  => array("OU"=>"ou=disk,"        , "CHKBOX"=>"ShowPartitions"  ,"ACL" => "faiPartitionTable"),
-        "FAIpackageList"     => array("OU"=>"ou=packages,"    , "CHKBOX"=>"ShowPackages"    ,"ACL" => "faiPackage"),
-        "FAIscript"          => array("OU"=>"ou=scripts,"     , "CHKBOX"=>"ShowScripts"     ,"ACL" => "faiScript"),
-        "FAIvariable"        => array("OU"=>"ou=variables,"   , "CHKBOX"=>"ShowVariables"   ,"ACL" => "faiVariable"),
-        "FAIhook"            => array("OU"=>"ou=hooks,"       , "CHKBOX"=>"ShowHooks"       ,"ACL" => "faiHook"),
-        "FAIprofile"         => array("OU"=>"ou=profiles,"    , "CHKBOX"=>"ShowProfiles"    ,"ACL" => "faiProfile"),
-        "FAItemplate"        => array("OU"=>"ou=templates,"   , "CHKBOX"=>"ShowTemplates"   ,"ACL" => "faiTemplate"));
+        "FAIpartitionTable"  => array("OU"=> get_ou('faipartitionou') , "CHKBOX"=>"ShowPartitions"  ,"ACL" => "faiPartitionTable"),
+        "FAIpackageList"     => array("OU"=> get_ou('faipackageou')   , "CHKBOX"=>"ShowPackages"    ,"ACL" => "faiPackage"),
+        "FAIscript"          => array("OU"=> get_ou('faiscriptou')    , "CHKBOX"=>"ShowScripts"     ,"ACL" => "faiScript"),
+        "FAIvariable"        => array("OU"=> get_ou('faivariableou')  , "CHKBOX"=>"ShowVariables"   ,"ACL" => "faiVariable"),
+        "FAIhook"            => array("OU"=> get_ou('faihookou')      , "CHKBOX"=>"ShowHooks"       ,"ACL" => "faiHook"),
+        "FAIprofile"         => array("OU"=> get_ou('faiprofileou')   , "CHKBOX"=>"ShowProfiles"    ,"ACL" => "faiProfile"),
+        "FAItemplate"        => array("OU"=> get_ou('faitemplateou')  , "CHKBOX"=>"ShowTemplates"   ,"ACL" => "faiTemplate"));
 
     $filter = "";
     foreach($ObjectTypes as $key => $data){
index bcd5eaaf69bb268efd336b177c41bfe7f44a8481..c3a3fe971010101226f2978a335534c882ce3009 100644 (file)
@@ -185,7 +185,7 @@ class faiPackage extends plugin
     if(!$this->is_account){
 
       /* Assemble release name */
-      $tmp= preg_replace('/,ou=fai,ou=configs,ou=systems,.*$/', '', $_SESSION['faifilter']['branch']);
+      $tmp= preg_replace('/,'.normalizePreg(get_ou('faiou')).'.*$/', '', $_SESSION['faifilter']['branch']);
       $tmp= preg_replace('/ou=/', '', $tmp);
       $rev= array_reverse(split(',', $tmp));
       $this->FAIdebianRelease= "";
@@ -468,7 +468,7 @@ class faiPackage extends plugin
 
     /* Assemble release name */
     if($this->FAIdebianRelease == "ClearFromCopyPaste"){
-      $tmp= preg_replace('/,ou=fai,ou=configs,ou=systems,.*$/', '', $_SESSION['faifilter']['branch']);
+      $tmp= preg_replace('/,'.normalizePreg(get_ou('faiou')).'.*$/', '', $_SESSION['faifilter']['branch']);
       $tmp= preg_replace('/ou=/', '', $tmp);
       $rev= array_reverse(split(',', $tmp));
       $this->FAIdebianRelease= "";
index 4b5daea9b228ad9d07bf7027cb20334c20e26d67..6c1fea191132cfbb0ac637c109a0531d82e92756 100644 (file)
@@ -409,7 +409,7 @@ class faiProfile extends plugin
     if($base == "main"){
       $base =$_SESSION['CurrentMainBase'];
     }
-    $base = "ou=profiles,".$base;
+    $base = get_ou('faiprofileou').$base;
   
     $ldap->cd($base);
     if ($this->old_cn == ""){
index 2d9b0976458f0bd8f23fd7232de5b0eb2bdc0af2..1dbcad7f0bbde6974fa4fd8a76eaac7b6cad66d2 100644 (file)
@@ -21,7 +21,7 @@ class faiProfileEntry extends plugin
     plugin::plugin ($config, $dn);
 
     /* Search only in fai tree */
-    $base = "ou=fai,ou=configs,ou=systems,".$_SESSION['CurrentMainBase'];
+    $base = get_ou('faiou').$_SESSION['CurrentMainBase'];
     if($_SESSION['faifilter']['branch']!="main"){
       $base = $_SESSION['faifilter']['branch'];
     }
@@ -85,7 +85,7 @@ class faiProfileEntry extends plugin
 
     /* If no search filter is set, create one */
     if (!is_global("SUBfaifilter")){
-      $SUBfaifilter= array("base" => "ou=fai,ou=configs,ou=systems,".$_SESSION['CurrentMainBase'], "Sregex" => "*");
+      $SUBfaifilter= array("base" => get_ou('faiou').$_SESSION['CurrentMainBase'], "Sregex" => "*");
       $SUBfaifilter['SShowTemplates'] = true;
       $SUBfaifilter['SShowScripts']   = true;
       $SUBfaifilter['SShowHooks']     = true;
index a9bfbb840a39c40b631d85913d6d2c4b7650eb82..1fde58e56bcd3cabc83a804576187b2982b87c8f 100644 (file)
@@ -41,13 +41,13 @@ class faiSummaryTab extends plugin{
 
     /* Base object configuration */
     $this->objs = array(       
-        "FAIscript"                => array(   "Image" =>"images/fai_script.png",        "Name"=>_("Scripts")      ,"Tree"     =>"ou=scripts,") ,
-        "FAIhook"                          => array(   "Image" =>"images/fai_hook.png" ,         "Name"=>_("Hooks")        ,"Tree"     =>"ou=hooks,"),
-        "FAIvariable"            => array(     "Image" =>"images/fai_variable.png",      "Name"=>_("Variables")    ,"Tree"     =>"ou=variables,") ,
-        "FAItemplate"            => array(     "Image" =>"images/fai_template.png",      "Name"=>_("Templates")    ,"Tree"     =>"ou=templates,") ,
-        "FAIpartitionTable" => array(  "Image" =>"images/fai_partitionTable.png","Name"=>_("Partition table")  ,"Tree" =>"ou=disk,") ,
-        "FAIpackageList"         => array(     "Image" =>"images/fai_packages.png",      "Name"=>_("Package list") ,"Tree"     =>"ou=packages,") ,
-        "FAIprofile"               => array(   "Image" =>"images/fai_profile.png",       "Name"=>_("Profiles")     ,"Tree"     =>"ou=profiles,"));
+        "FAIscript"                => array(   "Image" =>"images/fai_script.png",        "Name"=>_("Scripts")      ,"Tree"     =>get_ou('faiscriptou')) ,
+        "FAIhook"                          => array(   "Image" =>"images/fai_hook.png" ,         "Name"=>_("Hooks")        ,"Tree"     =>get_ou('faihookou')),
+        "FAIvariable"            => array(     "Image" =>"images/fai_variable.png",      "Name"=>_("Variables")    ,"Tree"     =>get_ou('faivariableou')) ,
+        "FAItemplate"            => array(     "Image" =>"images/fai_template.png",      "Name"=>_("Templates")    ,"Tree"     =>get_ou('faitemplateou')) ,
+        "FAIpartitionTable" => array(  "Image" =>"images/fai_partitionTable.png","Name"=>_("Partition table")  ,"Tree" =>get_ou('faipartitionou')) ,
+        "FAIpackageList"         => array(     "Image" =>"images/fai_packages.png",      "Name"=>_("Package list") ,"Tree"     =>get_ou('faipackageou')) ,
+        "FAIprofile"               => array(   "Image" =>"images/fai_profile.png",       "Name"=>_("Profiles")     ,"Tree"     =>get_ou('faiprofileou')));
   }
 
 
@@ -70,7 +70,7 @@ class faiSummaryTab extends plugin{
       /* Get Classes and release */
       $this->Classes = $this->parent->by_object['faiProfile']->FAIclasses;
       $this->base    = $this->parent->by_object['faiProfile']->base;
-      $str = preg_replace("/^.*ou=profiles,/","",$this->dn);
+      $str = preg_replace("/^.*".normalizePreg(get_ou('faiprofileou'))."/","",$this->dn);
   
     /* Check if parent tab is work tab */
     }elseif(isset($this->parent->by_name['workstartup'])){
index 1857854b33906d62e096d33a878e79f6dbb44ff1..d431eea1e530a8a7e2a04f9c33c0173846355711 100644 (file)
@@ -21,10 +21,10 @@ class tabsHook extends tabs
   {
        $baseobject= $this->by_object['faiHook'];
 
-       $new_dn= 'cn='.$baseobject->cn.",ou=hooks,ou=fai,ou=configs,ou=systems,".$_SESSION['CurrentMainBase'];
+       $new_dn= 'cn='.$baseobject->cn.",".get_ou('faihookou').get_ou('faiou').$_SESSION['CurrentMainBase'];
        
        if($_SESSION['faifilter']['branch']!="main"){
-               $new_dn ='cn='.$baseobject->cn.",ou=hooks,".$_SESSION['faifilter']['branch'];
+               $new_dn ='cn='.$baseobject->cn.",".get_ou('faihookou').$_SESSION['faifilter']['branch'];
        }
 
        if ($this->dn != $new_dn && $this->dn != "new"){
index 8731835ef2bbbd990c58977372348b1f2185e2b1..6a3d58158037a8d7b20b12584f0741274e0338c4 100644 (file)
@@ -22,9 +22,9 @@ class tabsPackage extends tabs
   {
        $baseobject= $this->by_object['faiPackage'];
 
-       $new_dn= 'cn='.$baseobject->cn.",ou=packages,ou=fai,ou=configs,ou=systems,".$_SESSION['CurrentMainBase'];
+       $new_dn= 'cn='.$baseobject->cn.",".get_ou('faipackageou').get_ou('faiou').$_SESSION['CurrentMainBase'];
        if($_SESSION['faifilter']['branch']!="main"){
-               $new_dn ='cn='.$baseobject->cn.",ou=packages,".$_SESSION['faifilter']['branch'];
+               $new_dn ='cn='.$baseobject->cn.",".get_ou('faipackageou').$_SESSION['faifilter']['branch'];
        }
                        
        if ($this->dn != $new_dn && $this->dn != "new"){
index 9d2312d5707521326e214c427bb3cca142827295..56bd1d2f4fc23ca6f81bf7f4068648e0c34d8f8c 100644 (file)
@@ -22,10 +22,10 @@ class tabsPartition extends tabs
   {
        $baseobject= $this->by_object['faiPartitionTable'];
 
-       $new_dn= 'cn='.$baseobject->cn.",ou=disk,ou=fai,ou=configs,ou=systems,".$_SESSION['CurrentMainBase'];
+       $new_dn= 'cn='.$baseobject->cn.",".get_ou('faipartitionou').get_ou('faiou').$_SESSION['CurrentMainBase'];
        
        if($_SESSION['faifilter']['branch']!="main"){
-               $new_dn ='cn='.$baseobject->cn.",ou=disk,".$_SESSION['faifilter']['branch'];
+               $new_dn ='cn='.$baseobject->cn.",".get_ou('faipartitionou').$_SESSION['faifilter']['branch'];
        }
 
        if ($this->dn != $new_dn && $this->dn != "new"){
index cbc3abd940b752583b3bd0091a090bc594a8d1ca..3480b46aff5b5bddaf2c33c6857e9fa00bfcd7be 100644 (file)
@@ -22,10 +22,10 @@ class tabsProfile extends tabs
   {
        $baseobject= $this->by_object['faiProfile'];
 
-       $new_dn= 'cn='.$baseobject->cn.",ou=profiles,ou=fai,ou=configs,ou=systems,".$_SESSION['CurrentMainBase'];
+       $new_dn= 'cn='.$baseobject->cn.",".get_ou('faiprofileou').get_ou('faiou').$_SESSION['CurrentMainBase'];
 
        if($_SESSION['faifilter']['branch']!="main"){
-               $new_dn ='cn='.$baseobject->cn.",ou=profiles,".$_SESSION['faifilter']['branch'];
+               $new_dn ='cn='.$baseobject->cn.",".get_ou('faiprofileou').$_SESSION['faifilter']['branch'];
        }
                        
        if ($this->dn != $new_dn && $this->dn != "new"){
index 28ebd224a609cfb0e617ff35173d0dc9e2aed70c..1eac83c38c1c18cc18f62642e2183aceb03af75f 100644 (file)
@@ -22,10 +22,10 @@ class tabsScript extends tabs
   {
        $baseobject= $this->by_object['faiScript'];
 
-       $new_dn= 'cn='.$baseobject->cn.",ou=scripts,ou=fai,ou=configs,ou=systems,".$_SESSION['CurrentMainBase'];
+       $new_dn= 'cn='.$baseobject->cn.",".get_ou('faiscriptou').get_ou('faiou').$_SESSION['CurrentMainBase'];
 
        if($_SESSION['faifilter']['branch']!="main"){
-               $new_dn ='cn='.$baseobject->cn.",ou=scripts,".$_SESSION['faifilter']['branch'];
+               $new_dn ='cn='.$baseobject->cn.",".get_ou('faiscriptou').$_SESSION['faifilter']['branch'];
        }
        
        if ($this->dn != $new_dn && $this->dn != "new"){
index 2ff58199b1f2fca2f9c01e685fa7054733cfa786..eb674e894825a8492b76d4fee71aa1e341a9d7ba 100644 (file)
@@ -22,10 +22,10 @@ class tabsTemplate extends tabs
   {
        $baseobject= $this->by_object['faiTemplate'];
        
-       $new_dn= 'cn='.$baseobject->cn.",ou=templates,ou=fai,ou=configs,ou=systems,".$_SESSION['CurrentMainBase'];
+       $new_dn= 'cn='.$baseobject->cn.",".get_ou('faitemplateou').get_ou('faiou').$_SESSION['CurrentMainBase'];
 
        if($_SESSION['faifilter']['branch']!="main"){
-               $new_dn ='cn='.$baseobject->cn.",ou=templates,".$_SESSION['faifilter']['branch'];
+               $new_dn ='cn='.$baseobject->cn.",".get_ou('faitemplateou').$_SESSION['faifilter']['branch'];
        }
 
        if ($this->dn != $new_dn && $this->dn != "new"){
index c872f2d9bca24762ea4b4a5683adb899ab54135a..2958a11f5073d218a714aeac6908635eabb60bc2 100644 (file)
@@ -22,10 +22,10 @@ class tabsVariable extends tabs
   {
        $baseobject= $this->by_object['faiVariable'];
 
-       $new_dn= 'cn='.$baseobject->cn.",ou=variables,ou=fai,ou=configs,ou=systems,".$_SESSION['CurrentMainBase'];
+       $new_dn= 'cn='.$baseobject->cn.",".get_ou('faivariableou').get_ou('faiou').$_SESSION['CurrentMainBase'];
        
        if($_SESSION['faifilter']['branch']!="main"){
-               $new_dn ='cn='.$baseobject->cn.",ou=variables,".$_SESSION['faifilter']['branch'];
+               $new_dn ='cn='.$baseobject->cn.",".get_ou('faivariableou').$_SESSION['faifilter']['branch'];
        }
                        
        if ($this->dn != $new_dn && $this->dn != "new"){
index 095d3be2792d98f9657cc055b7fbf52dbed301b7..133cf5650db49b1392fe1df25e1cda53780e08b2 100644 (file)
@@ -823,7 +823,7 @@ class group extends plugin
       /* Check for used 'cn' */
       $ldap= $this->config->get_ldap_link();
       if(($this->cn  != $this->orig_cn) || ($this->orig_dn == "new")){
-        $ldap->cd("ou=groups,".$this->base);
+        $ldap->cd(get_groups_ou().$this->base);
         $ldap->ls("(&(|(objectClass=gosaGroupOfNames)(objectClass=posixGroup))(cn=$this->cn))",get_groups_ou().$this->base,array("cn"));
         if ($ldap->count() != 0){
           $message[]= _("Value specified as 'Name' is already used.");
index 585d5e16ae89d81446eef6c474b374ef88347e7e..1a527e96304d132b6162b8d444af20eed32fb08b 100644 (file)
@@ -99,8 +99,8 @@ class printgeneric extends plugin
     } else {
     
       /* Set base and check if the extracted base exists */
-      if(preg_match("/ou=incoming,/",$this->dn)){
-        $this->base= preg_replace("/ou=incoming,/","",dn2base($this->dn));
+      if(preg_match("/".normalizePreg('incomingou')."/",$this->dn)){
+        $this->base= preg_replace("/".normalizePreg('incomingou')."/","",dn2base($this->dn));
       }else{
         $this->base= preg_replace("/".normalizePreg(get_ou('printerou')).",/","",dn2base($this->dn));
       }
@@ -825,7 +825,7 @@ class printgeneric extends plugin
     }
 
     /* Ensure to create a new object */
-    if(preg_match("/ou=incoming,/",$this->orig_dn)){
+    if(preg_match("/".normalizePreg('incomingou')."/",$this->orig_dn)){
       $this->orig_dn = "new";
     }
 
index 8497ed86573826b5b3a77c41a9da2c9f514eb2aa..4bc47245cc6260131a6afdd0b6bfd82436d97764 100644 (file)
@@ -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("/,".get_ou('serverou')."/",$attrs['dn'])){
+            if(!preg_match("/cn=dhcp,/",$attrs['dn']) && !preg_match("/,".get_ou('incomingou')."/",$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;
             }
index 5e9b28605b8f2ae507873e4522e5cc954cf5c222..205e70316c7bb24cec24fc7a5dc9fec65889df35 100644 (file)
@@ -898,7 +898,7 @@ class systems extends plugin
     $tabs = array(
         "terminal"        => get_ou('terminalou'),
         "workstation"     => get_ou('workstationou'),
-        "incoming"        => "ou=incoming,",
+        "incoming"        => get_ou('incomingou'),
         "server"          => get_ou('serverou'),
         "printer"         => get_ou('printerou'),
         "phone"           => get_ou('phoneou'),
@@ -1023,7 +1023,7 @@ class systems extends plugin
 
     /* Search for incoming objects */ 
     $filter = "(|(&".$userregex."(objectClass=goHard)(cn=".$this->DivListSystem->Regex.")))";
-    $res = array_merge($res,get_list($filter,$sys_categories,"ou=incoming","ou=incoming,".$base,$sys_attrs, GL_NONE | GL_SIZELIMIT));
+    $res = array_merge($res,get_list($filter,$sys_categories, get_ou('incomingou'),get_ou('incomingou').$base,$sys_attrs, GL_NONE | GL_SIZELIMIT));
 
     /* Get all gotoTerminal's */
     foreach ($res as $value){
@@ -1045,7 +1045,7 @@ class systems extends plugin
       }
 
       /* check if current object is a new one */
-      if (preg_match ("/,ou=incoming,/i", $tmp)){
+      if (preg_match ("/,".get_ou('incomingou')."/i", $tmp)){
         if (in_array_ics('gotoTerminal', $value['objectClass'])){
           $add= "- "._("New terminal");
         }elseif (in_array_ics('gotoWorkstation', $value['objectClass'])){
index ac43e3500ddeea41ef79e9e87bc6fbdac762ddb4..3f3f258fe2d26deef236eeef607e8b22d3e98a59 100644 (file)
@@ -471,7 +471,7 @@ class termgeneric extends plugin
       }
       if ($ldap->count() != 0){
         while ($attrs= $ldap->fetch()){
-          if (preg_match("/cn=dhcp,/",$attrs['dn']) || preg_match ("/,ou=incoming,/", $ldap->getDN())){
+          if (preg_match("/cn=dhcp,/",$attrs['dn']) || preg_match ("/,".normalizePreg(get_ou('incomingou'))."/", $ldap->getDN())){
             continue;
           } else {
             if ($attrs['dn'] != $this->orig_dn){
index 73333c4d1413ff82a1dd441fa986b7ad063ef528..1c56e88418ee900b0a5ed514f260be5cb7127896 100644 (file)
@@ -451,7 +451,7 @@ class workgeneric extends plugin
       }
       if ($ldap->count() != 0){
         while ($attrs= $ldap->fetch()){
-          if (preg_match("/cn=dhcp,/",$attrs['dn']) || preg_match ("/,ou=incoming,/", $ldap->getDN())){
+          if (preg_match("/cn=dhcp,/",$attrs['dn']) || preg_match ("/,".get_ou('incomingou')."/", $ldap->getDN())){
             continue;
           } else {
             if ($attrs['dn'] != $this->orig_dn){
index 0e06a56f32309fd3ee39c9ab68eea0ed14af0624..9e9a4732d027fecb581326de42e7ec6ad0e681c9 100644 (file)
@@ -925,7 +925,7 @@ class workstartup extends plugin
     $str = "";
     $tmp = split("\/",$release);
     $tmp = array_reverse($tmp);
-    $base = "ou=fai,ou=configs,ou=systems,";   
+    $base = get_ou('faiou');   
     foreach($tmp as $departmentname){
       $str .= ",ou=".$departmentname;
     }
index 19284661d0870feb2755e7d07218761567e0bba9..bbb19426205a71a559f4435ae134e1c2cede4216 100644 (file)
@@ -209,7 +209,7 @@ class blocklistGeneric extends plugin
       }
       if ($this->dn == 'new'){
         $ldap= $this->config->get_ldap_link();
-        $ldap->cd ("ou=gofax,ou=systems,".$this->config->current["BASE"]);
+        $ldap->cd (get_ou('blocklistou').$this->config->current["BASE"]);
         $ldap->search ("(&(|(objectClass=goFaxSBlock)(objectClass=goFaxRBlock))(cn=".$this->cn."))", array("cn"));
         if ($ldap->count() != 0){
           $message[]= _("Specified name is already used.");
index f9b19ea2a94c94f2ca7f42981f47dbfce276aae0..c7e1175c6ac5ad7cc0935403d97ab92d64c36385 100644 (file)
@@ -346,7 +346,7 @@ class blocklist extends plugin
   /* Return departments, that will be included within snapshot detection */
   function get_used_snapshot_bases()
   {
-    return(array("ou=gofax,ou=systems,". $this->DivListBlocklist->selectedBase));
+    return(array(get_ou('blocklistou').$this->DivListBlocklist->selectedBase));
   }
 
 
@@ -367,7 +367,7 @@ class blocklist extends plugin
     if($SubSearch){
       $Flags |= GL_SUBSEARCH;
     }else{
-      $base = "ou=gofax,ou=systems,".$base;
+      $base = get_ou('blocklistou').$base;
     }  
 
     /* Create filter */
index 9293903e1e4033182685eac9ae684ae149ba0425..32a67470584370d3807cb104e72309606c6de210 100644 (file)
@@ -15,7 +15,7 @@ class faxblocktabs extends tabs
     $baseobject= $this->by_object['blocklistGeneric'];
 
     /* Check for new 'dn', in order to propagate the 'dn' to all plugins */
-    $new_dn= "cn=".$baseobject->cn.",ou=gofax,ou=systems,".$baseobject->base;
+    $new_dn= "cn=".$baseobject->cn.",".get_ou('blocklistou').$baseobject->base;
 
     /* Move group? */
     if ($this->dn != $new_dn){
index e0364dc54666e6f9e3cd1f626f59f2d37c021fdf..4f8d0d9d86105b11e9731474c4b0372dd2e27361 100644 (file)
@@ -119,9 +119,8 @@ class conference extends plugin
       }
     } else {
 
-      /* The base is something like this 
-          "cn=Confis,ou=conferences,ou=asterisk,ou=configs,ou=systems," */
-      $this->base= preg_replace ("/^[^,]+,[^,]+,[^,]+,[^,]+,[^,]+,/", "", $this->dn);
+      /* Get base */ 
+      $this->base = preg_replace ("/^[^,]+,".normalizePreg(get_ou('conferenceou'))."/i","",$this->dn);;
     }
 
     $this->goFonConferenceOwner=$this->ui->dn;
@@ -407,7 +406,7 @@ class conference extends plugin
 
     if($this->old_cn != $this->cn || $this->base != $this->old_base){
       $ldap = $this->config->get_ldap_link();
-      $ldap->cd("ou=conferences,ou=asterisk,ou=configs,ou=systems,".$this->base);
+      $ldap->cd(get_ou('conferenceou').$this->base);
       $ldap->search("(&(objectClass=goFonConference)(cn=".$this->cn."))",array("cn"));
       if($ldap->count()){
         $message[] =_("There is already a conference with this name in the current tree.");
index 5b58065eead3a8aa07c7d8e33f2e410a37897f5b..6b0c545e034b72aca8265b2b6cb771aebae8910a 100644 (file)
@@ -22,7 +22,7 @@ class conferencetabs extends tabs
   function save($ignore_account= FALSE)
   {
        $baseobject= $this->by_object['conference'];
-       $new_dn= 'cn='.$baseobject->cn.',ou=conferences,ou=asterisk,ou=configs,ou=systems,'.$baseobject->base;
+       $new_dn= 'cn='.$baseobject->cn.','.get_ou('conferenceou').$baseobject->base;
 
        if(strtolower($this->dn)==strtolower($new_dn)){
                $this->dn=$new_dn;