Code

Updated ogroup base detection.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 11 Jan 2008 07:19:52 +0000 (07:19 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 11 Jan 2008 07:19:52 +0000 (07:19 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8304 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/functions.inc
gosa-core/plugins/admin/ogroups/class_ogroup.inc
gosa-core/plugins/admin/ogroups/class_ogroupManagement.inc
gosa-core/plugins/admin/ogroups/tabs_ogroups.inc

index 07ce7ded7eb41ea0baad61a2101382f4bb3df1e5..0754d26eca09293ebe1609155ec7088cd1effb94 100644 (file)
@@ -1017,7 +1017,9 @@ function get_ou($name)
 {
   global $config;
 
-  $map = array( "applicationou" => "ou=apps,",
+  $map = array( 
+                "ogroupou"      => "ou=groups,",
+                "applicationou" => "ou=apps,",
                 "systemsou"     => "ou=systems,",
                 "serverou"      => "ou=servers,ou=systems,",
                 "terminalou"    => "ou=terminals,ou=systems,",
index 14b11c95ca49091c4c45e55993c6fbd96a059e68..ef6388f32550e37b33025b504bf4c60c351fbfce 100644 (file)
@@ -93,7 +93,7 @@ class ogroup extends plugin
     if ($this->dn == "new"){
       $this->base = session::get('CurrentMainBase');
     } else {
-      $this->base= preg_replace("/^[^,]+,".get_groups_ou()."/","",$this->dn);
+      $this->base= preg_replace("/^[^,]+,".normalizePreg(get_ou("ogroupou"))."/","",$this->dn);
     }
 
     /* Load member data */
@@ -388,7 +388,7 @@ class ogroup extends plugin
       ###########*/
 
     $p_f= array("accounts"        => array("CLASS"=>"gosaAccount"    ,"DN"=> get_people_ou()           ,"ACL" => "users"), 
-                "groups"          => array("CLASS"=>"posixGroup"     ,"DN"=> get_groups_ou()           ,"ACL" => "groups"), 
+                "groups"          => array("CLASS"=>"posixGroup"     ,"DN"=> get_groups_ou('ogroupou') ,"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"),
@@ -592,7 +592,7 @@ class ogroup extends plugin
 
     /* Permissions for that base? */
     if ($this->base != ""){
-      $new_dn= 'cn='.$this->cn.','.get_groups_ou().$this->base;
+      $new_dn= 'cn='.$this->cn.','.get_ou('ogroupou').$this->base;
     } else {
       $new_dn= $this->dn;
     }
@@ -641,7 +641,7 @@ class ogroup extends plugin
 
     /* New accounts need proper 'dn', propagate it to remaining objects */
     if ($this->dn == 'new'){
-      $this->dn= 'cn='.$this->cn.','.get_groups_ou().$this->base;
+      $this->dn= 'cn='.$this->cn.','.get_ou('ogroupou').$this->base;
     }
 
     /* Save data. Using 'modify' implies that the entry is already present, use 'add' for
index 1515f9d29274ce713b66bc39c1219654efda601b..f7f7caec817b7f788f7c8bbe722e4357303c9222 100644 (file)
@@ -437,7 +437,7 @@ class ogroupManagement extends plugin
   /* Return departments, that will be included within snapshot detection */
   function get_used_snapshot_bases()
   {
-    return(array(get_groups_ou().$this->DivListOGroup->selectedBase));
+    return(array(get_ou('ogroupou').$this->DivListOGroup->selectedBase));
   }
 
   
@@ -525,9 +525,9 @@ class ogroupManagement extends plugin
     $filter= "(&(cn=$Regex)(objectClass=gosaGroupOfNames)(|$filter))";
 
     if($this->DivListOGroup->SubSearch){
-      $res= get_sub_list($filter, "ogroups",get_groups_ou(), $base, array("cn","objectClass","gosaGroupObjects"), GL_SIZELIMIT | GL_SUBSEARCH);
+      $res= get_sub_list($filter, "ogroups",get_ou('ogroupou'), $base, array("cn","objectClass","gosaGroupObjects"), GL_SIZELIMIT | GL_SUBSEARCH);
     }else{
-      $res= get_sub_list($filter, "ogroups",get_groups_ou(), get_groups_ou().$base, array("cn","objectClass","gosaGroupObjects"), GL_SIZELIMIT );
+      $res= get_sub_list($filter, "ogroups",get_ou('ogroupou'), get_ou('ogroupou').$base, array("cn","objectClass","gosaGroupObjects"), GL_SIZELIMIT );
     }
 
     $this->ogrouplist= $res;
index 3485bb79f6f9462bd603abc451b67f9658e5ffeb..6d3c018af5701249122f96eaa6bbeb1385339804 100644 (file)
@@ -272,7 +272,7 @@ class ogrouptabs extends tabs
 
     /* Check for new 'dn', in order to propagate the
        'dn' to all plugins */
-    $new_dn= 'cn='.$baseobject->cn.','.get_groups_ou().$baseobject->base;
+    $new_dn= 'cn='.$baseobject->cn.','.get_ou('ogroupou').$baseobject->base;
 
     /* Move group? */
     if ($this->dn != $new_dn){
@@ -288,7 +288,7 @@ class ogrouptabs extends tabs
     }
 
     if ($this->dn == "new"){
-      $this->dn= 'cn='.$baseobject->cn.','.get_groups_ou().$baseobject->base;
+      $this->dn= 'cn='.$baseobject->cn.','.get_ou('ogroupou').$baseobject->base;
     }
 
     tabs::save();