X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fclass_SnapShotDialog.inc;h=66211bfd029c91e024cf433d78f4d7cee8691317;hb=d2a7f50083180fccb855c116a0f16cbca2636f62;hp=4fc900d01c8d5296964e5f0a64ec5e0c2b674a17;hpb=1db56154c196818c9b9f227b89444d01bb8d44b9;p=gosa.git diff --git a/include/class_SnapShotDialog.inc b/include/class_SnapShotDialog.inc index 4fc900d01..66211bfd0 100755 --- a/include/class_SnapShotDialog.inc +++ b/include/class_SnapShotDialog.inc @@ -17,6 +17,7 @@ class SnapShotDialog extends plugin var $acl; var $dns = array(); var $snap_shot_bases = array(); + var $last_list = array(); function SnapShotDialog($config,$dn,$parent) @@ -48,15 +49,20 @@ class SnapShotDialog extends plugin $entry = preg_replace("/^RemoveSnapShot_/","",$name); $entry = base64_decode(preg_replace("/_[xy]$/","",$entry)); - $this->del_dn = $entry; - $smarty= get_smarty(); - $smarty->assign("intro", sprintf(_("You're about to delete the snapshot '%s'."), @LDAP::fix($this->del_dn))); - return($smarty->fetch (get_template_path('remove.tpl'))); - - /* Obviously the user isn't allowed to delete. Show message and - clean session. - print_red (_("You are not allowed to delete this snapshot!")); - */ + $found = false; + foreach($this->last_list as $t_stamp => $obj){ + if($obj['dn'] == $entry){ + $found = true; + break; + } + } + + if($found){ + $this->del_dn = $entry; + $smarty= get_smarty(); + $smarty->assign("intro", sprintf(_("You're about to delete the snapshot '%s'."), @LDAP::fix($this->del_dn))); + return($smarty->fetch (get_template_path('remove.tpl'))); + } } } @@ -100,6 +106,7 @@ class SnapShotDialog extends plugin krsort($list_of_elements); /* Add Elements to divlist */ + $this->last_list = $list_of_elements; foreach($list_of_elements as $entry){ $actions= "