summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 95bc386)
raw | patch | inline | side by side (parent: 95bc386)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 29 May 2008 06:12:56 +0000 (06:12 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 29 May 2008 06:12:56 +0000 (06:12 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11090 594d385d-05f5-0310-b6e9-bd551577e9d8
27 files changed:
index 5f68ac99989044c9f93fe27fa87b582c264b41d0..45f6a1324ad44fa32f80de5c5e0f26ace5dec402 100644 (file)
}
+ function is_copyable($dn, $object, $class)
+ {
+ return(preg_match("/r/",$this->has_complete_category_acls($dn, $object)));
+ }
+
+ function is_cutable($dn, $object, $class)
+ {
+ $remove = preg_match("/d/",$this->get_permissions($dn,$object."/".$class));
+ $read = preg_match("/r/",$this->has_complete_category_acls($dn, $object));
+ return($remove && $read);
+ }
+
+ function is_pasteable($dn, $object, $class)
+ {
+ return(preg_match("/w/",$this->has_complete_category_acls($dn, $object)));
+ }
+
function get_permissions($dn, $object, $attribute= "", $skip_write= FALSE)
{
/* If we are forced to skip ACLs checks for the current user
diff --git a/gosa-core/plugins/admin/acl/class_aclManagement.inc b/gosa-core/plugins/admin/acl/class_aclManagement.inc
index 1eded9773625814ff23d2a4bfaa232f6a4a2a033..7bf405a5027284716c1a25c3488182b3ecc57fd5 100644 (file)
$dn = $this->list[$s_entry]['dn'];
/* We can only copy & cut roles */
- if(isset($this->list[$id]['objectClass']) && in_array("gosaRole",$this->list[$s_entry]['objectClass'])){
- if($s_action == "copy" && preg_match("/r/",$ui->has_complete_category_acls($dn,"aclroles"))){
+ if(isset($this->list[$s_entry]['objectClass']) && in_array("gosaRole",$this->list[$s_entry]['objectClass'])){
+ if($s_action == "copy" && $ui->is_copyable($dn,"aclroles","aclrole")){
$this->CopyPasteHandler->add_to_queue($dn,$s_action,"aclroletab","ACLROLETAB","aclroles");
}
- if($s_action == "cut" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"aclroles"))){
+ if($s_action == "cut" && $ui->is_cutable($dn,"aclroles","aclrole")){
$this->CopyPasteHandler->add_to_queue($dn,$s_action,"aclroletab","ACLROLETAB","aclroles");
}
}
if(isset($this->list[$id]['objectClass']) && in_array("gosaRole",$this->list[$id]['objectClass'])){
- if($s_action == "copy_multiple" && preg_match("/r/",$ui->has_complete_category_acls($dn,"aclroles"))){
+ if($s_action == "copy_multiple" && $ui->is_copyable($dn,"aclroles","aclrole")){
$this->CopyPasteHandler->add_to_queue($dn,"copy","aclroletab","ACLROLETAB","aclroles");
}
- if($s_action == "cut_multiple" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"aclroles"))){
+ if($s_action == "cut_multiple" && $ui->is_cutable($dn,"aclroles","aclrole")){
$this->CopyPasteHandler->add_to_queue($dn,"cut","aclroletab","ACLROLETAB","aclroles");
}
}
diff --git a/gosa-core/plugins/admin/acl/class_divListACL.inc b/gosa-core/plugins/admin/acl/class_divListACL.inc
index 99c07ced49346b8a360e4b3ff21e4bfd688d5066..0da6caed1ea582981a2987224eac5f6c5983f867 100644 (file)
function setEntries($list)
{
-
+ $ui = get_userinfo();
foreach($list as $key => $acl_entry){
/* Get copy & paste icon */
}
/* Add copy & paste handler */
- if(($this->parent->CopyPasteHandler) && preg_match("/(c.*w|w.*c)/",$acl_all)){
- $action.= "<input class='center' type='image'
+ if($ui->is_cutable($acl_entry['dn'],"acl","aclRole") && $this->parent->CopyPasteHandler){
+ $action .= "<input class='center' type='image'
src='images/lists/cut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
+ }else{
+ $action.="<img src='images/empty.png' alt=' ' class='center'> ";
+ }
+
+ if($ui->is_copyable($acl_entry['dn'],"acl","aclRole") && $this->parent->CopyPasteHandler){
$action.= "<input class='center' type='image'
src='images/lists/copy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
+ }else{
+ $action.="<img src='images/empty.png' alt=' ' class='center'> ";
}
+
/* Add actions depending on acls */
if(preg_match("/r/", $acl)){
$action.= "<input class='center' type='image' src='images/lists/edit.png' alt='"._("edit")."'
diff --git a/gosa-core/plugins/admin/groups/class_divListGroup.inc b/gosa-core/plugins/admin/groups/class_divListGroup.inc
index 7edccb3d3492db6a80300511fb8acce9c8f195b7..d58ace3ed028541301ef58c33ce34cc079cd23cd 100644 (file)
$acl_all = $ui->has_complete_category_acls($val['dn'],"groups");
$actions= "";
- if(preg_match("/(r.*d|r.*d)/",$acl_all) && $this->parent->CopyPasteHandler){
- $actions.= "<input class='center' type='image'
+
+ if($ui->is_cutable($val['dn'],"groups","group") && $this->parent->CopyPasteHandler){
+ $actions .= "<input class='center' type='image'
src='images/lists/cut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
}else{
$actions.="<img src='images/empty.png' alt=' ' class='center'> ";
}
- if(preg_match("/r/",$acl_all) && $this->parent->CopyPasteHandler){
+ if($ui->is_copyable($val['dn'],"groups","group") && $this->parent->CopyPasteHandler){
$actions.= "<input class='center' type='image'
src='images/lists/copy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
}else{
diff --git a/gosa-core/plugins/admin/groups/class_groupManagement.inc b/gosa-core/plugins/admin/groups/class_groupManagement.inc
index f28e1664434a653e6264982fdf99e46c696ffdb0..70ae8ef626f943ee314eca70e62e7159ed06b05d 100644 (file)
/* Cleanup object queue */
$this->CopyPasteHandler->cleanup_queue();
$dn = $this->grouplist[$s_entry]['dn'];
- if($s_action == "copy" && preg_match("/r/",$ui->has_complete_category_acls($dn,"groups"))){
+ if($s_action == "copy" && $ui->is_copyable($dn,"groups","group")){
$this->CopyPasteHandler->add_to_queue($dn,$s_action,"grouptabs","GROUPTABS","groups");
}
- if($s_action == "cut" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"groups"))){
+ if($s_action == "cut" && $ui->is_cutable($dn,"groups","group")){
$this->CopyPasteHandler->add_to_queue($dn,$s_action,"grouptabs","GROUPTABS","groups");
}
foreach($this->list_get_selected_items() as $id){
$dn = $this->grouplist[$id]['dn'];
- if($s_action == "copy_multiple" && preg_match("/r/",$ui->has_complete_category_acls($dn,"groups"))){
+ if($s_action == "copy_multiple" && $ui->is_copyable($dn,"groups","group")){
$this->CopyPasteHandler->add_to_queue($dn,"copy","grouptabs","GROUPTABS","groups");
}
- if($s_action == "cut_multiple" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"groups"))){
+ if($s_action == "cut_multiple" && $ui->is_cutable($dn,"groups","group")){
$this->CopyPasteHandler->add_to_queue($dn,"cut","grouptabs","GROUPTABS","groups");
}
}
diff --git a/gosa-core/plugins/admin/ogroups/class_divListOGroup.inc b/gosa-core/plugins/admin/ogroups/class_divListOGroup.inc
index e13efd64b524cf1068432a0492e269ee5f48b2f8..cd60dead1a6db71b9f05340781f2e7fa3301bc68 100644 (file)
// Assigning ogroups
foreach($list as $key => $val){
+ $actions = "";
+
/* Create action icons */
$acl = $ui->get_permissions($val['dn'],"ogroups/ogroup");
$acl_all= $ui->has_complete_category_acls($val['dn'],"ogroups");
- // Cut
- $actions= "";
- if(preg_match("/(r.*d|r.*d)/",$acl_all) && $this->parent->CopyPasteHandler){
+ if($ui->is_cutable($val['dn'],"ogroups","ogroup") && $this->parent->CopyPasteHandler){
$actions .= "<input class='center' type='image'
src='images/lists/cut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
}else{
$actions.="<img src='images/empty.png' alt=' ' class='center'> ";
}
- // Copy
- if(preg_match("/r/",$acl_all) && $this->parent->CopyPasteHandler){
+ if($ui->is_copyable($val['dn'],"ogroups","ogroup") && $this->parent->CopyPasteHandler){
$actions.= "<input class='center' type='image'
src='images/lists/copy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
}else{
$actions.="<img src='images/empty.png' alt=' ' class='center'> ";
}
-
$actions.= "<input class='center' type='image'
src='images/lists/edit.png' alt='"._("edit")."' name='group_edit_%KEY%' title='"._("Edit this entry")."'>";
diff --git a/gosa-core/plugins/admin/ogroups/class_ogroupManagement.inc b/gosa-core/plugins/admin/ogroups/class_ogroupManagement.inc
index 13f84e40ee7a02aebc0e3fadc15b3124b5aafa21..6fe2d6ea249ea72cbc2b706994a5e80d81c429b4 100644 (file)
/* Cleanup object queue */
$this->CopyPasteHandler->cleanup_queue();
$dn = $this->ogrouplist[$s_entry]['dn'];
- if($s_action == "copy" && preg_match("/r/",$ui->has_complete_category_acls($dn,"ogroups"))){
- $this->CopyPasteHandler->add_to_queue($dn,$s_action, "ogrouptabs","OGROUPTABS","ogroups");
+ if($s_action == "copy" && $ui->is_copyable($dn,"ogroups","ogroup")){
+ $this->CopyPasteHandler->add_to_queue($dn,$s_action,"ogrouptabs","OGROUPTABS","ogroups");
}
- if($s_action == "cut" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"ogroups"))){
+ if($s_action == "cut" && $ui->is_cutable($dn,"ogroups","ogroup")){
$this->CopyPasteHandler->add_to_queue($dn,$s_action,"ogrouptabs","OGROUPTABS","ogroups");
}
}
foreach($this->list_get_selected_items() as $id){
$dn = $this->ogrouplist[$id]['dn'];
- if($s_action == "copy_multiple" && preg_match("/r/",$ui->has_complete_category_acls($dn,"ogroups"))){
+ if($s_action == "copy_multiple" && $ui->is_copyable($dn,"ogroups","ogroup")){
$this->CopyPasteHandler->add_to_queue($dn,"copy","ogrouptabs","OGROUPTABS","ogroups");
}
- if($s_action == "cut_multiple" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"ogroups"))){
+ if($s_action == "cut_multiple" && $ui->is_cutable($dn,"ogroups","ogroup")){
$this->CopyPasteHandler->add_to_queue($dn,"cut","ogrouptabs","OGROUPTABS","ogroups");
}
}
diff --git a/gosa-core/plugins/admin/users/class_divListUsers.inc b/gosa-core/plugins/admin/users/class_divListUsers.inc
index fb29fd472c7f51706aba17308a2f6bb8022a82d9..3aaf8bac251c363276585dbfe8d511d5465d7c1b 100644 (file)
$acl = $ui->get_permissions($val['dn'],"users/user");
$acl_all = $ui->has_complete_category_acls($val['dn'],"users");
- if(preg_match("/(r.*d|r.*d)/",$acl_all) && $this->parent->CopyPasteHandler){
+ if($ui->is_cutable($val['dn'],"users","user") && $this->parent->CopyPasteHandler){
$action .= "<input class='center' type='image'
src='images/lists/cut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
}else{
$action.="<img src='images/empty.png' alt=' ' class='center'> ";
}
- if(preg_match("/r/",$acl_all) && $this->parent->CopyPasteHandler){
+ if($ui->is_copyable($val['dn'],"users","user") && $this->parent->CopyPasteHandler){
$action.= "<input class='center' type='image'
src='images/lists/copy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
}else{
diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc
index 202e617cde77b9b7418a5e0bedb7c28079e2ee80..2b84bfc2b87b33e3c58703e40aecf1d274e27ce8 100644 (file)
/* Cleanup object queue */
$this->CopyPasteHandler->cleanup_queue();
$dn = $this->list[$s_entry]['dn'];
- if($s_action == "copy" && preg_match("/r/",$ui->has_complete_category_acls($dn,"users"))){
+ if($s_action == "copy" && $ui->is_copyable($dn,"users","user")){
$this->CopyPasteHandler->add_to_queue($dn,$s_action,"usertabs","USERTABS","users");
}
- if($s_action == "cut" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"users"))){
+ if($s_action == "cut" && $ui->is_cutable($dn,"users","user")){
$this->CopyPasteHandler->add_to_queue($dn,$s_action,"usertabs","USERTABS","users");
}
}
foreach($this->list_get_selected_items() as $id){
$dn = $this->list[$id]['dn'];
- if($s_action == "copy_multiple" && preg_match("/r/",$ui->has_complete_category_acls($dn,"users"))){
+ if($s_action == "copy_multiple" && $ui->is_copyable($dn,"users","user")){
$this->CopyPasteHandler->add_to_queue($dn,"copy","usertabs","USERTABS","users");
}
- if($s_action == "cut_multiple" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"users"))){
+ if($s_action == "cut_multiple" && $ui->is_cutable($dn,"users","user")){
$this->CopyPasteHandler->add_to_queue($dn,"cut","usertabs","USERTABS","users");
}
}
diff --git a/gosa-plugins/fai/admin/fai/class_divListFai.inc b/gosa-plugins/fai/admin/fai/class_divListFai.inc
index 02f00d44cdbe9d8be8ca77cc3ba76379f7fdabce..9f0362e4ded39b8cd453a7aa77c7f056c9bc08fb 100644 (file)
$ui = get_userinfo();
$action ="";
$acl_all = $ui->has_complete_category_acls($this->parent->fai_base,$this->module);
- if(preg_match("/r/",$acl_all) && $this->parent->CopyPasteHandler){
+ if($ui->is_copyable($value['dn'],"fai",$value['class']) && $this->parent->CopyPasteHandler){
$action .= "<input class='center' type='image'
src='images/lists/copy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
}
diff --git a/gosa-plugins/fai/admin/fai/class_faiManagement.inc b/gosa-plugins/fai/admin/fai/class_faiManagement.inc
index 2f781b979b19ed9752563a11a7329d979d73c776..b5b335cab57fce6b48fc2a8553a90dbb74d60865 100644 (file)
$obj['cn'] = $object['cn'][0];
$obj['dn'] = $object['dn'];
$obj['acl'] = $acl;
+ $obj['class'] = $rest ['ACL'];
$obj['description'] = $object['description'][0];
$obj['objectClass'] = $object['objectClass'];
return("");
}
+ $ui = get_userinfo();
/* Add a single entry to queue */
if($s_action == "copy"){
$entry = $this->objects[$s_entry];
$a_setup = $this->get_type($entry);
$dn = $entry['dn'];
- $this->CopyPasteHandler->add_to_queue($dn,$s_action,$a_setup[0],$a_setup[2],"fai");//$a_setup[1]);
+
+ if($ui->is_copyable($dn,"fai",$a_setup[1])){
+ $this->CopyPasteHandler->add_to_queue($dn,$s_action,$a_setup[0],$a_setup[2],"fai");//$a_setup[1]);
+ }
}
/* Add entries to queue */
$a_setup = $this->get_type($entry);
$dn = $entry['dn'];
-
- if($s_action == "copy_multiple"){
+ if($s_action == "copy_multiple" && $ui->is_copyable($dn,"fai",$a_setup[1])){
$this->CopyPasteHandler->add_to_queue($dn,"copy",$a_setup[0],$a_setup[2],"fai");//$a_setup[1]);
}
}
diff --git a/gosa-plugins/gofax/gofax/blocklists/class_blocklistManagement.inc b/gosa-plugins/gofax/gofax/blocklists/class_blocklistManagement.inc
index 76ddca75e74502b6993f4be75c16977c07c60829..93987e40466af3fb81808bb79ae24d65dc65a7e4 100644 (file)
/* Cleanup object queue */
$this->CopyPasteHandler->cleanup_queue();
$dn = $this->blocklists[$s_entry]['dn'];
- if($s_action == "copy" && preg_match("/r/",$ui->has_complete_category_acls($dn,"gofaxlist"))){
+ if($s_action == "copy" && $ui->is_copyable($dn,"gofaxlist","blocklistGeneric")){
$this->CopyPasteHandler->add_to_queue($dn,$s_action,"faxblocktabs","FAXBLOCKTABS","gofaxlist");
}
- if($s_action == "cut" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"gofaxlist"))){
+ if($s_action == "cut" && $ui->is_cutable($dn,"gofaxlist","blocklistGeneric")){
$this->CopyPasteHandler->add_to_queue($dn,$s_action,"faxblocktabs","FAXBLOCKTABS","gofaxlist");
}
}
foreach($this->list_get_selected_items() as $id){
$dn = $this->blocklists[$id]['dn'];
- if($s_action == "copy_multiple" && preg_match("/r/",$ui->has_complete_category_acls($dn,"gofaxlist"))){
+ if($s_action == "copy_multiple" && $ui->is_copyable($dn,"gofaxlist","blocklistGeneric")){
$this->CopyPasteHandler->add_to_queue($dn,"copy","faxblocktabs","FAXBLOCKTABS","gofaxlist");
}
- if($s_action == "cut_multiple" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"gofaxlist"))){
+ if($s_action == "cut_multiple" && $ui->is_cutable($dn,"gofaxlist","blocklistGeneric")){
$this->CopyPasteHandler->add_to_queue($dn,"cut","faxblocktabs","FAXBLOCKTABS","gofaxlist");
}
}
diff --git a/gosa-plugins/gofax/gofax/blocklists/class_divListBlocklists.inc b/gosa-plugins/gofax/gofax/blocklists/class_divListBlocklists.inc
index 4ba92520b3c125b4ebe7958884fe955ba1f01aa0..54dec38895aa01b048c5f0b8bc94a45940860279 100644 (file)
}
$action ="";
- if(preg_match("/(r.*d|r.*d)/",$acl_all) && $this->parent->CopyPasteHandler){
+ if($ui->is_cutable($val['dn'],"gofaxlist","blocklist") && $this->parent->CopyPasteHandler){
$action .= "<input class='center' type='image'
src='images/lists/cut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
}else{
$action.="<img src='images/empty.png' alt=' ' class='center'> ";
}
- if(preg_match("/r/",$acl_all) && $this->parent->CopyPasteHandler){
+ if($ui->is_copyable($val['dn'],"gofaxlist","blocklist") && $this->parent->CopyPasteHandler){
$action.= "<input class='center' type='image'
src='images/lists/copy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
}else{
diff --git a/gosa-plugins/gofon/gofon/conference/class_divListConferences.inc b/gosa-plugins/gofon/gofon/conference/class_divListConferences.inc
index 7bd2d7205dedaabcb6a302069f8d329950411038..c50340950f239430720a4dfa0b4ed20fc23f57d5 100644 (file)
$action_col_size += 20;
}
+ $ui = get_userinfo();
+
/* Insert conferneces*/
foreach($list as $conferencekey => $conference ){
}
$actions ="";
-
- if(preg_match("/(r.*d|r.*d)/",$acl_all) && $this->parent->CopyPasteHandler){
+ if($ui->is_cutable($conference['dn'],"gofonconference","conference") && $this->parent->CopyPasteHandler){
$actions .= "<input class='center' type='image'
src='images/lists/cut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
}else{
$actions.="<img src='images/empty.png' alt=' ' class='center'> ";
}
- if(preg_match("/r/",$acl_all) && $this->parent->CopyPasteHandler){
+ if($ui->is_copyable($conference['dn'],"gofonconference","conference") && $this->parent->CopyPasteHandler){
$actions.= "<input class='center' type='image'
src='images/lists/copy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
}else{
diff --git a/gosa-plugins/gofon/gofon/conference/class_phoneConferenceManagment.inc b/gosa-plugins/gofon/gofon/conference/class_phoneConferenceManagment.inc
index 3a138c3c6d16cb1d0d0dc132c9497105c77d3c25..3cf6ec65d7e1100d0ab7609c098166b75596d350 100644 (file)
$this->CopyPasteHandler->cleanup_queue();
$dn = $this->conferences[$s_entry]['dn'];
- if($s_action == "copy" && preg_match("/r/",$ui->has_complete_category_acls($dn,"gofonconference"))){
+ if($s_action == "copy" && $ui->is_copyable($dn,"gofonconference","conference")){
$this->CopyPasteHandler->add_to_queue($dn,$s_action,"conferencetabs","CONFERENCETABS","gofonconference");
}
- if($s_action == "cut" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"gofonconference"))){
+ if($s_action == "cut" && $ui->is_cutable($dn,"gofonconference","conference")){
$this->CopyPasteHandler->add_to_queue($dn,$s_action,"conferencetabs","CONFERENCETABS","gofonconference");
}
}
foreach($this->list_get_selected_items() as $id){
$dn = $this->conferences[$id]['dn'];
- if($s_action == "copy_multiple" && preg_match("/r/",$ui->has_complete_category_acls($dn,"gofonconference"))){
+ if($s_action == "copy_multiple" && $ui->is_copyable($dn,"gofonconference","conference")){
$this->CopyPasteHandler->add_to_queue($dn,"copy","conferencetabs","CONFERENCETABS","gofonconference");
}
- if($s_action == "cut_multiple" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"gofonconference"))){
+ if($s_action == "cut_multiple" && $ui->is_cutable($dn,"gofonconference","conference")){
$this->CopyPasteHandler->add_to_queue($dn,"cut","conferencetabs","CONFERENCETABS","gofonconference");
}
}
diff --git a/gosa-plugins/gofon/gofon/macro/class_divListMacros.inc b/gosa-plugins/gofon/gofon/macro/class_divListMacros.inc
index b9a934b1f06348f3423c2d613315ea93cd789bcd..22b1f499f90d6b4b4988c7775acd1610d9f01b9b 100644 (file)
continue;
}
- if(preg_match("/(r.*d|r.*d)/",$acl_all) && $this->parent->CopyPasteHandler){
+ if($ui->is_cutable($val['dn'],"gofonmacro","macro") && $this->parent->CopyPasteHandler){
$action .= "<input class='center' type='image'
src='images/lists/cut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
}else{
$action.="<img src='images/empty.png' alt=' ' class='center'> ";
}
- if(preg_match("/r/",$acl_all) && $this->parent->CopyPasteHandler){
+ if($ui->is_copyable($val['dn'],"gofonmacro","macro") && $this->parent->CopyPasteHandler){
$action.= "<input class='center' type='image'
src='images/lists/copy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
}else{
diff --git a/gosa-plugins/gofon/gofon/macro/class_gofonMacroManagement.inc b/gosa-plugins/gofon/gofon/macro/class_gofonMacroManagement.inc
index 531b25635914377160725548e3195b610425155f..46f9d5144383a4a71ee9324eaf612829e98d7fbc 100644 (file)
$this->CopyPasteHandler->cleanup_queue();
$dn = $this->macros[$s_entry]['dn'];
- if($s_action == "copy" && preg_match("/r/",$ui->has_complete_category_acls($dn,"gofonmacro"))){
+ if($s_action == "copy" && $ui->is_copyable($dn,"gofonmacro","macro")){
$this->CopyPasteHandler->add_to_queue($dn,$s_action,"macrotabs","MACROTABS","gofonmacro");
}
- if($s_action == "cut" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"gofonmacro"))){
+ if($s_action == "cut" && $ui->is_cutable($dn,"gofonmacro","macro")){
$this->CopyPasteHandler->add_to_queue($dn,$s_action,"macrotabs","MACROTABS","gofonmacro");
}
}
foreach($this->list_get_selected_items() as $id){
$dn = $this->macros[$id]['dn'];
- if($s_action == "copy_multiple" && preg_match("/r/",$ui->has_complete_category_acls($dn,"gofonmacro"))){
+ if($s_action == "copy_multiple" && $ui->is_copyable($dn,"gofonmacro","macro")){
$this->CopyPasteHandler->add_to_queue($dn,"copy","macrotabs","MACROTABS","gofonmacro");
}
- if($s_action == "cut_multiple" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"gofonmacro"))){
+ if($s_action == "cut_multiple" && $ui->is_cutable($dn,"gofonmacro","macro")){
$this->CopyPasteHandler->add_to_queue($dn,"cut","macrotabs","MACROTABS","gofonmacro");
}
}
diff --git a/gosa-plugins/goto/admin/applications/class_applicationManagement.inc b/gosa-plugins/goto/admin/applications/class_applicationManagement.inc
index b2a9cd44340de905b79c5de595ce65ce067154b6..b00a8d29c7f1906c59989e4860bc8bdbce83f826 100644 (file)
/* Cleanup object queue */
$this->CopyPasteHandler->cleanup_queue();
$dn = $this->applications[$s_entry]['dn'];
- if($s_action == "copy" && preg_match("/r/",$ui->has_complete_category_acls($dn,"application"))){
+ if($s_action == "copy" && $ui->is_copyable($dn,"application","application")){
$this->CopyPasteHandler->add_to_queue($dn,$s_action,"apptabs","APPSTABS","application");
}
- if($s_action == "cut" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"application"))){
+ if($s_action == "cut" && $ui->is_cutable($dn,"application","application")){
$this->CopyPasteHandler->add_to_queue($dn,$s_action,"apptabs","APPSTABS","application");
}
}
foreach($this->list_get_selected_items() as $id){
$dn = $this->applications[$id]['dn'];
- if($s_action == "copy_multiple" && preg_match("/r/",$ui->has_complete_category_acls($dn,"application"))){
+ if($s_action == "copy_multiple" && $ui->is_copyable($dn,"application","application")){
$this->CopyPasteHandler->add_to_queue($dn,"copy","apptabs","APPSTABS","application");
}
- if($s_action == "cut_multiple" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"application"))){
+ if($s_action == "cut_multiple" && $ui->is_cutable($dn,"application","application")){
$this->CopyPasteHandler->add_to_queue($dn,"cut","apptabs","APPSTABS","application");
}
}
diff --git a/gosa-plugins/goto/admin/applications/class_divListApplication.inc b/gosa-plugins/goto/admin/applications/class_divListApplication.inc
index 7c57a001d888ad8ef29b8aa27dab468ca7be2958..9a53e5f31aac5b7c4f92d3964550c431e0a7b202 100644 (file)
$actions= "";
/* Add Copy & Paste icon */
- if(preg_match("/(r.*d|r.*d)/",$acl_all) && $this->parent->CopyPasteHandler){
+ if($ui->is_cutable($val['dn'],"application","application") && $this->parent->CopyPasteHandler){
$actions .= "<input class='center' type='image'
src='images/lists/cut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
}else{
$actions.="<img src='images/empty.png' alt=' ' class='center'> ";
}
- if(preg_match("/r/",$acl_all) && $this->parent->CopyPasteHandler){
+ if($ui->is_copyable($val['dn'],"application","application") && $this->parent->CopyPasteHandler){
$actions.= "<input class='center' type='image'
src='images/lists/copy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
}else{
diff --git a/gosa-plugins/goto/admin/devices/class_deviceManagement.inc b/gosa-plugins/goto/admin/devices/class_deviceManagement.inc
index 5c6e8e98da62571149d172f265970767efafa8d5..5cb193a085d0cdf8fbc562d734f8c33a7b6dd102 100644 (file)
/* Cleanup object queue */
$this->CopyPasteHandler->cleanup_queue();
$dn = $this->devices[$s_entry]['dn'];
- if($s_action == "copy" && preg_match("/r/",$ui->has_complete_category_acls($dn,"devices"))){
+ if($s_action == "copy" && $ui->is_copyable($dn,"devices","deviceGeneric")){
$this->CopyPasteHandler->add_to_queue($dn,$s_action,"devicetabs","DEVICETABS","devices");
}
- if($s_action == "cut" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"devices"))){
+ if($s_action == "cut" && $ui->is_cutable($dn,"devices","deviceGeneric")){
$this->CopyPasteHandler->add_to_queue($dn,$s_action,"devicetabs","DEVICETABS","devices");
}
}
foreach($this->list_get_selected_items() as $id){
$dn = $this->devices[$id]['dn'];
- if($s_action == "copy_multiple" && preg_match("/r/",$ui->has_complete_category_acls($dn,"devices"))){
+ if($s_action == "copy_multiple" && $ui->is_copyable($dn,"devices","deviceGeneric")){
$this->CopyPasteHandler->add_to_queue($dn,"copy","devicetabs","DEVICETABS","devices");
}
- if($s_action == "cut_multiple" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"devices"))){
+ if($s_action == "cut_multiple" && $ui->is_cutable($dn,"devices","deviceGeneric")){
$this->CopyPasteHandler->add_to_queue($dn,"cut","devicetabs","DEVICETABS","devices");
}
}
diff --git a/gosa-plugins/goto/admin/devices/class_divListDevices.inc b/gosa-plugins/goto/admin/devices/class_divListDevices.inc
index 0407757c67f1434f022dfe6eba1fb36b11520373..b43c492fc236f5fadb5ac88441a5b7107b2c0b8e 100644 (file)
$acl_all = $ui->has_complete_category_acls($val['dn'],"devices") ;
$actions = "";
- if(preg_match("/(r.*d|r.*d)/",$acl_all) && $this->parent->CopyPasteHandler){
+ if($ui->is_cutable($val['dn'],"devices","deviceGeneric") && $this->parent->CopyPasteHandler){
$actions .= "<input class='center' type='image'
src='images/lists/cut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
}else{
$actions.="<img src='images/empty.png' alt=' ' class='center'> ";
}
- if(preg_match("/r/",$acl_all) && $this->parent->CopyPasteHandler){
+ if($ui->is_copyable($val['dn'],"devices","deviceGeneric") && $this->parent->CopyPasteHandler){
$actions.= "<input class='center' type='image'
src='images/lists/copy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
}else{
diff --git a/gosa-plugins/goto/admin/mimetypes/class_divListMimeTypes.inc b/gosa-plugins/goto/admin/mimetypes/class_divListMimeTypes.inc
index e4962746b80cdf3a857af877c2ffe6ef55f71a77..dbc60c50142c0501673e515cbe076724e23d5f80 100644 (file)
$acl_all = $ui->has_complete_category_acls($val['dn'],"mimetypes") ;
$action = "";
- if(preg_match("/(r.*d|r.*d)/",$acl_all) && $this->parent->CopyPasteHandler){
- $action.= "<input class='center' type='image'
+ if($ui->is_cutable($val['dn'],"mimetypes","mimetype") && $this->parent->CopyPasteHandler){
+ $action .= "<input class='center' type='image'
src='images/lists/cut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
}else{
$action.="<img src='images/empty.png' alt=' ' class='center'> ";
}
- if(preg_match("/r/",$acl_all) && $this->parent->CopyPasteHandler){
+ if($ui->is_copyable($val['dn'],"mimetypes","mimetype") && $this->parent->CopyPasteHandler){
$action.= "<input class='center' type='image'
src='images/lists/copy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
}else{
diff --git a/gosa-plugins/goto/admin/mimetypes/class_mimetypeManagement.inc b/gosa-plugins/goto/admin/mimetypes/class_mimetypeManagement.inc
index c56b3d2b4e568d8ff107f23f3f66d9e990c8ca8a..d911448dc5319b10503c1d5cafc44dc23377ae4f 100644 (file)
/* Cleanup object queue */
$this->CopyPasteHandler->cleanup_queue();
$dn = $this->mimetypes[$s_entry]['dn'];
- if($s_action == "copy" && preg_match("/r/",$ui->has_complete_category_acls($dn,"mimetypes"))){
+ if($s_action == "copy" && $ui->is_copyable($dn,"mimetypes","mimetype")){
$this->CopyPasteHandler->add_to_queue($dn,$s_action,"mimetabs","MIMETABS","mimetypes");
}
- if($s_action == "cut" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"mimetypes"))){
+ if($s_action == "cut" && $ui->is_cutable($dn,"mimetypes","mimetype")){
$this->CopyPasteHandler->add_to_queue($dn,$s_action,"mimetabs","MIMETABS","mimetypes");
}
}
foreach($this->list_get_selected_items() as $id){
$dn = $this->mimetypes[$id]['dn'];
- if($s_action == "copy_multiple" && preg_match("/r/",$ui->has_complete_category_acls($dn,"mimetypes"))){
+ if($s_action == "copy_multiple" && $ui->is_copyable($dn,"mimetypes","mimetype")){
$this->CopyPasteHandler->add_to_queue($dn,"copy","mimetabs","MIMETABS","mimetypes");
}
- if($s_action == "cut_multiple" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"mimetypes"))){
+ if($s_action == "cut_multiple" && $ui->is_cutable($dn,"mimetypes","mimetype")){
$this->CopyPasteHandler->add_to_queue($dn,"cut","mimetabs","MIMETABS","mimetypes");
}
}
diff --git a/gosa-plugins/sudo/admin/sudo/class_divListSudo.inc b/gosa-plugins/sudo/admin/sudo/class_divListSudo.inc
index 98f418f7d0315f7e61ce7508f276d7afd67a1499..f16ddd90c01e71d67c0bc8308c3f29a28656b9fc 100644 (file)
/* Add edit icon */
$actions= "";
- if(preg_match("/r/",$acl_all) && $this->parent->CopyPasteHandler){
+ if($ui->is_copyable($val['dn'],"sudo","sudo") && $this->parent->CopyPasteHandler){
$actions.= "<input class='center' type='image'
src='images/lists/copy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
}else{
diff --git a/gosa-plugins/sudo/admin/sudo/class_sudoManagement.inc b/gosa-plugins/sudo/admin/sudo/class_sudoManagement.inc
index 54d6dd5232a923501fd27a33c51a22b49ede24e6..e866e24eedb3997f2ea381e533f5323547c0d251 100644 (file)
$this->CopyPasteHandler->cleanup_queue();
$dn = $this->list[$s_entry]['dn'];
- if($s_action == "copy" && preg_match("/r/",$ui->has_complete_category_acls($dn,"sudo"))){
+ if($s_action == "copy" && $ui->is_copyable($dn,"sudo","sudo")){
$this->CopyPasteHandler->add_to_queue($dn,$s_action,"sudotabs","SUDOTABS","sudo");
}
-# if($s_action == "cut" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"sudo"))){
+# if($s_action == "cut" && $ui->is_cutable($dn,"sudo","sudo")){
# $this->CopyPasteHandler->add_to_queue($dn,$s_action,"sudotabs","SUDOTABS","sudo");
# }
}
foreach($this->list_get_selected_items() as $id){
$dn = $this->list[$id]['dn'];
- if($s_action == "copy_multiple" && preg_match("/r/",$ui->has_complete_category_acls($dn,"sudo"))){
+ if($s_action == "copy_multiple" && $ui->is_copyable($dn,"sudo","sudo")){
$this->CopyPasteHandler->add_to_queue($dn,"copy","sudotabs","SUDOTABS","sudo");
}
-# if($s_action == "cut_multiple" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"sudo"))){
+# if($s_action == "cut_multiple" && $ui->is_cutable($dn,"sudo","sudo")){
# $this->CopyPasteHandler->add_to_queue($dn,"cut","sudotabs","SUDOTABS","sudo");
# }
}
diff --git a/gosa-plugins/systems/admin/systems/class_divListSystem.inc b/gosa-plugins/systems/admin/systems/class_divListSystem.inc
index 3d0c1ebb960fa87c5da5f5b6a3c760cfff8cddd3..b49d1bd9c29800438a10030d553cf41d7edadfa2 100644 (file)
$acl_type = "incoming";
}
+ $s_acl = $tabs[$type]['ACL'];
+ $category = preg_replace("/\/.*$/","",$s_acl);
+ $class = preg_replace("/^.*\//","",$s_acl);
+
/* Get complete category acls */
$acl_all = $ui->has_complete_category_acls($val['dn'],$acl_type) ;
$acl = $ui->get_permissions($val['dn'],$tabs[$type]['ACL']);
$action ="";
- if(preg_match("/(r.*d|r.*d)/",$acl_all) && $this->parent->CopyPasteHandler){
+ if($ui->is_cutable($val['dn'],$category,$class) && $this->parent->CopyPasteHandler){
$action .= "<input class='center' type='image'
src='images/lists/cut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
}else{
$action.="<img src='images/empty.png' alt=' ' class='center'> ";
}
- if(preg_match("/r/",$acl_all) && $this->parent->CopyPasteHandler){
+ if($ui->is_copyable($val['dn'],$category,$class) && $this->parent->CopyPasteHandler){
$action.= "<input class='center' type='image'
src='images/lists/copy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
}else{
$action.="<img src='images/empty.png' alt=' ' class='center'> ";
}
+
$action.= "<input class='center' type='image' src='images/lists/edit.png'
alt='"._("edit")."' name='system_edit_%KEY%' title='"._("Edit system")."'>";
diff --git a/gosa-plugins/systems/admin/systems/class_systemManagement.inc b/gosa-plugins/systems/admin/systems/class_systemManagement.inc
index 5941aed45aff8102dcdd5e6728efeac7a1bf8bee..1f115d806b3c6cf60b50d70b6f477f6a00078615 100644 (file)
$tab_o = $tabs[$type]['CLASS'];
$tab_c = $tabs[$type]['TABCLASS'];
+ $acl_c = $tabs[$type]['TABNAME'];
$acl = $tabs[$type]['ACL'];
- if($s_action == "copy" && preg_match("/r/",$ui->has_complete_category_acls($dn,$acl))){
+ if($s_action == "copy" && $ui->is_copyable($dn,$acl,$acl_c)){
$this->CopyPasteHandler->add_to_queue($dn,$s_action,$tab_c,$tab_o,$acl);
}
- if($s_action == "cut" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,$acl))){
+ if($s_action == "cut" && $ui->is_cutable($dn,$acl,$acl_c)){
$this->CopyPasteHandler->add_to_queue($dn,$s_action,$tab_c,$tab_o,$acl);
}
}
if(isset($tabs[$type])){
$tab_o = $tabs[$type]['CLASS'];
$tab_c = $tabs[$type]['TABCLASS'];
+ $acl_c = $tabs[$type]['TABNAME'];
$acl = $tabs[$type]['ACL'];
- if($s_action == "copy_multiple" && preg_match("/r/",$ui->has_complete_category_acls($dn,$acl))){
+ if($s_action == "copy_multiple" && $ui->is_copyable($dn,$acl,$acl_c)){
$this->CopyPasteHandler->add_to_queue($dn,"copy",$tab_c,$tab_o,$acl);
}
- if($s_action == "cut_multiple" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,$acl))){
+ if($s_action == "cut_multiple" && $ui->is_cutable($dn,$acl,$acl_c)){
$this->CopyPasteHandler->add_to_queue($dn,"cut",$tab_c,$tab_o,$acl);
}
}