diff --git a/gosa-core/plugins/admin/acl/class_divListACL.inc b/gosa-core/plugins/admin/acl/class_divListACL.inc
index fad49a5ae4734a7b58fe7e3a69695105f786a03c..5d78f82b3d30000c07e2858003745b4df334ab23 100644 (file)
function divListACL (&$config, &$parent)
{
function divListACL (&$config, &$parent)
{
- MultiSelectWindow::MultiSelectWindow($config, "ACL", "acl");
+ MultiSelectWindow::MultiSelectWindow($config, "ACL", array("acl","acl"));
$this->parent = &$parent;
$this->ui = get_userinfo();
$this->parent = &$parent;
$this->ui = get_userinfo();
$this->action_col_size = 120;
/* Toggle all selected / deselected */
$this->action_col_size = 120;
/* Toggle all selected / deselected */
- $chk = "<input type='checkbox' id='select_all' name='select_all'
+ $chk = "<input type='checkbox' id='select_all' name='select_all' title='"._("Select all")."'
onClick='toggle_all_(\"^item_selected_[0-9]*$\",\"select_all\");' >";
/* set Page header */
onClick='toggle_all_(\"^item_selected_[0-9]*$\",\"select_all\");' >";
/* set Page header */
function GenHeader()
{
function GenHeader()
{
- /* Prepare departments,
- which are shown in the listbox on top of the listbox
- */
- $options= "";
- $Copy_Paste = "";
-
/* Get all departments within this subtree */
$ui= get_userinfo();
/* Get all departments within this subtree */
$ui= get_userinfo();
- $first = "";
- $found = FALSE;
$base = $this->config->current['BASE'];
$base = $this->config->current['BASE'];
-
- /* Add base */
- $tmp = array();
- $tmp[] = array("dn"=>$this->config->current['BASE']);
- $tmp= array_merge($tmp,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base,
- array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH));
-
- $deps = array();
- foreach($tmp as $tm){
- $deps[$tm['dn']] = $tm['dn'];
- }
-
- /* Load possible departments */
- $ui= get_userinfo();
- $tdeps= $ui->get_module_departments("acl");
- $ids = $this->config->idepartments;
- $first = "";
- $found = FALSE;
- foreach($ids as $dep => $name){
- if(isset($deps[$dep]) && in_array_ics($dep, $tdeps)){
-
- /* Keep first base dn in mind, we could need this
- * info if no valid base was found
- */
- if(empty($first)) {
- $first = $dep['dn'];
- }
-
- $value = $ids[$dep];
- if ($this->selectedBase == $dep){
- $found = TRUE;
- $options.= "<option selected='selected' value='".$dep."'>$value</option>";
- } else {
- $options.= "<option value='".$dep."'>$value</option>";
- }
- }
- }
-
- /* The currently used base is not visible with your acl setup.
- * Set base to first useable base.
- */
- if(!$found){
- $this->selectedBase = $first;
- }
+ $options = $this->create_department_list($this->module);
/* Allow copy & paste for roles */
$acl_all = $ui->has_complete_category_acls($this->selectedBase,"acl");
/* Allow copy & paste for roles */
$acl_all = $ui->has_complete_category_acls($this->selectedBase,"acl");
$listhead = MultiSelectWindow::get_default_header();
$listhead .=
_("Base")." <select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
$listhead = MultiSelectWindow::get_default_header();
$listhead .=
_("Base")." <select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
- " <input class='center' type='image' src='images/list_submit.png' align='middle'
+ " <input class='center' type='image' src='images/lists/submit.png' align='middle'
title='"._("Submit department")."' name='submit_department' alt='". _("Submit")."'> ";
/* Create Layers menu */
$s = ".|"._("Actions")."|\n";
title='"._("Submit department")."' name='submit_department' alt='". _("Submit")."'> ";
/* Create Layers menu */
$s = ".|"._("Actions")."|\n";
- $s .= "..|<img src='images/list_new.png' alt='' border='0' class='center'>".
- " "._("Create")."|\n";
-
/* Append create options */
if(preg_match("/c/",$acl)) {
/* Append create options */
if(preg_match("/c/",$acl)) {
- $s.= "...|<input class='center' type='image' src='images/list_new_acl_role.png' alt=''>".
+ $s .= "..|<img src='images/lists/new.png' alt='' border='0' class='center'>".
+ " "._("Create")."|\n";
+ $s.= "...|<input class='center' type='image' src='plugins/acl/images/new-role.png' alt=''>".
" "._("Role")."|new_acl_role|\n";
}
" "._("Role")."|new_acl_role|\n";
}
- /* Multiple options */
- $s.= "..|---|\n";
$s.= "..|<img src='images/lists/trash.png' alt='' border='0' class='center'>".
" "._("Remove")."|"."remove_multiple|\n";
$s.= "..|<img src='images/lists/trash.png' alt='' border='0' class='center'>".
" "._("Remove")."|"."remove_multiple|\n";
- /* Add multiple copy & cut icons */
- if(is_object($this->parent->CopyPasteHandler)){
- $s.= "..|---|\n";
- $s.= "..|<img src='images/lists/copy.png' alt='' border='0' class='center'>".
- " "._("Copy")."|"."multiple_copy_systems|\n";
- $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
- " "._("Cut")."|"."multiple_cut_systems|\n";
-
- if($this->parent->CopyPasteHandler->entries_queued()){
- $img = "<img border='0' class='center' src='images/lists/paste.png' alt=''>";
- $s.="..|".$img." "._("Paste")."|editPaste|\n";
- }else{
- $img = "<img border='0' class='center' src='images/lists/paste.png' alt=''>";
- $s.="..|".$img." "._("Paste")."\n";
- }
- }
- /* Add snapshot icons */
- if(preg_match("/(c.*w|w.*c)/",$acl_all)){
- $str = $this->get_snapshot_header(TRUE) ;
- if(!empty($str)){
- $s .= "..|---|\n";
- $s .= $str;
- }
- }
+ /* Add Copy & Paste header */
+ $s .= $this->parent->get_copypaste_header($this->selectedBase,$this->module);
+
+ $s .= $this->parent->get_snapshot_header($this->selectedBase,$this->module);
$this->SetDropDownHeaderMenu($s);
$this->SetListHeader($listhead);
$this->SetDropDownHeaderMenu($s);
$this->SetListHeader($listhead);
function setEntries($list)
{
function setEntries($list)
{
-
+ $ui = get_userinfo();
foreach($list as $key => $acl_entry){
foreach($list as $key => $acl_entry){
- /* Get copy & paste icon */
- $acl = $this->ui->get_permissions($acl_entry['dn'],"acl/acl");
- $acl_all = $this->ui->has_complete_category_acls($acl_entry['dn'],"acl");
$action = "";
$action = "";
+ /* Handle ACL role entries
+ */
if(in_array("gosaRole",$acl_entry['objectClass'])){
if(in_array("gosaRole",$acl_entry['objectClass'])){
- /* Role handling */
+ $acl = $this->ui->get_permissions($acl_entry['dn'],"acl/aclrole");
+ $acl_all = $this->ui->has_complete_category_acls($acl_entry['dn'],"acl");
+
$editlink = "<a href='?plug=".$_GET['plug']."&id=%s&act=list_edit_role'>%s</a>";
$editlink = "<a href='?plug=".$_GET['plug']."&id=%s&act=list_edit_role'>%s</a>";
- $list_left_icon = "<img src='images/select_acl_role.png' alt='"._("Role")."'>";
+ $list_left_icon = "<img src='plugins/acl/images/role.png' alt='"._("Role")."'>";
$cn = htmlentities(utf8_decode($acl_entry['cn'][0])) ;
if(isset($acl_entry['description'][0])){
$cn .= " [".$acl_entry['description'][0]."]";
}
$cn = htmlentities(utf8_decode($acl_entry['cn'][0])) ;
if(isset($acl_entry['description'][0])){
$cn .= " [".$acl_entry['description'][0]."]";
}
- /* Add copy & paste handler */
- if(($this->parent->CopyPasteHandler) && preg_match("/(c.*w|w.*c)/",$acl_all)){
- $action.= "<input class='center' type='image'
- src='images/lists/cut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
- $action.= "<input class='center' type='image'
- src='images/lists/copy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
- }
+ /* Add copy & cut functionality */
+ $action.= $this->parent->get_copypaste_action($acl_entry['dn'],"acl","aclRole");
/* Add actions depending on acls */
if(preg_match("/r/", $acl)){
/* Add actions depending on acls */
if(preg_match("/r/", $acl)){
}
/* Add snapshot functionality */
}
/* Add snapshot functionality */
- if(preg_match("/(c.*w|w.*c)/", $acl_all)){
- $action.= $this->GetSnapShotActions($acl_entry['dn']);
- }
+ $action.= $this->parent->get_snapshot_action($acl_entry['dn'],"acl");
- if(preg_match("/d/", $acl)){
- $action.= "<input class='center' type='image' src='images/lists/trash.png' alt='"._("delete")."'
- name='list_acl_role_del_%KEY%' title='"._("Delete acl role")."'>";
- }
}else{
}else{
+ /* Handle non-role ACL entries */
+ $acl = $this->ui->get_permissions($acl_entry['dn'],"acl/acl");
+ $acl_all = $this->ui->has_complete_category_acls($acl_entry['dn'],"acl");
+
/* Acl handling */
$editlink = "<a href='?plug=".$_GET['plug']."&id=%s&act=list_edit_entry'>%s</a>";
/* Acl handling */
$editlink = "<a href='?plug=".$_GET['plug']."&id=%s&act=list_edit_entry'>%s</a>";
- $list_left_icon = "<img src='images/select_acl.png' alt='"._("ACL")."'>";
- $cn = htmlentities(utf8_decode($acl_entry['dn']));
+ $list_left_icon = "<img src='images/lists/locked.png' alt='"._("ACL")."'>";
+ $cn = preg_replace('/\\\\,/', ',', LDAP::fix($acl_entry['dn']));
/* Add actions depending on acls */
if(preg_match("/r/", $acl)){
$action.= "<input class='center' type='image' src='images/lists/edit.png' alt='"._("edit")."'
name='list_acl_edit_%KEY%' title='"._("Edit acl")."'>";
}
/* Add actions depending on acls */
if(preg_match("/r/", $acl)){
$action.= "<input class='center' type='image' src='images/lists/edit.png' alt='"._("edit")."'
name='list_acl_edit_%KEY%' title='"._("Edit acl")."'>";
}
- if(preg_match("/d/", $acl)){
- $action.= "<input class='center' type='image' src='images/lists/trash.png' alt='"._("delete")."'
- name='list_acl_del_%KEY%' title='"._("Delete acl")."'>";
- }
}
}
- if(in_array("gosaRole",$acl_entry['objectClass'])){
- $field0 = array("string" => "<input type='checkbox' id='item_selected_".$key."' name='item_selected_".$key."'>" ,
- "attach" => "style='width:20px;'");
- }else{
- $field0 = array("string" => "", "attach" => "style='width:20px;'");
+ /* Add delete actions */
+ if(preg_match("/d/", $acl)){
+ $action.= "<input class='center' type='image' src='images/lists/trash.png' alt='"._("delete")."'
+ name='list_acl_del_%KEY%' title='"._("Delete acl")."'>";
}
}
+
+ /* Add a checkbox in front of each entry
+ */
+ $field0 = array("string" => "<input type='checkbox' id='item_selected_".$key."' name='item_selected_".$key."'>" ,
+ "attach" => "style='width:20px;'");
/* Cutted objects should be displayed in light grey */
$display = $cn;
/* Cutted objects should be displayed in light grey */
$display = $cn;
}
}
}
}
}
}
-
- $field1 = array("string" => $list_left_icon, "attach"=> "style='text-align:center;width:20px;'");
- $field2 = array("string" => sprintf($editlink,$key,$display)." ","attach" => "");
- $field3 = array("string" => preg_replace("/%KEY%/",$key,$action), "attach"=> "style='text-align:right;width:".$this->action_col_size."px;border-right:0px;'");
+
+ $field1 = array("string" => $list_left_icon,
+ "attach"=> "style='text-align:center;width:20px;'");
+ $field2 = array("string" => sprintf($editlink,$key,$display)." ",
+ "attach" => "");
+ $field3 = array("string" => preg_replace("/%KEY%/",$key,$action),
+ "attach"=> "style='text-align:right;width:".$this->action_col_size."px;border-right:0px;'");
$this->AddElement(array($field0,$field1,$field2,$field3));
}
}
$this->AddElement(array($field0,$field1,$field2,$field3));
}
}
+
function Save()
{
MultiSelectWindow :: Save();
function Save()
{
MultiSelectWindow :: Save();