diff --git a/webadmin/EN/backup_keys_progress_template.html b/webadmin/EN/backup_keys_progress_template.html new file mode 100644 index 0000000000000000000000000000000000000000..d61f56199b525ac6ce99e1baa23827685cabe75e --- /dev/null +++ b/webadmin/EN/backup_keys_progress_template.html @@ -0,0 +1,72 @@ +<!DOCTYPE html> +<html> + <head> + <meta http-equiv="Refresh" content="10"> + <style> + #headerpic { + width: 60%; + height: auto; + margin-right : auto; + margin-left : auto; + min-width : 220px; + } + + .header { + text-align: center; + padding: 32px; + } + + #iconpic { + width: 20%; + height: auto; + margin-right : auto; + margin-left : auto; + min-width : 120px; + } + + .appurl { + color: grey; + font-size: 100%; + } + + .appdesc { + color: black; + font-size: 65%; + } + + button { + border: none; + outline: 0; + display: inline-block; + padding: 8px; + color: white; + background-color: #000; + text-align: center; + cursor: pointer; + width: 100%; + font-size: 18px; + } + + a { + text-decoration: none; + color: black; + } + + button:hover, a:hover { + opacity: 0.7; + } + + </style> + </head> + <body> + <div class="header"> + <a href="backup.html"><img id="headerpic" class="img-responsive" src="images/logo.png"></a> + + <h3>Running backup of keys</h3> + + <p>This may take a few minutes.</p> + <br><br> + </div> + + </body> +</html> diff --git a/webadmin/backupkeysconfirm.php b/webadmin/backupkeysconfirm.php new file mode 100755 index 0000000000000000000000000000000000000000..7ac43a2d2a80c7357627655947e153d25a0b8fb4 --- /dev/null +++ b/webadmin/backupkeysconfirm.php @@ -0,0 +1,31 @@ +<?php + +// This receives the yes/no confirmation before +// backup of keys + +$output_filename = "backup.html"; + +if (isset($_POST['submitbackupkeys'])) { + if(isset($_POST['backupkeysconfirm'])) { + $confirm = htmlspecialchars($_POST['backupkeysconfirm']); + + if($confirm == "1") { + if(! file_exists(".start_backup_keys")) { + exec('touch .start_backup_keys'); + } + exec('cp backup_keys_progress_template.html backup_keys_progress.html'); + $output_filename = "backup_keys_progress.html"; + } + else { + if(file_exists(".start_backup_keys")) { + exec('rm .start_backup_keys'); + } + } + } +} + +$htmlfile = fopen("$output_filename", "r") or die("Unable to open $output_filename"); +echo fread($htmlfile,filesize("$output_filename")); +fclose($htmlfile); + +?>