X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fadmin%2Fgroups%2Fclass_groupManagement.inc;h=e982d2da8a110ac25e46426cda5c04a286a70c11;hb=698d2c0e9783898024e3efeee678c8f70d4c67a7;hp=c238ed8b0539911baf944e8dc335da65d01f0cc7;hpb=8c900d19501de9abaf4cf130a52dedc263e010d3;p=gosa.git diff --git a/plugins/admin/groups/class_groupManagement.inc b/plugins/admin/groups/class_groupManagement.inc index c238ed8b0..e982d2da8 100644 --- a/plugins/admin/groups/class_groupManagement.inc +++ b/plugins/admin/groups/class_groupManagement.inc @@ -56,6 +56,9 @@ class groupManagement extends plugin function execute() { + /* Call parent execute */ +// plugin::execute(); + /* Save data */ $groupfilter= get_global("groupfilter"); $s_action = ""; @@ -345,16 +348,14 @@ class groupManagement extends plugin // Managment $listhead = "
". - "  ". - "  ". - "  ". - "  ". - "  ". - "  ". + "  ". + "  ". + "  ". + "  ". + "  ". + "  ". _("Current base")." ". - "  ". + "  ". "
"; @@ -381,15 +382,14 @@ class groupManagement extends plugin $divlist = new divlist("groupstab"); $divlist->SetHeader(array( - array("string" => " "), - array("string" => _("Groupname")." / "._("Department")), - array("string" => _("Properties"), "attach" => "style='width:116px;'"), - array("string" => _("Actions") ,"attach" => "style='border:none'") + array("string" => " ", "attach" => "style='text-align:center;width:20px;'"), + array("string" => _("Groupname")." / "._("Department"), "attach" => "style=''"), + array("string" => _("Properties"), "attach" => "style='width:136px;'"), + array("string" => _("Actions"), "attach" => "style='width:60px;border-right:0px;text-align:right;'") )); - $divlist->SetSummary(_("This table displays all groups, in the selected tree.")); - $divlist->SetEntriesPerPage(20); + $divlist->SetEntriesPerPage(0); foreach($this->departments as $key=> $val){ @@ -406,10 +406,10 @@ class groupManagement extends plugin } - $field1 = array("string" => "department"); - $field2 = array("string" => sprintf($linkopen,base64_encode($key),$val)); - $field3 = array("string" => " "); - $field4 = array("string" => " ","attach"=>"style='text-align:right;border:none'"); + $field1 = array("string" => "department", "attach" => "style='text-align:center;width:20px;'"); + $field2 = array("string" => sprintf($linkopen,base64_encode($key),$val), "attach" => "style=''"); + $field3 = array("string" => " ", "attach" => "style='width:136px;'"); + $field4 = array("string" => " ", "attach" => "style='width:60px;border-right:0px;text-align:right;'"); $divlist->AddEntry(array($field1,$field2,$field3,$field4)); } @@ -434,10 +434,10 @@ class groupManagement extends plugin }else{ $desc = " - [ ".$val['description'][0]." ]"; } - $field1 = array("string" => sprintf($userimg,$val['dn']),"attach"=>"style='width:20px;align:middle;'"); - $field2 = array("string" => sprintf($editlink,$key,($val['cn']['0'].$desc)),"attach"=>$title); - $field3 = array("string" => $posix." ".$enviro." ".$mail." ".$samba." ".$appl." ".$phone); - $field4 = array("string" => preg_replace("/%KEY%/", $key, $actions),"attach"=>"style='text-align:right;border:none;width:32px;'"); + $field1 = array("string" => sprintf($userimg,$val['dn']), "attach" => "style='text-align:center;width:20px;'"); + $field2 = array("string" => sprintf($editlink,$key,($val['cn']['0'].$desc)), "attach" => "style='' ".$title); + $field3 = array("string" => $posix." ".$enviro." ".$mail." ".$samba." ".$appl." ".$phone, "attach" => "style='width:136px;'"); + $field4 = array("string" => preg_replace("/%KEY%/", $key, $actions), "attach" => "style='width:60px;border-right:0px;text-align:right;'"); $divlist->AddEntry(array($field1,$field2,$field3,$field4)); } @@ -445,7 +445,7 @@ class groupManagement extends plugin /* Show main page */ $smarty->assign("grouplisthead", $listhead); $smarty->assign("grouplist", $divlist->DrawList()); - $smarty->assign("searchg_image", get_template_path('images/search_group.png')); + $smarty->assign("search_image", get_template_path('images/search.png')); $smarty->assign("searchu_image", get_template_path('images/search_user.png')); $smarty->assign("tree_image", get_template_path('images/tree.png')); $smarty->assign("infoimage", get_template_path('images/info.png')); @@ -463,7 +463,7 @@ class groupManagement extends plugin return($smarty->fetch(get_template_path('headpage.tpl', TRUE))); } - function reload() + function reload($CreatePosixsList=false) { /* Get config */ $groupfilter= get_global('groupfilter'); @@ -525,22 +525,27 @@ class groupManagement extends plugin * We also need to search for the departments * So we are able to navigate like in konquerer */ - $res3 = get_list2($this->ui->subtreeACL, "(&(|(ou=$regex)(description=$regex))(objectClass=gosaDepartment))", - FALSE, $base, 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]."]"; - }else{ - $this->departments[$value['dn']]=$value["description"][0]; + + /* Only needed if we are in GroupManagement */ + if(!$CreatePosixsList){ + $res3 = get_list2($this->ui->subtreeACL, "(&(|(ou=$regex)(description=$regex))(objectClass=gosaDepartment))", + FALSE, $base, 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]."]"; + }else{ + $this->departments[$value['dn']]=$value["description"][0]; + } } } + /* Ende department generation + */ /* Generate grouplist */ if ($filter != ""){ @@ -549,6 +554,9 @@ class groupManagement extends plugin $filter= "(&(|(memberUID=" . $groupfilter['guser'] . ")(cn=" . $groupfilter['guser'] . "))$filter)"; } } + + /* Depending on $CreatePosixsList we have to create different lists */ + if ($groupfilter['subsearch'] == "checked"){ $res= get_list($this->ui->subtreeACL, "$filter", FALSE, $base, array("cn", "description", "gidNumber"), TRUE); } else { @@ -573,15 +581,40 @@ class groupManagement extends plugin } $tmp=array(); - foreach($this->grouplist as $tkey => $val ){ - $tmp[strtolower($val['cn'][0]).$val['cn'][0]]=$val; - } - ksort($tmp); - $this->grouplist=array(); - foreach($tmp as $val){ - $this->grouplist[]=$val; + + /* If true ; this result is used for posix tab, group membership selection. */ + if($CreatePosixsList){ + + /* Addd to array */ + foreach($this->grouplist as $tkey => $val ){ + $tmp[strtolower($val['cn'][0]).$val['cn'][0]]=$val; + } + + /* Sort index */ + ksort($tmp); + + /* Recreate index array[dn]=cn[description]*/ + $this->grouplist=array(); + foreach($tmp as $val){ + if(isset($val['description'])){ + $this->grouplist[$val['dn']]=$val['cn'][0]." [".$val['description'][0]."]"; + }else{ + $this->grouplist[$val['dn']]=$val['cn'][0]; + } + } + }else{ + + /* Create result for group management listbox*/ + foreach($this->grouplist as $tkey => $val ){ + $tmp[strtolower($val['cn'][0]).$val['cn'][0]]=$val; + } + ksort($tmp); + $this->grouplist=array(); + foreach($tmp as $val){ + $this->grouplist[]=$val; + } + reset ($this->grouplist); } - reset ($this->grouplist); } function remove_from_parent()