mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-07-13 08:33:32 -07:00
23 lines
670 B
PHP
23 lines
670 B
PHP
<?php
|
|
// Init
|
|
error_reporting(NULL);
|
|
session_start();
|
|
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
|
$backup = $_GET['backup'];
|
|
|
|
// Data
|
|
if ($_SESSION['user'] == 'admin') {
|
|
header('Content-type: application/gzip');
|
|
header("Content-Disposition: attachment; filename=\"".$backup."\";" );
|
|
header("X-Accel-Redirect: /backup/" . $backup);
|
|
}
|
|
|
|
if ((!empty($_SESSION['user'])) && ($_SESSION['user'] != 'admin')) {
|
|
if (preg_match("/^".$user."/i", $backup)) {
|
|
header('Content-type: application/gzip');
|
|
header("Content-Disposition: attachment; filename=\"".$backup."\";" );
|
|
header("X-Accel-Redirect: /backup/" . $backup);
|
|
}
|
|
}
|
|
|
|
?>
|