Esempio n. 1
0
<?php

$page_security = 'SA_BACKUP';
$path_to_root = "..";
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";
if (get_post('view')) {
    if (!get_post('backups')) {
        display_error(_('Select backup file first.'));
    } else {
        $filename = BACKUP_PATH . clean_file_name(get_post('backups'));
        if (in_ajax()) {
            $Ajax->popup($filename);
        } else {
            header('Content-type: text/plain');
            header('Content-Length: ' . filesize($filename));
            header("Content-Disposition: inline");
            readfile($filename);
            exit;
        }
    }
}
if (get_post('download')) {
    if (get_post('backups')) {
        download_file(BACKUP_PATH . clean_file_name(get_post('backups')));
        exit;
    } else {
        display_error(_("Select backup file first."));
    }
}
 function submit_js_confirm($name, $msg, $set = true)
 {
     global $Ajax;
     $js = "_validate.{$name}=" . ($set ? "function(){ return confirm('" . strtr($msg, array("\n" => '\\n')) . "');};" : 'null;');
     if (in_ajax()) {
         $Ajax->addScript(true, $js);
     } else {
         add_js_source($js);
     }
 }