diff --git a/plugins/admin/ogroups/class_ogroupManagement.inc b/plugins/admin/ogroups/class_ogroupManagement.inc
index 80c1b5412d3adbcb056b624521233c9cb7a08fc1..1cbeb8d93517d1294329a6ab7003290c2c2c2ba2 100644 (file)
/* Department changed? */
if(isset($_POST['depselect']) && $_POST['depselect']){
$ogroupfilter['depselect']= $_POST['depselect'];
- $this->reload();
}
/* Start for New List Managment */
$s_action="open";
$s_entry = base64_decode($_GET['dep_id']);
$ogroupfilter['depselect']= "".$this->config->departments[trim($s_entry)];
- $this->reload();
}
/* If Backbutton is Posted */
$ogroupfilter['depselect']= $this->config->departments["/"];
}
register_global("ogroupfilter", $ogroupfilter);
- $this->reload();
}
/* Homebutton is posted */
if($s_action=="home"){
$ogroupfilter['depselect']=(preg_replace("/^[^,]+,/","",$this->ui->dn));
$ogroupfilter['depselect']=(preg_replace("/^[^,]+,/","",$ogroupfilter['depselect']));
- $this->reload();
}
/* root posted */
if($s_action=="root"){
$ogroupfilter['depselect']=($this->config->current['BASE']);
- $this->reload();
}
// Edit if
register_global("ogroupfilter", $ogroupfilter);
- /* Prepare formular */
- if (!isset($this->ogroup) &&
- !isset($_POST['new_group']) &&
- !isset($_POST['delete_group']) &&
- !isset($_POST['select_group'])){
- $this->reload();
- }
+ $this->reload();
/* Check for exeeded sizelimit */
if (($message= check_sizelimit()) != ""){
$empty = "<img src='images/empty.png' style='width:16px;height:16px;' alt=''>";
// List Setup
- $divlist = new divlist();
+ $divlist = new divlist("ogroubstab");
$divlist->SetHeader(array(
array("string" => " ","attach"=>"style='width:20px;'"),
array("string" => _("Name of object groups")." / "._("Departments")),
foreach($this->departments as $key=> $val){
- $field1 = array("string" => "<img src='images/folder.png' alt='"._("Department")."'>");
+ if(!isset($this->config->departments[trim($key)])){
+ $this->config->departments[trim($key)]="";
+ }
+
+ $non_empty="";
+ $keys= str_replace("/","\/",$key);
+ foreach($this->config->departments as $keyd=>$vald ){
+ if(preg_match("/".$keys."\/.*/",$keyd)){
+ $non_empty="full";
+ }
+ }
+
+
+
+ $field1 = array("string" => "<img src='images/".$non_empty."folder.png' alt='"._("Department")."'>");
$field2 = array("string" => sprintf($linkopen,base64_encode($key),$val));
$field3 = array("string" => " ");
$field4 = array("string" => " ","attach"=>"style='text-align:right;border:none'");
} else {
$filter= "(&(cn=$regex)(objectClass=gosaGroupOfNames))";
}
- $res= get_list($this->ui->subtreeACL, "$filter", TRUE, $base, array("*"), TRUE);
+
+ $groups = ($this->config->current['GROUPS']);
+
+ $res= get_list($this->ui->subtreeACL, "$filter",FALSE, $groups.",".$base, array("*"), TRUE);
$this->ogrouplist= $res;
ksort ($this->ogrouplist);
reset ($this->ogrouplist);
$res3 = get_list2($this->ui->subtreeACL, "(&(|(ou=$regex)(description=$regex))(objectClass=gosaDepartment))",
TRUE, $base2, array("ou", "description"), TRUE);
+
+
$this->departments= array();
+ $tmp = array();
foreach ($res3 as $value){
+ $tmp[strtolower($value['dn']).$value['dn']]=$value;
+ }
+ ksort($tmp);
+ foreach($tmp as $value){
if($value["description"][0]!=".."){
- $this->departments[$value['dn']]= convert_department_dn2($value['dn'])." - [".$value["description"][0]."]";
+ $this->departments[$value['dn']]=convert_department_dn2($value['dn'])." - [".$value["description"][0]."]";
}else{
$this->departments[$value['dn']]=$value["description"][0];
}
}
-
/* END NEW LIST MANAGMENT
*/
+ $tmp=array();
+ foreach($this->ogrouplist as $tkey => $val ){
+ $tmp[strtolower($val['cn'][0]).$val['cn'][0]]=$val;
+ }
+ ksort($tmp);
+ $this->ogrouplist=array();
+ foreach($tmp as $val){
+ $this->ogrouplist[]=$val;
+ }
+ reset ($this->ogrouplist);