summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f6c356c)
raw | patch | inline | side by side (parent: f6c356c)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 8 Nov 2006 09:17:46 +0000 (09:17 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 8 Nov 2006 09:17:46 +0000 (09:17 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5041 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/plugins/admin/groups/class_divListGroup.inc b/plugins/admin/groups/class_divListGroup.inc
index b46e8ee0826dbf74225b9bd84e0dde0ea7b50b01..63062265b9a8bb69ae2d1fa3ee15edfab1355761 100644 (file)
$acls = $ui->get_permissions($this->selectedBase,"groups/group");
/* Get copy & paste icon */
- if(preg_match("/w/",$acls) && $this->parent->CopyPasteHandler){
+ if(preg_match("/(c.*w|w.*c)/",$acls) && $this->parent->CopyPasteHandler){
$Copy_Paste = $this->parent->CopyPasteHandler->generatePasteIcon();
}else{
$Copy_Paste ="";
foreach($groups as $key => $val){
/* Create action icons - copy & paste icons */
+ $acl = $ui->get_permissions($val['dn'],"groups/group");
+
$actions= "";
- if(($this->parent->CopyPasteHandler) && preg_match("/w/",$ui->get_category_permissions($val['dn'],"group"))){
+ if(($this->parent->CopyPasteHandler) && preg_match("/(c.*w|w.*c)/",$acl)){
$actions.= "<input class='center' type='image'
src='images/editcut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
$actions.= "<input class='center' type='image'
src='images/editcopy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
}
+ /* Add edit icon */
$actions.= "<input class='center' type='image'
src='images/edit.png' alt='"._("edit")."' name='group_edit_%KEY%' title='"._("Edit this entry")."'>";
- if(preg_match("/w/",$ui->get_permissions($val['dn'],"groups/group"))){
+ /* Add snapshot functionality */
+ if(preg_match("/(c.*w|w.*c)/", $acl)){
$actions.= $this->GetSnapShotActions($val['dn']);
}
- if(preg_match("/d/",$ui->get_permissions($val['dn'],"groups/group"))){
+ if(preg_match("/d/",$acl)){
$actions.= "<input class='center' type='image'
src='images/edittrash.png' alt='"._("delete")."' name='group_del_%KEY%' title='"._("Delete this entry")."'>";
}
diff --git a/plugins/admin/groups/class_groupManagement.inc b/plugins/admin/groups/class_groupManagement.inc
index 80b567a04e93aff62f55da60e60e9f9aaf82f7a3..7158c1090fa0f3831170097f221858dedcda69f6 100644 (file)
/* Copy current object to CopyHandler
*/
if($s_action == "copy"){
- $this->CopyPasteHandler->Clear();
$dn = $this->grouplist[trim($s_entry)]['dn'];
- $acl = get_permissions ($dn, $this->ui->subtreeACL);
-
- $obj = new grouptabs($this->config,$this->config->data['TABS']['GROUPTABS'], $dn);
- $obj->set_acl_base($dn);
- $objNew = new grouptabs($this->config,$this->config->data['TABS']['GROUPTABS'], "new");
- $obj->set_acl_base($dn);
-
- $this->CopyPasteHandler->Copy($obj,$objNew);
+ $acl = $this->ui->get_permissions($dn,"groups/group");
+ if(preg_match("/(c.*w|w.*c)/",$acl)){
+
+ $this->CopyPasteHandler->Clear();
+ $obj = new grouptabs($this->config,$this->config->data['TABS']['GROUPTABS'], $dn);
+ $obj->set_acl_base($dn);
+ $objNew = new grouptabs($this->config,$this->config->data['TABS']['GROUPTABS'], "new");
+ $obj->set_acl_base($dn);
+
+ $this->CopyPasteHandler->Copy($obj,$objNew);
+ }else{
+ print_red("You are not allowed to copy this entry.");
+ }
}
/* Copy current object to CopyHandler
*/
if($s_action == "cut"){
- $this->CopyPasteHandler->Clear();
- $dn = $this->grouplist[trim($s_entry)]['dn'];
- $acl= get_permissions ($dn, $this->ui->subtreeACL);
+ $acl = $this->ui->get_permissions($dn,"groups/group");
+ if(preg_match("/(c.*w|w.*c)/",$acl)){
- $obj= new grouptabs($this->config,$this->config->data['TABS']['GROUPTABS'], $dn);
- $obj->set_acl_base($dn);
+ $this->CopyPasteHandler->Clear();
+ $dn = $this->grouplist[trim($s_entry)]['dn'];
+ $acl= get_permissions ($dn, $this->ui->subtreeACL);
- $this->CopyPasteHandler->Cut($obj);
+ $obj= new grouptabs($this->config,$this->config->data['TABS']['GROUPTABS'], $dn);
+ $obj->set_acl_base($dn);
+
+ $this->CopyPasteHandler->Cut($obj);
+ }else{
+ print_red("You are not allowed to cut this entry.");
+ }
}
}
diff --git a/plugins/admin/users/class_userManagement.inc b/plugins/admin/users/class_userManagement.inc
index 5cf79f71e1bf2e400892b2721fe38a8510ef08da..daa147d92741f7c44fdfe6d3a5892a645123d653 100644 (file)
if($s_action == "copy"){
$this->CopyPasteHandler->Clear();
$dn= $this->list[trim($s_entry)]['dn'];
- $obj = new usertabs($this->config, $this->config->data['TABS']['USERTABS'], $dn);
- $obj->set_acl_base($dn);
- $objNew = new usertabs($this->config, $this->config->data['TABS']['USERTABS'], "new");
- $objNew->set_acl_base($dn);
- $this->CopyPasteHandler->Copy($obj,$objNew);
+ /* Check acl */
+ $acl = $this->ui->get_permissions($dn,"users/user");
+ if(preg_match("/(c.*w|w.*c)/",$acl)){
+ $obj = new usertabs($this->config, $this->config->data['TABS']['USERTABS'], $dn);
+ $obj->set_acl_base($dn);
+ $objNew = new usertabs($this->config, $this->config->data['TABS']['USERTABS'], "new");
+ $objNew->set_acl_base($dn);
+
+ $this->CopyPasteHandler->Copy($obj,$objNew);
+ }else{
+ print_red("You are not allowed to copy this entry.");
+ }
}
/* Cut selected object.
if($s_action == "cut"){
$this->CopyPasteHandler->Clear();
$dn= $this->list[trim($s_entry)]['dn'];
- $obj= new usertabs($this->config, $this->config->data['TABS']['USERTABS'], $dn);
- $obj->set_acl_base($dn);
- $this->CopyPasteHandler->Cut($obj);
+
+ /* Check acl */
+ $acl = $this->ui->get_permissions($dn,"users/user");
+ if(preg_match("/(c.*w|w.*c)/",$acl)){
+ $obj= new usertabs($this->config, $this->config->data['TABS']['USERTABS'], $dn);
+ $obj->set_acl_base($dn);
+ $this->CopyPasteHandler->Cut($obj);
+ }else{
+ print_red("You are not allowed to cut this entry.");
+ }
}
}
}