X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Finclude%2Fclass_SnapShotDialog.inc;h=aafd2e5ed191f02a9d09caee0bf04acce97d3594;hb=67253c858b7c867ee5fa3a9b4bbfde1fc1ee81d1;hp=507832f0719515d3edb833793c4aa4c8577d8c13;hpb=7692f34a23250aa815f368cc9cd17064cf0af141;p=gosa.git diff --git a/gosa-core/include/class_SnapShotDialog.inc b/gosa-core/include/class_SnapShotDialog.inc index 507832f07..aafd2e5ed 100644 --- a/gosa-core/include/class_SnapShotDialog.inc +++ b/gosa-core/include/class_SnapShotDialog.inc @@ -61,14 +61,13 @@ class SnapShotDialog extends plugin plugin::execute(); $smarty = get_smarty(); + $ui = get_userinfo(); $once = true; foreach($_POST as $name => $value){ if((preg_match("/^RemoveSnapShot_/",$name)) && ($once)){ $once = false; - - $entry = preg_replace("/^RemoveSnapShot_/","",$name); - $entry = base64_decode(preg_replace("/_[xy]$/","",$entry)); - + $entry = preg_replace("/^RemoveSnapShot_/","",$name); + $entry = base64_decode(preg_replace("/_[xy]$/","",$entry)); $found = false; foreach($this->last_list as $t_stamp => $obj){ if($obj['dn'] == $entry){ @@ -80,7 +79,7 @@ class SnapShotDialog extends plugin 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))); + $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'))); } } @@ -93,6 +92,7 @@ class SnapShotDialog extends plugin } /* We must restore a snapshot */ + if($this->display_restore_dialog){ /* Should we only display all snapshots of already deleted objects @@ -118,8 +118,10 @@ class SnapShotDialog extends plugin /* Walk through all entries and setup the display text */ foreach($tmp as $key => $entry){ - $TimeStamp = $entry['gosaSnapshotTimestamp'][0]; - $list_of_elements[$TimeStamp] = $entry; + + /* Check permissions */ + $TimeStamp = $entry['gosaSnapshotTimestamp'][0]; + $list_of_elements[$TimeStamp] = $entry; } /* Sort generated list */ @@ -129,10 +131,10 @@ class SnapShotDialog extends plugin $this->last_list = $list_of_elements; foreach($list_of_elements as $entry){ - $actions= " "; - $actions.= " "; + $actions= " "; + $actions.= " "; $time_stamp = date(_("Y-m-d, H:i:s"),preg_replace("/\-.*$/","",$entry['gosaSnapshotTimestamp'][0])); $display_data = $entry['description'][0]; @@ -143,7 +145,7 @@ class SnapShotDialog extends plugin $field0 = array("string"=> $time_stamp , "attach"=> "style='vertical-align:top;width:120px;'"); $field1 = array("string"=> htmlentities (utf8_decode($display_data)), "attach"=> ""); - $field2 = array("string"=> preg_replace("/%KEY/",base64_encode($entry['dn']),$actions) , + $field2 = array("string"=> str_replace("%KEY",base64_encode($entry['dn']),$actions) , "attach"=> "style='border-right:0px;vertical-align:top;width:40px;text-align:right;'"); $DivListSnapShots->AddEntry(array($field0,$field1,$field2)); }