diff --git a/setup/db_backup.php b/setup/db_backup.php index 30178fdd1d..9bb7f088d1 100644 --- a/setup/db_backup.php +++ b/setup/db_backup.php @@ -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' => '  '. + 'actions' => ' '."\n". '  '. + htmlspecialchars(lang('Confirm to delete this backup?')).'\');" /> '."\n". + ' '."\n". '', )); diff --git a/setup/lang/phpgw_de.lang b/setup/lang/phpgw_de.lang index ed8f77622e..8ddc49ec6a 100644 --- a/setup/lang/phpgw_de.lang +++ b/setup/lang/phpgw_de.lang @@ -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 diff --git a/setup/lang/phpgw_en.lang b/setup/lang/phpgw_en.lang index 5c23257075..6500b2f8aa 100644 --- a/setup/lang/phpgw_en.lang +++ b/setup/lang/phpgw_en.lang @@ -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 diff --git a/setup/templates/default/db_backup.tpl b/setup/templates/default/db_backup.tpl index cdc33aee70..49f4dee567 100644 --- a/setup/templates/default/db_backup.tpl +++ b/setup/templates/default/db_backup.tpl @@ -2,7 +2,7 @@

{error_msg}

- +