mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-14 10:37:39 -07:00
backup pages
This commit is contained in:
parent
b0d5764cae
commit
7a99bd4ad0
7 changed files with 153 additions and 4 deletions
23
web/download/backup/index.php
Normal file
23
web/download/backup/index.php
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?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);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue