From: hickert Date: Wed, 12 Jul 2006 04:35:20 +0000 (+0000) Subject: Added checkboxes to filter X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=46ccf08f0aaa3f7d779af1d6e223b301f25efbb8;p=gosa.git Added checkboxes to filter git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4108 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/acl/class_aclManagement.inc b/plugins/admin/acl/class_aclManagement.inc index 0dcc48b7e..a0d333196 100644 --- a/plugins/admin/acl/class_aclManagement.inc +++ b/plugins/admin/acl/class_aclManagement.inc @@ -227,15 +227,6 @@ class aclManagement extends plugin /* Save, or display error message? */ if (count($message) == 0){ - /* No errors. Go ahead and prepare to ask for a password - in case we're creating a new acl. 'dn' will be 'new' - in this case. It is set to the correct value later. */ - if ($this->dn == "new"){ - $set_pass= 1; - } else { - $set_pass= 0; - } - /* Save acl data to ldap */ if($this->acltabs->save() == 1){ gosa_log ("ACL object '".$this->dn."' saving failed."); diff --git a/plugins/admin/acl/class_divListACL.inc b/plugins/admin/acl/class_divListACL.inc index 2e0e3c1c6..d320d2e29 100644 --- a/plugins/admin/acl/class_divListACL.inc +++ b/plugins/admin/acl/class_divListACL.inc @@ -18,6 +18,8 @@ class divListACL extends MultiSelectWindow var $parent ; var $ui ; + + function divListACL ($config,$parent) { MultiSelectWindow::MultiSelectWindow($config,"ACLs"); @@ -46,11 +48,15 @@ class divListACL extends MultiSelectWindow $this->AddHeader(array("string"=>" ", "attach"=>"style='width:20px;'")); $this->AddHeader(array("string"=>_("Summary"))); $this->AddHeader(array("string"=>_("Actions"), "attach" => "style='width:".$action_col_size."px;border-right:0px;text-align:right;'")); - + + /* Set dynamically filter checkboxes */ + $this->set_filter_objectclasses(); + /* Add SubSearch checkbox */ -// $this->AddCheckBox(SEPERATOR); + $this->AddCheckBox(SEPERATOR); $this->AddCheckBox("SubSearch", _("Select to search within subtrees"), _("Ignore subtrees"), false); + /* Name ,Text ,Default , Connect with alphabet */ $this->AddRegex ("Regex", _("Display acls matching"),"Not implemented yet" , true); } @@ -104,15 +110,25 @@ class divListACL extends MultiSelectWindow foreach($list as $key => $acl_entry){ - $action = ""; - $action.= $this->GetSnapShotActions($acl_entry['dn']); - $action.= ""; - - $field1 = array("string" => $list_left_icon, "attach"=> "style='text-align:center;width:20px;'"); - $field2 = array("string" => htmlentities(utf8_decode($acl_entry['dn'])),"attach" => ""); - $field3 = array("string" => preg_replace("/%KEY%/",$key,$action), "attach"=> "style='text-align:center;width:80px;border-right:0px;'"); + $skip = true; + foreach($this->get_filter_objectclasses() as $oc){ + if(in_array($oc,$acl_entry['objectClass']) && $this->$oc){ + $skip = false; + } + } - $this->AddElement(array($field1,$field2,$field3)); + if(!$skip){ + $action = ""; + $action.= $this->GetSnapShotActions($acl_entry['dn']); + $action.= ""; + + $field1 = array("string" => $list_left_icon, "attach"=> "style='text-align:center;width:20px;'"); + $field2 = array("string" => htmlentities(utf8_decode($acl_entry['dn']))." ","attach" => ""); + $field3 = array("string" => preg_replace("/%KEY%/",$key,$action), "attach"=> "style='text-align:center;width:80px;border-right:0px;'"); + $this->AddElement(array($field1,$field2,$field3)); + } } } @@ -126,6 +142,25 @@ class divListACL extends MultiSelectWindow /* Save automatic created POSTs like regex, checkboxes */ MultiSelectWindow::save_object(); } + + + /* Add some additional checkboxes to the filter part, this should be generated dynamically. */ + function set_filter_objectclasses() + { + #FIXME This should be created dynamically + $this->gosaAccount = true; + $this->AddCheckBox("gosaAccount", _("Select to display users"), _("Display user") , true); + $this->gosaDepartment = true; + $this->AddCheckBox("gosaDepartment", _("Select to display departments"), _("Display departments"), true); + } + + + /* Return objectClass names used in filter part */ + function get_filter_objectclasses() + { + return(array("gosaAccount","gosaDepartment")); + } + } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?>