summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a949052)
raw | patch | inline | side by side (parent: a949052)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 28 May 2008 05:54:01 +0000 (05:54 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 28 May 2008 05:54:01 +0000 (05:54 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11051 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/goto/admin/devices/class_deviceManagement.inc | patch | blob | history | |
gosa-plugins/goto/admin/devices/class_divListDevices.inc | patch | blob | history |
diff --git a/gosa-plugins/goto/admin/devices/class_deviceManagement.inc b/gosa-plugins/goto/admin/devices/class_deviceManagement.inc
index 9560b34a3de0954b42c3e8785d735640f8c3a512..a3c271d40f78d016699967bc063ded0e87735e6a 100644 (file)
if(count($ids)){
- /* collect entries */
- $this->dns = array();
+ $disallowed = array();
foreach($ids as $id){
- $this->dns[$id] = $this->devices[$id]['dn'];
+ $dn = $this->devices[$id]['dn'];
+ $acl = $this->ui->get_permissions($dn, "devices/deviceGeneric");
+ if(preg_match("/d/",$acl)){
+ $this->dns[$id] = $dn;
+ }else{
+ $disallowed[] = $dn;
+ }
}
- /* Check locks */
- if ($user= get_multiple_locks($this->dns)){
- return(gen_locked_message($user,$this->dns));
+ if(count($disallowed)){
+ msg_dialog::display(_("Permission"),msgPool::permDelete($disallowed),INFO_DIALOG);
}
- $dns_names = array();
- foreach($this->dns as $dn){
- $dns_names[] =@LDAP::fix($dn);
- }
- add_lock ($this->dns, $this->ui->dn);
+ if(count($this->dns)){
- /* Lock the current entry, so nobody will edit it during deletion */
- $smarty->assign("intro", msgPool::deleteInfo($dns_names),_("device"));
- $smarty->assign("multiple", true);
- return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
+ /* Check locks */
+ if ($user= get_multiple_locks($this->dns)){
+ return(gen_locked_message($user,$this->dns));
+ }
+
+ $dns_names = array();
+ foreach($this->dns as $dn){
+ $dns_names[] =@LDAP::fix($dn);
+ }
+ add_lock ($this->dns, $this->ui->dn);
+
+ /* Lock the current entry, so nobody will edit it during deletion */
+ $smarty->assign("intro", msgPool::deleteInfo($dns_names),_("device"));
+ $smarty->assign("multiple", true);
+ return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
+ }
}
}
/* Cleanup object queue */
$this->CopyPasteHandler->cleanup_queue();
$dn = $this->devices[$s_entry]['dn'];
- $this->CopyPasteHandler->add_to_queue($dn,$s_action,"devicetabs","DEVICETABS","devices");
+ if($s_action == "copy" && preg_match("/r/",$ui->has_complete_category_acls($dn,"devices"))){
+ $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"))){
+ $this->CopyPasteHandler->add_to_queue($dn,$s_action,"devicetabs","DEVICETABS","devices");
+ }
}
/* Add entries to queue */
foreach($this->list_get_selected_items() as $id){
$dn = $this->devices[$id]['dn'];
- if($s_action == "copy_multiple"){
+ if($s_action == "copy_multiple" && preg_match("/r/",$ui->has_complete_category_acls($dn,"devices"))){
$this->CopyPasteHandler->add_to_queue($dn,"copy","devicetabs","DEVICETABS","devices");
}
- if($s_action == "cut_multiple"){
+ if($s_action == "cut_multiple" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"devices"))){
$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 73e9c9677f2e466365066e72f54e8b73c6ac91d2..0407757c67f1434f022dfe6eba1fb36b11520373 100644 (file)
$s.= "..|---|\n";
$s.= "..|<img src='images/lists/copy.png' alt='' border='0' class='center'>".
" "._("Copy")."|"."multiple_copy_systems|\n";
- if(is_object($this->parent->CopyPasteHandler) && preg_match("/(r.*d|d.*r)/",$acl_all)){
- $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
- " "._("Cut")."|"."multiple_cut_systems|\n";
- }
+ $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
+ " "._("Cut")."|"."multiple_cut_systems|\n";
}
/* Copy & paste icons */