index.php 670 B

1234567891011121314151617181920212223
  1. <?php
  2. // Init
  3. error_reporting(NULL);
  4. session_start();
  5. include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
  6. $backup = $_GET['backup'];
  7. // Data
  8. if ($_SESSION['user'] == 'admin') {
  9. header('Content-type: application/gzip');
  10. header("Content-Disposition: attachment; filename=\"".$backup."\";" );
  11. header("X-Accel-Redirect: /backup/" . $backup);
  12. }
  13. if ((!empty($_SESSION['user'])) && ($_SESSION['user'] != 'admin')) {
  14. if (preg_match("/^".$user."/i", $backup)) {
  15. header('Content-type: application/gzip');
  16. header("Content-Disposition: attachment; filename=\"".$backup."\";" );
  17. header("X-Accel-Redirect: /backup/" . $backup);
  18. }
  19. }
  20. ?>