added renaming of backups

This commit is contained in:
Ralf Becker 2004-10-22 09:22:29 +00:00
parent e4d1f6ea5e
commit 74c705264c
4 changed files with 23 additions and 5 deletions

View File

@ -114,15 +114,28 @@
if ($_POST['delete'])
{
list($file) = each($_POST['delete']);
$file = $db_backup->backup_dir.'/'.basename($file); // basename to now allow to change the dir
$file = $db_backup->backup_dir.'/'.basename($file); // basename to not allow to change the dir
if (unlink($file)) $setup_tpl->set_var('error_msg',lang("backup '%1' deleted",$file));
}
// rename a backup
if ($_POST['rename'])
{
list($file) = each($_POST['rename']);
$new_name = $_POST['new_name'][$file];
if (!empty($new_name))
{
$file = $db_backup->backup_dir.'/'.basename($file); // basename to not allow to change the dir
$ext = preg_match('/(\.gz|\.bz2)+$/i',$file,$matches) ? $matches[1] : '';
$new_file = $db_backup->backup_dir.'/'.preg_replace('/(\.gz|\.bz2)+$/i','',basename($new_name)).$ext;
if (rename($file,$new_file)) $setup_tpl->set_var('error_msg',lang("backup '%1' renamed to '%2'",basename($file),basename($new_file)));
}
}
// restore a backup
if ($_POST['restore'])
{
list($file) = each($_POST['restore']);
$file = $db_backup->backup_dir.'/'.basename($file); // basename to now allow to change the dir
$file = $db_backup->backup_dir.'/'.basename($file); // basename to not allow to change the dir
if (is_resource($f = $db_backup->fopen_backup($file,true)))
{
@ -189,9 +202,10 @@
'filename' => $file,
'date' => date('Y-m-d H:i',$ctime),
'size' => sprintf('%3.1lf MB (%d)',$size/(1024*1024),$size),
'actions' => '<input type="submit" name="download['.$file.']" value="'.htmlspecialchars(lang('download')).'" /> &nbsp;'.
'actions' => '<input type="submit" name="download['.$file.']" value="'.htmlspecialchars(lang('download')).'" />&nbsp;'."\n".
'<input type="submit" name="delete['.$file.']" value="'.htmlspecialchars(lang('delete')).'" onclick="return confirm(\''.
htmlspecialchars(lang('Confirm to delete this backup?')).'\');" /> &nbsp;'.
htmlspecialchars(lang('Confirm to delete this backup?')).'\');" />&nbsp;'."\n".
'<input name="new_name['.$file.']" value="" size="15" /><input type="submit" name="rename['.$file.']" value="'.htmlspecialchars(lang('rename')).'" />&nbsp;'."\n".
'<input type="submit" name="restore['.$file.']" value="'.htmlspecialchars(lang('restore')).'" onclick="return confirm(\''.
htmlspecialchars(lang('Restoring a backup will delete/replace all content in your database. Are you sure?')).'\');" />',
));

View File

@ -55,6 +55,7 @@ back to the previous screen setup de Zur
back to user login setup de Zurück zur Benutzeranmeldung
back's up your db now, this might take a view minutes setup de Sichert Ihre DB jetzt direkt, das kann einige Minuten dauern
backup '%1' deleted setup de Datensicherung '%1' gelöscht
backup '%1' renamed to '%2' setup de Datensicherung '%1' nach '%2' umbenannt
backup '%1' restored setup de Datensicherung '%1' zurückgesichert
backup and restore setup de Datensicherung und Wiederherstellung
backup failed setup de Datensicherung fehlgeschlagen
@ -342,6 +343,7 @@ registered setup de registriert
rejected lines setup de Zurückgewiesende Zeilen
remove setup de Entfernen
remove all setup de Alle Entfernen
rename setup de Umbenennen
requires reinstall or manual repair setup de Erfordert Neuinstallation oder manuelle Reparatur
requires upgrade setup de Erfordert Aktualisierung
resolve setup de Lösen

View File

@ -54,6 +54,7 @@ back to the previous screen setup en Back to the previous screen
back to user login setup en Back to user login
back's up your db now, this might take a view minutes setup en back's up your DB now, this might take a view minutes
backup '%1' deleted setup en backup '%1' deleted
backup '%1' renamed to '%2' setup en backup '%1' renamed to '%2'
backup '%1' restored setup en backup '%1' restored
backup and restore setup en backup and restore
backup failed setup en Backup failed
@ -339,6 +340,7 @@ registered setup en registered
rejected lines setup en Rejected lines
remove setup en Remove
remove all setup en Remove All
rename setup en rename
requires reinstall or manual repair setup en Requires reinstall or manual repair
requires upgrade setup en Requires upgrade
resolve setup en Resolve

View File

@ -2,7 +2,7 @@
<p align="center"><font color="red">{error_msg}</font></p>
<form method="POST" action="{self}" enctype="multipart/form-data">
<table border="0" align="center" width="90%" cellpadding="5">
<table border="0" align="center" width="98%" cellpadding="5">
<!-- BEGIN setup_header -->
<tr bgcolor="#486591">
<td colspan="2">