From 429b220dc60fd6744c286f1ba5833aabfd33e276 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 11 Jan 2008 07:19:52 +0000 Subject: [PATCH] Updated ogroup base detection. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8304 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/functions.inc | 4 +++- gosa-core/plugins/admin/ogroups/class_ogroup.inc | 8 ++++---- .../plugins/admin/ogroups/class_ogroupManagement.inc | 6 +++--- gosa-core/plugins/admin/ogroups/tabs_ogroups.inc | 4 ++-- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc index 07ce7ded7..0754d26ec 100644 --- a/gosa-core/include/functions.inc +++ b/gosa-core/include/functions.inc @@ -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,", diff --git a/gosa-core/plugins/admin/ogroups/class_ogroup.inc b/gosa-core/plugins/admin/ogroups/class_ogroup.inc index 14b11c95c..ef6388f32 100644 --- a/gosa-core/plugins/admin/ogroups/class_ogroup.inc +++ b/gosa-core/plugins/admin/ogroups/class_ogroup.inc @@ -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 diff --git a/gosa-core/plugins/admin/ogroups/class_ogroupManagement.inc b/gosa-core/plugins/admin/ogroups/class_ogroupManagement.inc index 1515f9d29..f7f7caec8 100644 --- a/gosa-core/plugins/admin/ogroups/class_ogroupManagement.inc +++ b/gosa-core/plugins/admin/ogroups/class_ogroupManagement.inc @@ -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; diff --git a/gosa-core/plugins/admin/ogroups/tabs_ogroups.inc b/gosa-core/plugins/admin/ogroups/tabs_ogroups.inc index 3485bb79f..6d3c018af 100644 --- a/gosa-core/plugins/admin/ogroups/tabs_ogroups.inc +++ b/gosa-core/plugins/admin/ogroups/tabs_ogroups.inc @@ -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(); -- 2.30.2