fixed the streamer mess
This commit is contained in:
+10
-8
@@ -8,29 +8,30 @@
|
|||||||
if(isset($_GET['stream'])){
|
if(isset($_GET['stream'])){
|
||||||
if (file_exists('/home/pi/BirdNET-Pi/thisrun.txt')) {
|
if (file_exists('/home/pi/BirdNET-Pi/thisrun.txt')) {
|
||||||
$config = parse_ini_file('/home/pi/BirdNET-Pi/thisrun.txt');
|
$config = parse_ini_file('/home/pi/BirdNET-Pi/thisrun.txt');
|
||||||
} elseif (file_exists('/home/pi/BirdNET-Pi/firstrun.ini')) {
|
} elseif (file_exists('/home/pi/BirdNET-Pi/firstrun.ini')) {
|
||||||
$config = parse_ini_file('/home/pi/BirdNET-Pi/firstrun.ini');
|
$config = parse_ini_file('/home/pi/BirdNET-Pi/firstrun.ini');
|
||||||
}
|
}
|
||||||
$caddypwd = $config['CADDY_PWD'];
|
$caddypwd = $config['CADDY_PWD'];
|
||||||
if (!isset($_SERVER['PHP_AUTH_USER'])) {
|
if (!isset($_SERVER['PHP_AUTH_USER'])) {
|
||||||
header('WWW-Authenticate: Basic realm="My Realm"');
|
header('WWW-Authenticate: Basic realm="My Realm"');
|
||||||
header('HTTP/1.0 401 Unauthorized');
|
header('HTTP/1.0 401 Unauthorized');
|
||||||
echo 'You cannot listen to the live audio stream';
|
echo 'You cannot listen to the live audio stream';
|
||||||
exit;
|
exit;
|
||||||
} else {
|
} else {
|
||||||
$submittedpwd = $_SERVER['PHP_AUTH_PW'];
|
$submittedpwd = $_SERVER['PHP_AUTH_PW'];
|
||||||
$submitteduser = $_SERVER['PHP_AUTH_USER'];
|
$submitteduser = $_SERVER['PHP_AUTH_USER'];
|
||||||
if($submittedpwd == $caddypwd && $submitteduser == 'birdnet'){
|
if($submittedpwd == $caddypwd && $submitteduser == 'birdnet'){
|
||||||
echo "
|
echo "
|
||||||
<audio controls autoplay><source src=\"/stream\"></audio>
|
<audio controls autoplay><source src=\"/stream\"></audio>
|
||||||
<h1><a href=\"\">BirdNET-Pi</a></h1>";
|
<h1><a href=\"\">BirdNET-Pi</a></h1>
|
||||||
|
</div>";
|
||||||
} else {
|
} else {
|
||||||
header('WWW-Authenticate: Basic realm="My Realm"');
|
header('WWW-Authenticate: Basic realm="My Realm"');
|
||||||
header('HTTP/1.0 401 Unauthorized');
|
header('HTTP/1.0 401 Unauthorized');
|
||||||
echo 'You cannot listen to the live audio stream';
|
echo 'You cannot listen to the live audio stream';
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
echo "
|
echo "
|
||||||
<form action=\"\" method=\"GET\">
|
<form action=\"\" method=\"GET\">
|
||||||
@@ -64,5 +65,6 @@ if(isset($_GET['log'])) {
|
|||||||
header("Location: /spectrogram.php");
|
header("Location: /spectrogram.php");
|
||||||
} else {
|
} else {
|
||||||
echo "
|
echo "
|
||||||
<iframe src=\"/views.php\">";
|
<iframe src=\"/views.php\">
|
||||||
|
</div>";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,10 @@ a {
|
|||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a:hover {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-12
@@ -56,21 +56,11 @@ if($statement5 == False) {
|
|||||||
$result5 = $statement5->execute();
|
$result5 = $statement5->execute();
|
||||||
$speciestally = $result5->fetchArray(SQLITE3_ASSOC);
|
$speciestally = $result5->fetchArray(SQLITE3_ASSOC);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>Overview</title>
|
<title>Overview</title>
|
||||||
<style>
|
|
||||||
button, a, form {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
|
||||||
<div class="overview">
|
<div class="overview">
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -99,10 +89,9 @@ padding: 0;
|
|||||||
<button type="submit" name="species" value="<?php echo $mostrecent['Com_Name'];?>"><?php echo $mostrecent['Com_Name'];?>: </button>
|
<button type="submit" name="species" value="<?php echo $mostrecent['Com_Name'];?>"><?php echo $mostrecent['Com_Name'];?>: </button>
|
||||||
<a href="https://wikipedia.org/wiki/<?php echo $sciname;?>" target="_blank"/><i><?php echo $mostrecent['Sci_Name'];?></i></a><br>Confidence: <?php echo $mostrecent['Confidence'];?><br>
|
<a href="https://wikipedia.org/wiki/<?php echo $sciname;?>" target="_blank"/><i><?php echo $mostrecent['Sci_Name'];?></i></a><br>Confidence: <?php echo $mostrecent['Confidence'];?><br>
|
||||||
<?php echo $mostrecent['Date']." ".$mostrecent['Time'];?><br><video controls poster="<?php echo $filename.".png";?>"><source src="<?php echo $filename;?>"></video></td>
|
<?php echo $mostrecent['Date']." ".$mostrecent['Time'];?><br><video controls poster="<?php echo $filename.".png";?>"><source src="<?php echo $filename;?>"></video></td>
|
||||||
|
</form>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</form>
|
|
||||||
<?php
|
<?php
|
||||||
if (file_exists('/home/pi/BirdSongs/Extracted/Charts/'.$chart)) {
|
if (file_exists('/home/pi/BirdSongs/Extracted/Charts/'.$chart)) {
|
||||||
echo "<img class=\"centered\" src=\"/Charts/$chart?nocache=time()\">";
|
echo "<img class=\"centered\" src=\"/Charts/$chart?nocache=time()\">";
|
||||||
|
|||||||
Reference in New Issue
Block a user