checks for empty urls
This commit is contained in:
+16
-4
@@ -30,16 +30,28 @@ if (!isset($_SERVER['PHP_AUTH_USER'])) {
|
||||
echo "<h1>BirdNET-Pi</h1><form action=\"\" method=\"GET\"><button type=\"submit\" name=\"stream\" value=\"play\">Live Audio</button></form>";
|
||||
}
|
||||
echo "</div>";
|
||||
if(isset($_GET['log'])){
|
||||
if(isset($_GET['log'])) {
|
||||
if (file_exists('/home/pi/BirdNET-Pi/thisrun.txt')) {
|
||||
$config = parse_ini_file('/home/pi/BirdNET-Pi/thisrun.txt');
|
||||
$logs = $config['BIRDNETLOG_URL'];
|
||||
if(empty($config['BIRDNETLOG_URL']) !== true) {
|
||||
$logs = $config['BIRDNETLOG_URL'];
|
||||
} elseif(empty($config['BIRDNETPI_URL'] !== true)) {
|
||||
$logs = $config['BIRDNETPI_URL'].":8080";
|
||||
} else {
|
||||
$logs = "http://birdnetpi.local:8080";
|
||||
}
|
||||
} elseif (file_exists('/home/pi/BirdNET-Pi/firstrun.ini')) {
|
||||
$config = parse_ini_file('/home/pi/BirdNET-Pi/firstrun.ini');
|
||||
$logs = $config['BIRDNETLOG_URL'];
|
||||
if(empty($config['BIRDNETLOG_URL']) !== true){
|
||||
$logs = $config['BIRDNETLOG_URL'];
|
||||
} elseif(empty($config['BIRDNETPI_URL'] !== true)) {
|
||||
$logs = $config['BIRDNETPI_URL'].":8080";
|
||||
} else {
|
||||
$logs = "http://birdnetpi.local:8080";
|
||||
}
|
||||
}
|
||||
header("Location: $logs");
|
||||
}elseif(isset($_GET['spectrogram'])){
|
||||
} elseif(isset($_GET['spectrogram'])){
|
||||
header("Location: /spectrogram.php");
|
||||
} else {
|
||||
echo "<iframe src=\"/views.php\" width=\"100%\" height=\"85%\">";
|
||||
|
||||
+1
-5
@@ -11,7 +11,7 @@
|
||||
<button type="submit" name="view" value="Recordings" id="views">Recordings</button>
|
||||
</form>
|
||||
<form action="index.php" method="GET" id="log">
|
||||
<button type="submit" name="log" value="log" id="log">View Log</button>
|
||||
<button type="submit" name="log" value="log" id="Log">View Log</button>
|
||||
</form>
|
||||
<form action="index.php" method="GET" id="spectrogram">
|
||||
<button style="float:none;"type="submit" name="spectrogram" value="view" id="spectrogram">Spectrogram</button>
|
||||
@@ -61,10 +61,6 @@ if(isset($_POST['view'])){
|
||||
if($_POST['view'] == "Recordings"){include('play.php');}
|
||||
if($_POST['view'] == "Settings"){include('scripts/config.php');}
|
||||
if($_POST['view'] == "Advanced"){include('scripts/advanced.php');}
|
||||
if($_POST['view'] == "Log"){
|
||||
$url = 'http://birdnetpi.local:8080';
|
||||
header("location: $url;");
|
||||
}
|
||||
if($_POST['view'] == "Included"){
|
||||
if(isset($_POST['species']) && isset($_POST['add'])){
|
||||
$file = '/home/pi/BirdNET-Pi/include_species_list.txt';
|
||||
|
||||
Reference in New Issue
Block a user