-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverbackup.php
More file actions
40 lines (32 loc) · 953 Bytes
/
Copy pathserverbackup.php
File metadata and controls
40 lines (32 loc) · 953 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
$title = "Backups";
$page = "server";
require __DIR__ . '/configuration.php';
require __DIR__ . '/include.php';
require __DIR__ . '/includes/backup.php';
$clientId = (int) ($_SESSION['clientid'] ?? 0);
if (!$clientId) {
header('Location: login.php');
exit;
}
$serverid = (int) ($_GET['id'] ?? 0);
$srv = dbRow(
"SELECT `serverid`, `name`, `online`, `status`, `boxid`, `homedir` FROM `server`
WHERE `serverid` = '" . $serverid . "' AND `clientid` = '" . $clientId . "' LIMIT 1",
true
);
if (!is_array($srv) || empty($srv)) {
header('Location: server.php');
exit;
}
$backups = [];
$res = dbQuery("SELECT * FROM `backup` WHERE `serverid` = '" . $serverid . "' ORDER BY `backupid` DESC");
while ($res && ($r = dbFetch($res))) {
$backups[] = $r;
}
$canCreate = count($backups) < backupMaxPerServer();
$msg1 = $FLASH_MSG1 ?? null;
$msg2 = $FLASH_MSG2 ?? null;
include tpl('header');
include tpl('serverbackup');
include tpl('footer');