From: hickert Date: Tue, 27 May 2008 10:25:29 +0000 (+0000) Subject: Updated object acl checks X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=83bb8e870e4ef8558170ff028d2398b193d85c90;p=gosa.git Updated object acl checks git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11025 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/plugins/admin/groups/class_divListGroup.inc b/gosa-core/plugins/admin/groups/class_divListGroup.inc index 0b6e1c30e..6c3304f2b 100644 --- a/gosa-core/plugins/admin/groups/class_divListGroup.inc +++ b/gosa-core/plugins/admin/groups/class_divListGroup.inc @@ -164,8 +164,7 @@ class divListGroup extends MultiSelectWindow } /* Get acls */ - $acls = $ui->get_permissions($this->selectedBase,"groups/group"); - $acl_all= $ui->has_complete_category_acls($this->selectedBase,"groups"); + $acl = $ui->get_permissions($this->selectedBase,"groups/group"); /* Add default header */ @@ -176,15 +175,13 @@ class divListGroup extends MultiSelectWindow "  "; - - /* Create Layers menu */ + /* Create Layers menu */ $s = ".|"._("Actions")."|\n"; - $s .= "..|". - " "._("Create")."|\n"; - /* Append create options */ - if(preg_match("/c/",$acl_all)) { + if(preg_match("/c/",$acl)) { + $s .= "..|". + " "._("Create")."|\n"; $s.= "...|". " "._("Group")."|group_new|\n"; } @@ -208,20 +205,24 @@ class divListGroup extends MultiSelectWindow } /* Add multiple copy & cut icons */ - if(is_object($this->parent->CopyPasteHandler) && preg_match("/(c.*w|w.*c)/",$acl_all)){ - $s.= "..|---|\n"; + $acl_all= $ui->has_complete_category_acls($this->selectedBase,"groups"); + + if(is_object($this->parent->CopyPasteHandler) && preg_match("/r/",$acl_all)){ $s.= "..|". " "._("Copy")."|"."multiple_copy_systems|\n"; + } + if(is_object($this->parent->CopyPasteHandler) && preg_match("/(r.*d|d.*r)/",$acl_all)){ $s.= "..|". " "._("Cut")."|"."multiple_cut_systems|\n"; + } - if($this->parent->CopyPasteHandler->entries_queued()){ - $img = ""; - $s.="..|".$img." "._("Paste")."|editPaste|\n"; - }else{ - $img = ""; - $s.="..|".$img." "._("Paste")."\n"; - } + /* Copy & paste icons */ + if(is_object($this->parent->CopyPasteHandler) && $this->parent->CopyPasteHandler->entries_queued()){ + $img = ""; + $s.="..|".$img." "._("Paste")."|editPaste|\n"; + }else{ + $img = ""; + $s.="..|".$img." "._("Paste")."\n"; } /* Add snapshot icons */ @@ -295,14 +296,21 @@ class divListGroup extends MultiSelectWindow /* Create action icons - copy & paste icons */ $acl = $ui->get_permissions($val['dn'],"groups/group"); - $acl_all= $ui->has_complete_category_acls($val['dn'],"groups"); + $acl_all = $ui->has_complete_category_acls($val['dn'],"groups"); $actions= ""; - if(($this->parent->CopyPasteHandler) && preg_match("/(c.*w|w.*c)/",$acl_all)){ + if(preg_match("/(r.*d|r.*d)/",$acl_all) && $this->parent->CopyPasteHandler){ $actions.= " "; + }else{ + $actions.="  "; + } + + if(preg_match("/r/",$acl_all) && $this->parent->CopyPasteHandler){ $actions.= " "; + }else{ + $actions.="  "; } /* Add edit icon */ @@ -310,16 +318,21 @@ class divListGroup extends MultiSelectWindow src='images/lists/edit.png' alt='"._("edit")."' name='group_edit_%KEY%' title='"._("Edit this entry")."'>"; /* Add snapshot functionality */ - if(preg_match("/(c.*w|w.*c)/", $acl_all)){ + if(preg_match("/(r.*w|w.*r)/",$acl_all)){ $actions.= $this->GetSnapShotActions($val['dn']); + }else{ + $actions.="  "; + $actions.="  "; } if(preg_match("/d/",$acl)){ $actions.= ""; + }else{ + $actions.= " "; } - $posix=$mail=$samba=$appl=$phone=$enviro=$empty; if(isset($val['objectClass'])){ diff --git a/gosa-core/plugins/admin/users/class_divListUsers.inc b/gosa-core/plugins/admin/users/class_divListUsers.inc index ea408b79e..e8da8760b 100644 --- a/gosa-core/plugins/admin/users/class_divListUsers.inc +++ b/gosa-core/plugins/admin/users/class_divListUsers.inc @@ -154,6 +154,7 @@ class divListUsers extends MultiSelectWindow /* Get copy & paste icon */ $acl = $ui->get_permissions($this->selectedBase,"users/user"); + $acl_all = $ui->has_complete_category_acls($this->selectedBase,"users"); /* Add default header */ $listhead = MultiSelectWindow::get_default_header(); @@ -198,8 +199,6 @@ class divListUsers extends MultiSelectWindow } } - /* Add multiple copy & cut icons */ - $acl_all = $ui->has_complete_category_acls($this->selectedBase,"users"); if(is_object($this->parent->CopyPasteHandler) && preg_match("/r/",$acl_all)){ $s.= "..|---|\n"; @@ -307,14 +306,16 @@ class divListUsers extends MultiSelectWindow /* Add copy & cut icons */ $acl = $ui->get_permissions($val['dn'],"users/user"); - if(preg_match("/(r.*d|r.*d)/",$acl) && $this->parent->CopyPasteHandler){ + $acl_all = $ui->has_complete_category_acls($val['dn'],"users"); + + if(preg_match("/(r.*d|r.*d)/",$acl_all) && $this->parent->CopyPasteHandler){ $action .= " "; }else{ $action.="  "; } - if(preg_match("/r/",$acl) && $this->parent->CopyPasteHandler){ + if(preg_match("/r/",$acl_all) && $this->parent->CopyPasteHandler){ $action.= " "; }else{ @@ -341,7 +342,7 @@ class divListUsers extends MultiSelectWindow name='user_edit_%KEY%' title='".msgPool::editButton(_("user"))."'>"; /* Add deactivate status if we are allowed to */ - if (preg_match("/w/",$acl)){ + if (preg_match("/w/",$ui->get_permissions($val['dn'],"users/password"))){ $action.= $lock_status; }else{ $action.=" "; @@ -357,7 +358,7 @@ class divListUsers extends MultiSelectWindow } /* Add snapshot icon */ - if(preg_match("/(r.*w|w.*r)/",$acl)){ + if(preg_match("/(r.*w|w.*r)/",$acl_all)){ $action.= $this->GetSnapShotActions($val['dn']); }else{ $action.="  "; @@ -365,7 +366,7 @@ class divListUsers extends MultiSelectWindow } /* Add remove icon, if we are allowed to remove the current user */ - if(preg_match("/d/",$ui->get_permissions($val['dn'],"users/user"))) { + if(preg_match("/d/",$acl)) { $action.= ""; }else{