X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=admin%2Fbackups.php;h=2831c131747a115e4a6917a87f5a6481c3f98cf0;hb=211598c5964fd138631395c7f329ec8b87c43c0b;hp=8d7bfbc01f8fb739c244bba81b5f0dfde5824867;hpb=4f00ab261af7ca4118aad47451c25bb80437dc4b;p=fa-stable.git diff --git a/admin/backups.php b/admin/backups.php index 8d7bfbc0..2831c131 100644 --- a/admin/backups.php +++ b/admin/backups.php @@ -16,6 +16,8 @@ include_once($path_to_root . "/includes/session.inc"); include_once($path_to_root . "/includes/ui.inc"); include_once($path_to_root . "/admin/db/maintenance_db.inc"); +define("BACKUP_PATH", $SysPrefs->comp_path.'/'.user_company()."/backup/"); + if (get_post('view')) { if (!get_post('backups')) { display_error(_('Select backup file first.')); @@ -57,7 +59,7 @@ function check_paths() function generate_backup($conn, $ext='no', $comm='') { - $filename = db_backup($conn, $ext, $comm); + $filename = db_backup($conn, $ext, $comm, BACKUP_PATH); if ($filename) display_notification(_("Backup successfully generated."). ' ' . _("Filename") . ": " . $filename); @@ -123,8 +125,7 @@ function download_file($filename) return true; } -$db_name = $_SESSION["wa_current_user"]->company; -$conn = $db_connections[$db_name]; +$conn = $db_connections[user_company()]; $backup_name = clean_file_name(get_post('backups')); $backup_path = BACKUP_PATH . $backup_name; @@ -165,7 +166,7 @@ if (get_post('upload')) display_error(_("You can only upload *.sql backup files")); elseif (is_uploaded_file($tmpname)) { rename($tmpname, BACKUP_PATH . $fname); - display_notification( "File uploaded to backup directory"); + display_notification(_("File uploaded to backup directory")); $Ajax->activate('backups'); } else display_error(_("File was not uploaded into the system.")); @@ -209,4 +210,3 @@ end_outer_table(); end_form(); end_page(); -?>