-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrestore.php
More file actions
66 lines (54 loc) · 1.85 KB
/
Copy pathrestore.php
File metadata and controls
66 lines (54 loc) · 1.85 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
declare(strict_types=1);
namespace CMS\PhpBackup;
if (!isset($_GET['app']) || empty($_GET['app'])) {
$msg = 'Forbidden';
header('HTTP/1.1 403 ' . $msg, true, 403);
exit($msg);
}
require_once __DIR__ . DIRECTORY_SEPARATOR . 'defines.php';
if (!defined('ABS_PATH')) {
$msg = 'ABS_PATH not defined';
header('HTTP/1.1 500 ' . $msg, true, 500);
exit($msg);
}
use CMS\PhpBackup\Api\ActionHandler;
use CMS\PhpBackup\Api\AjaxController;
use CMS\PhpBackup\App\RestoreRunner;
use CMS\PhpBackup\Core\AppConfig;
session_start();
$config = AppConfig::loadAppConfig($_GET['app']);
(new RestoreRunner($config))->registerActions();
?>
<head>
<title>Step-by-Step Backup Restore</title>
<?php AjaxController::printCsrfToken(); ?>
<script src="assets/js/lib/jquery/jquery-3.7.1.min.js"></script>
<script src="assets/js/restore.js"></script>
<link rel="stylesheet" href="assets/css/step-container.css">
</head>
<main>
<h1>Step-by-Step Backup Restore</h1>
<div id="step-list-backups" action="list-backups" class="step-container active-step">
<h2>Step 1: Select Remote Storage</h2>
<div>
<?php
// Example array of storage labels
$storageLabels = ['Local', 'pCloud'];
// Loop through the array to create radio buttons
foreach ($storageLabels as $index => $label) {
$id = 'storage' . $index; // Unique ID for each radio button
echo '<input type="radio" id="' . $id . '" name="remoteStorage" value="' . $label . '">';
echo '<label for="' . $id . '">' . $label . '</label><br>';
}
?>
</div>
<div class="btn-container">
<button id="btn-step-list-backups"
data-nonce='<?php echo ActionHandler::generateNonce('list-backups'); ?>'
data-action='list-backups'>Next</button>
</div>
</div>
</main>
<footer>
</footer>