From: hickert Date: Mon, 21 Apr 2008 11:04:47 +0000 (+0000) Subject: Updated ogroups - Fixed error messages if classes were not available X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3cee55fb7c60f702660ac0066cee99148e6e13fd;p=gosa.git Updated ogroups - Fixed error messages if classes were not available git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10581 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/plugins/admin/ogroups/class_ogroup.inc b/gosa-core/plugins/admin/ogroups/class_ogroup.inc index ad7bce312..398eed814 100644 --- a/gosa-core/plugins/admin/ogroups/class_ogroup.inc +++ b/gosa-core/plugins/admin/ogroups/class_ogroup.inc @@ -432,16 +432,26 @@ class ogroup extends plugin Generate Filter ###########*/ - $p_f= array("accounts" => array("CLASS"=>"gosaAccount" ,"DN"=> get_people_ou() ,"ACL" => "users"), - "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"), - "workstations" => array("CLASS"=>"gotoWorkstation","DN"=> get_ou('workstationou') ,"ACL" => "workstation"), - "winstations" => array("CLASS"=>"opsiClient", "DN"=> get_ou('WINSTATIONS') ,"ACL" => "winstation"), - "terminals" => array("CLASS"=>"gotoTerminal" ,"DN"=> get_ou('terminalou') ,"ACL" => "terminal"), - "printers" => array("CLASS"=>"gotoPrinter" ,"DN"=> get_ou('printerou') ,"ACL" => "printer"), - "phones" => array("CLASS"=>"goFonHardware" ,"DN"=> get_ou('phoneou') ,"ACL" => "phone")); + $p_f= array("accounts"=> array("OBJ"=>"user", "CLASS"=>"gosaAccount" , + "DN"=> get_people_ou() ,"ACL" => "users"), + "groups" => array("OBJ"=>"group", "CLASS"=>"posixGroup" , + "DN"=> get_groups_ou('ogroupou') ,"ACL" => "groups"), + "applications" => array("OBJ"=>"application", "CLASS"=>"gosaApplication", + "DN"=> get_ou('applicationou') ,"ACL" => "application"), + "departments" => array("OBJ"=>"department", "CLASS"=>"gosaDepartment" , + "DN"=> "" ,"ACL" => "department"), + "servers" => array("OBJ"=>"servgeneric", "CLASS"=>"goServer" , + "DN"=> get_ou('serverou') ,"ACL" => "server"), + "workstations" => array("OBJ"=>"workgeneric", "CLASS"=>"gotoWorkstation", + "DN"=> get_ou('workstationou') ,"ACL" => "workstation"), + "winstations" => array("OBJ"=>"wingeneric", "CLASS"=>"opsiClient", + "DN"=> get_ou('WINSTATIONS') ,"ACL" => "winstation"), + "terminals" => array("OBJ"=>"termgeneric", "CLASS"=>"gotoTerminal" , + "DN"=> get_ou('terminalou') ,"ACL" => "terminal"), + "printers" => array("OBJ"=>"printgeneric", "CLASS"=>"gotoPrinter" , + "DN"=> get_ou('printerou') ,"ACL" => "printer"), + "phones" => array("OBJ"=>"phoneGeneric", "CLASS"=>"goFonHardware" , + "DN"=> get_ou('phoneou') ,"ACL" => "phone")); /*########### @@ -455,14 +465,15 @@ class ogroup extends plugin foreach($p_f as $post_name => $data){ - if($ogfilter[$post_name] == "checked"){ + if($ogfilter[$post_name] == "checked" && class_available($data['OBJ'])){ if($ogfilter['subtrees']){ $base = $ogfilter['dselect']; }else{ $base = $data['DN'].$ogfilter['dselect']; } - + + $filter = "(&(objectClass=".$data['CLASS'].")(|(uid=$regex)(cn=$regex)(ou=$regex)))"; $res = get_list($filter, $data['ACL'] , $base, array("description", "objectClass", "sn", "givenName", "uid","ou","cn"),$Get_list_flags); diff --git a/gosa-core/plugins/admin/ogroups/tabs_ogroups.inc b/gosa-core/plugins/admin/ogroups/tabs_ogroups.inc index 5cd066577..e5654cd73 100644 --- a/gosa-core/plugins/admin/ogroups/tabs_ogroups.inc +++ b/gosa-core/plugins/admin/ogroups/tabs_ogroups.inc @@ -277,19 +277,20 @@ class ogrouptabs extends tabs case "U": /* Append a PhoneQueue, if objectClass = goFonAccount */ $use = false; - foreach($this->by_object['ogroup']->memberList as $dn => $val){ - $obj = $this->by_object['ogroup']->objcache[$dn]; - - if(isset($obj['objectClass'])){ - if(in_array("goFonAccount",$obj['objectClass'])){ - $use = true; + /* We found goFonAccount in users objectClasses*/ + if(class_available("phonequeue")){ + foreach($this->by_object['ogroup']->memberList as $dn => $val){ + + $obj = $this->by_object['ogroup']->objcache[$dn]; + + if(isset($obj['objectClass'])){ + if(in_array("goFonAccount",$obj['objectClass'])){ + $use = true; + } } } - } - /* We found goFonAccount in users objectClasses*/ - if(class_available("phonequeue")){ if($use){ $this->by_name['phonequeue']= _("Phone queue"); $this->by_object['phonequeue']= new phonequeue($this->config, $this->dn);