Code

Replaced ou=devices/ou=macro/ou=conferences with get_ou
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 2 Jan 2008 14:54:12 +0000 (14:54 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 2 Jan 2008 14:54:12 +0000 (14:54 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8182 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/functions.inc
gosa-core/plugins/admin/devices/class_deviceGeneric.inc
gosa-core/plugins/admin/devices/class_deviceManagement.inc
gosa-core/plugins/admin/devices/class_divListDevices.inc
gosa-core/plugins/admin/devices/tabs_devices.inc
gosa-core/plugins/gofon/conference/class_phoneConferenceManagment.inc
gosa-core/plugins/gofon/macro/class_gofonMacroManagement.inc
gosa-core/plugins/gofon/macro/tabs_macros.inc
gosa-core/plugins/personal/environment/class_hotplugDialog.inc

index 7201467ccb2303a8a6b4e33089b854054ae50ae0..03fd0828747a81b4bbf8c2a07094ae2c7179ce21 100644 (file)
@@ -1041,6 +1041,9 @@ function get_ou($name)
                 "printerou"     => "ou=printers,ou=systems,",
                 "phoneou"       => "ou=phones,ou=systems,",
                 "componentou"   => "ou=netdevices,ou=systems,",
+                "macroou"       => "ou=macros,ou=asterisk,ou=configs,ou=systems,",
+                "conferenceou"  => "ou=conferences,ou=asterisk,ou=configs,ou=systems,",
+                "deviceou"      => "ou=devices,",
                 "mimetypeou"    => "ou=mime,");
 
   /* Preset ou... */
index 095adf7f34a073e32c3cd6d22a4f0b7f3c11bee4..a7e6df15cab81e8c91332b34f93af3126e201f0a 100644 (file)
@@ -44,7 +44,7 @@ class deviceGeneric extends plugin
         $this->base= dn2base($ui->dn);
       }
     } else {
-      $this->base =preg_replace ("/^[^,]+,ou=devices,/","",$this->dn);
+      $this->base =preg_replace ("/^[^,]+,".get_ou('deviceou')."/","",$this->dn);
     }
   }
 
index 61ea93afaa0a2a0d513f135e81ff8c4d4b508eda..2558cc1353746d2f8896524d384bd7352a335bd9 100644 (file)
@@ -425,7 +425,7 @@ class deviceManagement extends plugin
   /* Return departments, that will be included within snapshot detection */
   function get_used_snapshot_bases()
   {
-    return(array("ou=devices,".$this->DivListDevices->selectedBase));
+    return(array(get_ou('deviceou').$this->DivListDevices->selectedBase));
   }
 
   function copyPasteHandling_from_queue($s_action,$s_entry)
@@ -507,11 +507,11 @@ class deviceManagement extends plugin
     if($SubSearch){
       $Flags    |= GL_SUBSEARCH;
     }else{
-      $base ="ou=devices,".$base;
+      $base = get_ou('deviceou').$base;
     }
 
     /* Get results and create index */
-    $res= get_sub_list($Filter,"devices","ou=devices", $base, array("cn","description","dn","objectClass"), $Flags);
+    $res= get_sub_list($Filter,"devices",get_ou('deviceou'), $base, array("cn","description","dn","objectClass"), $Flags);
     $tmp2 = array();
     foreach ($res as $val){
       $tmp2[strtolower($val['cn'][0]).$val['cn'][0].$val['dn']] = strtolower($val['cn'][0]).$val['cn'][0].$val['dn'];
index fb09fe8c8647c91f392f360817b0bc6c29ae20ff..e9d5f85224545f6415959da07377d5086c9f8704 100755 (executable)
@@ -120,7 +120,7 @@ class divListDevices extends MultiSelectWindow
 
     /* Get acls */
     $ui       = get_userinfo();
-    $acl      = $ui->get_permissions("cn=dummy,ou=devices,".$this->selectedBase,"devices/deviceGeneric");
+    $acl      = $ui->get_permissions("cn=dummy,".get_ou('deviceou').$this->selectedBase,"devices/deviceGeneric");
     $acl_all  = $ui->has_complete_category_acls($this->selectedBase,"devices") ;
 
 
index 9cb2e90175800c5c44cf2737f630a32dc2a55b9d..97316ddd21bb1100018d5fea142adef618be5457 100755 (executable)
@@ -15,7 +15,7 @@ class devicetabs extends tabs
   function save($ignore_account= FALSE)
   {
     $baseobject= $this->by_object['deviceGeneric'];
-    $new_dn= "cn=".$baseobject->cn.",ou=devices,".$baseobject->base;
+    $new_dn= "cn=".$baseobject->cn.",".get_ou('deviceou').$baseobject->base;
 
     /* Move group? */
     if ($this->dn != $new_dn){
index 023e52e36680e1bfd3d3125590ca696784915b74..eabc6e2ae6907e2d4a9d4b442519551399347101 100644 (file)
@@ -312,7 +312,7 @@ class phoneConferenceManagment extends plugin
     /* Insert new entry*/    
     if($s_action == "new" ){
 
-      $dummy_dn = "cn=dummy,ou=conferences,ou=asterisk,ou=configs,ou=systems,".$this->DivListConference->selectedBase;      
+      $dummy_dn = "cn=dummy,".get_ou('conferenceou').$this->DivListConference->selectedBase;      
       $acl = $this->ui->get_permissions($dummy_dn,"gofonconference/conference"); 
       if(preg_match("/c/",$acl)){
         /* Set up the users ACL's for this 'dn' */
@@ -410,7 +410,7 @@ class phoneConferenceManagment extends plugin
   /* Return departments, that will be included within snapshot detection */
   function get_used_snapshot_bases()
   {
-    return(array("ou=conferences,ou=asterisk,ou=configs,ou=systems,".$this->DivListConference->selectedBase));
+    return(array(get_ou('conferenceou').$this->DivListConference->selectedBase));
   }
 
 
@@ -419,7 +419,7 @@ class phoneConferenceManagment extends plugin
    */
   function reload()
   {
-    $Base             = "ou=conferences,ou=asterisk,ou=configs,ou=systems,".$this->DivListConference->selectedBase;
+    $Base             = get_ou('conferenceou').$this->DivListConference->selectedBase;
     $SubSearch        = $this->DivListConference->SubSearch;
     $Regex            = $this->DivListConference->Regex;
     $Flags            = GL_SIZELIMIT ; 
index f25f49521a8df9ec25b70e13153def1bbaeeb79a..764a445bb0f5f64fe8eaf90888755886a27c195d 100755 (executable)
@@ -490,7 +490,7 @@ class goFonMacro extends plugin
   /* Return departments, that will be included within snapshot detection */
   function get_used_snapshot_bases()
   {
-    return(array("ou=macros,ou=asterisk,ou=configs,ou=systems,".$this->DivListMacro->selectedBase));
+    return(array(get_ou('macroou').$this->DivListMacro->selectedBase));
   }
 
 
@@ -508,7 +508,7 @@ class goFonMacro extends plugin
     if($SubSearch){
       $Flags |= GL_SUBSEARCH;
     }else{
-      $base = "ou=macros,ou=asterisk,ou=configs,ou=systems,".$base;
+      $base = get_ou('macroou').$base;
     }
 
     /* Generate macro list */
index 5c5bcf6c980bbba3705e981575815c5697260ae4..b2003f86e6055791a869745b7a585d9aef394776 100755 (executable)
@@ -17,7 +17,7 @@ class macrotabs extends tabs
 
        /* Check for new 'dn', in order to propagate the
           'dn' to all plugins */
-       $new_dn= "cn=".$baseobject->cn.",ou=macros,ou=asterisk,ou=configs,ou=systems,".$baseobject->base;
+       $new_dn= "cn=".$baseobject->cn.",".get_ou('macroou').$baseobject->base;
 
         /* Move group? */
         if ($this->dn != $new_dn){
index 0dd418e13c3934f4fa8b568127e6f63aa94e3c47..2e772481d68d933dae335a02ea3a33a182632270 100644 (file)
@@ -75,7 +75,7 @@ class hotplugDialog extends plugin
   function getHotplugs()
   {
     $ldap= $this->config->get_ldap_link();
-    $ldap->cd("ou=devices,".$this->depselect);
+    $ldap->cd(get_ou('deviceou').$this->depselect);
     $ldap->search("(&(objectClass=gotoDevice)(|(cn=".$this->regex.")(description=".$this->regex.")))",array("gotoHotplugDevice","cn","dn")); 
 
     $a_return = array();