From 68cbb337fd2ec1d412496d48523d203cafbd0a3b Mon Sep 17 00:00:00 2001 From: frederik Date: Fri, 15 Mar 2024 10:35:09 +0100 Subject: [PATCH] convert index.php --- homepage/index.php | 42 +++++------------------------------------- 1 file changed, 5 insertions(+), 37 deletions(-) diff --git a/homepage/index.php b/homepage/index.php index 995d6a3..0fa008a 100644 --- a/homepage/index.php +++ b/homepage/index.php @@ -3,22 +3,11 @@ /* Prevent XSS input */ $_GET = filter_input_array(INPUT_GET, FILTER_SANITIZE_STRING); $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING); +require_once 'scripts/common.php'; +$config = get_config(); +$site_name = get_sitename(); +set_timezone(); -if(!isset($_SESSION['my_timezone'])) { - $_SESSION['my_timezone'] = trim(shell_exec('timedatectl show --value --property=Timezone')); -} -date_default_timezone_set($_SESSION['my_timezone']); - - if (file_exists('./scripts/thisrun.txt')) { - $config = parse_ini_file('./scripts/thisrun.txt'); - } elseif (file_exists('./scripts/firstrun.ini')) { - $config = parse_ini_file('./scripts/firstrun.ini'); - } - if($config["SITE_NAME"] == "") { - $site_name = "BirdNET-Pi"; - } else { - $site_name = $config['SITE_NAME']; - } ?> <?php echo $site_name; ?> @@ -41,33 +30,12 @@ echo "

$site_name

"; - } else { - header('WWW-Authenticate: Basic realm="My Realm"'); - header('HTTP/1.0 401 Unauthorized'); - echo 'You cannot listen to the live audio stream'; - exit; - } - } } else { echo "