feat: add special disable

This commit is contained in:
Matthieu Bessat 2021-10-03 14:23:32 +02:00
parent 1377fa669a
commit b2f27aa3f4
2 changed files with 22 additions and 1 deletions

View file

@ -32,5 +32,6 @@ return [
], ],
'auth' => [ 'auth' => [
'root' => 'password' 'root' => 'password'
] ],
'special_token' => 'password'
]; ];

View file

@ -3,6 +3,26 @@
require('utils.php'); require('utils.php');
require('load_config.php'); require('load_config.php');
/* Disable function */
if (file_exists('./DISABLE')) {
header('X-Disabled: Yes');
http_response_code(503);
?>
<p>503</p>
<iframe
width="560" height="315" frameborder="0"
src="https://www.youtube-nocookie.com/embed/D1rlGA_UGrY?autoplay=1&controls=0"
allow="autoplay;encrypted-media;picture-in-picture" allowfullscreen>
</iframe>
<?php
exit();
}
if ($_SERVER['REQUEST_URI'] === '/special-disable?token=' . $config['special_token']) {
file_put_contents('./DISABLE', '1');
echo "Disabled successfully";
exit();
}
function generateHelp($selectedModule) { function generateHelp($selectedModule) {
if (strpos($_SERVER['REQUEST_URI'], '/help') === false) { if (strpos($_SERVER['REQUEST_URI'], '/help') === false) {
return; return;