Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmo213 committed Sep 17, 2024
1 parent 2d938f8 commit eab5bd2
Showing 1 changed file with 7 additions and 18 deletions.
25 changes: 7 additions & 18 deletions scripts/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function syslog_shell_exec($cmd, $sudo_user = null) {

$output = shell_exec($command);

#echo $output;
echo $output;
die();
}

Expand All @@ -56,8 +56,8 @@ function syslog_shell_exec($cmd, $sudo_user = null) {
$site_name = str_replace('\'', "", $site_name);
$birdweather_id = $_GET["birdweather_id"];
$apprise_input = $_GET['apprise_input'];
$apprise_notification_title = base64_decode($_GET['apprise_notification_title']);
$apprise_notification_body = base64_decode($_GET['apprise_notification_body']);
$apprise_notification_title = $_GET['apprise_notification_title'];
$apprise_notification_body = $_GET['apprise_notification_body'];
$minimum_time_limit = $_GET['minimum_time_limit'];
$flickr_api_key = $_GET['flickr_api_key'];
$flickr_filter_email = $_GET["flickr_filter_email"];
Expand Down Expand Up @@ -225,7 +225,7 @@ function() {
fclose($apprise_test_config);

$output = shell_exec($command);
echo $output;
#echo $output;

die();
}
Expand Down Expand Up @@ -480,16 +480,14 @@ function runProcess() {
<dd>Overlap set in "Advanced Settings"</dd>
<dt>$flickrimage</dt>
<dd>A preview image of the detected species from Flickr. Set your API key below.</dd>
<dt>$wikiurl</dt>
<dd>A link to the Wikipedia page</dd>
<dt>$reason</dt>
<dd>The reason a notification was sent</dd>
</dl>
<p>Use the variables defined above to customize your notification title and body.</p>
<label for="apprise_notification_title">Notification Title: </label>
<input name="apprise_notification_title" id="apprise_notification_title" style="width: 100%" type="text" value="<?php print($config['APPRISE_NOTIFICATION_TITLE']);?>" /><br>
<input name="apprise_notification_title" style="width: 100%" type="text" value="<?php print($config['APPRISE_NOTIFICATION_TITLE']);?>" /><br>
<label for="apprise_notification_body">Notification Body: </label>
<input name="apprise_notification_body" id="apprise_notification_body" style="width: 100%" type="text" value='<?php print($config['APPRISE_NOTIFICATION_BODY']);?>' /><br>
<input name="apprise_notification_body" style="width: 100%" type="text" value='<?php print($config['APPRISE_NOTIFICATION_BODY']);?>' /><br>
<input type="checkbox" name="apprise_notify_new_species" <?php if($config['APPRISE_NOTIFY_NEW_SPECIES'] == 1 && filesize($home."/BirdNET-Pi/apprise.txt") != 0) { echo "checked"; };?> >
<label for="apprise_notify_new_species">Notify each new infrequent species detection (<5 visits per week)</label><br>
<input type="checkbox" name="apprise_notify_new_species_each_day" <?php if($config['APPRISE_NOTIFY_NEW_SPECIES_EACH_DAY'] == 1 && filesize($home."/BirdNET-Pi/apprise.txt") != 0) { echo "checked"; };?> >
Expand Down Expand Up @@ -680,16 +678,7 @@ function handleChange(checkbox) {
<input type="hidden" name="status" value="success">
<input type="hidden" name="submit" value="settings">
<div class="float">
<button type="submit" id="basicformsubmit" onclick="formSubmit()" name="view" value="Settings">

<script type="text/javascript">
function formSubmit() {
if(document.getElementById('basicform').checkValidity()) {
document.getElementById('apprise_notification_title').value = btoa(document.getElementById('apprise_notification_title').value);
document.getElementById('apprise_notification_body').value = btoa(document.getElementById('apprise_notification_body').value);
document.getElementById('basicformsubmit').innerHTML = 'Updating... please wait.';
document.getElementById('basicformsubmit').classList.add('disabled');
}
<button type="submit" id="basicformsubmit" onclick="if(document.getElementById('basicform').checkValidity()){this.innerHTML = 'Updating... please wait.';this.classList.add('disabled')}" name="view" value="Settings">
}
</script>

Expand Down

0 comments on commit eab5bd2

Please sign in to comment.