From a8f497f3c2085dce620cb7e321922993960d257e Mon Sep 17 00:00:00 2001 From: Manuel Weiser Date: Sat, 4 Aug 2018 19:22:23 +0200 Subject: [PATCH] corrected autoupdate functions --- _html/rahmen.html | 4 +- alarmmail.inc.php | 2 +- autocheck.php | 4 +- config.inc.php | 20 +++-- get.php | 8 +- index.php | 24 ++--- index.php.bak | 211 -------------------------------------------- pmfunctions.inc.php | 2 +- profile.php | 2 +- uw_check.inc.php | 2 +- 10 files changed, 40 insertions(+), 239 deletions(-) delete mode 100755 index.php.bak diff --git a/_html/rahmen.html b/_html/rahmen.html index 9697d47..01d27c3 100755 --- a/_html/rahmen.html +++ b/_html/rahmen.html @@ -67,7 +67,7 @@ $body_html - + diff --git a/alarmmail.inc.php b/alarmmail.inc.php index a6823b1..eb39e2c 100755 --- a/alarmmail.inc.php +++ b/alarmmail.inc.php @@ -52,7 +52,7 @@ if( trim($row["funktion"]) != 'Klartext' && trim($row["funktion"]) != 'Info' && if ( $row_alarm_mail["ft_allow"] == 1 ) { // Wenn FullText erlaubt - mail_alarm(get_date_long($row["zeit"]), get_time($row["zeit"]), $row_alarm_mail["a_mail"],$row["org"],$row["org_name"],$row["bezeichnung"],utf8_decode($row["text"])); + mail_alarm(get_date_long($row["zeit"]), get_time($row["zeit"]), $row_alarm_mail["a_mail"],$row["org"],$row["org_name"],$row["bezeichnung"],$row["text"]); } else { diff --git a/autocheck.php b/autocheck.php index cc6665a..abd0111 100755 --- a/autocheck.php +++ b/autocheck.php @@ -61,7 +61,8 @@ require('config.inc.php'); if( !$row["org_name"] ) $row["org_name"] = $row["adresse_neu"]; } - + +/* // Unwetter Check $result = mysqli_query($dbconn, "SELECT u_meldung, u_text, u_farbe, DATE_FORMAT(u_lastcheck, '%Y%m%d%H%i%s') AS u_lastcheck, DATE_FORMAT(u_lastchange, '%Y%m%d%H%i%s') AS u_lastchange FROM unwetter WHERE id = '1'") or die (mysqli_error($dbconn)); $row = mysqli_fetch_array($result); @@ -129,6 +130,7 @@ if( ($timestampnow - $row["u_lastcheck"]) > ($uw_checktime * 100) ) mysqli_query($dbconn, "UPDATE unwetter SET u_meldung='$unwetter_status', u_text='$unwetter_meldung', u_farbe='$unwetter_farbe', u_lastcheck='$timestampnow', u_lastchange='$timestampnow' WHERE id = '1'") or die(mysqli_error($dbconn)); } } +*/ mysqli_close($dbconn); ?> diff --git a/config.inc.php b/config.inc.php index 4be2117..a71bcc2 100755 --- a/config.inc.php +++ b/config.inc.php @@ -27,7 +27,7 @@ // http://board.fire-devils.org oder manuelw@fire-devils.org // // Damit auch alles in die DB gespeichert wird sollte man -// "index.php?nooutput=1" in einen Cron aller Minute einbinden. +// "autoupdate.php?nooutput=1" in einen Cron aller Minute einbinden. // // Die Status müssen in der .monrc folgendermaßen // definiert sein. Wichtig ist das KFZ: bzw LST: voran steht. @@ -96,13 +96,13 @@ $template_dir = '_html/'; $update_adresse_monrc = 1; // IP Bereich fr auto Login -$ip_start = '192.168.1.82'; +$ip_start = '192.168.1.2'; $ip_ende = '192.168.1.250'; // UserID für IP $ip_users = array( - "192.168.1.82" => 1, - "192.168.1.21" => 1, + "192.168.1.81" => 1, + "192.168.1.80" => 1, "192.168.1.38" => 1, ); @@ -309,12 +309,18 @@ $dbconn = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname) or die (mysqli_erro // session_start(); +if (!isset($_GET["nooutput"])) $_GET["nooutput"]=""; +if ($_GET["nooutput"] == 1) { + $_SESSION["name"]=""; + $_SESSION["admin"]=""; +} + ///////////////// // Requires ///////////////// require_once('functions.inc.php'); -require_once('loginfunctions.inc.php'); -//if( $pmenable == '1' && $_GET["nooutput"] != '1' && $_SESSION["pmallow"] == '1' ) require_once('pmfunctions.inc.php'); +if ($_GET["nooutput"] != '1') require_once('loginfunctions.inc.php'); +if( $pmenable == '1' && $_GET["nooutput"] != '1' && $_SESSION["pmallow"] == '1' ) require_once('pmfunctions.inc.php'); //if( $uw_checktime > 0 ) require_once('uw_check.inc.php'); /////////////////// @@ -329,7 +335,7 @@ if( $_SESSION["name"] ) // Navigationsleiste $nav_menu = 'Home | '; -//$nav_menu .= 'Suche | '; +$nav_menu .= 'Suche | '; //$nav_menu .= 'Fahrzeuge | '; $nav_menu .= 'Profil | '; //$nav_menu .= 'Stats | '; diff --git a/get.php b/get.php index fe46032..9fb1976 100755 --- a/get.php +++ b/get.php @@ -41,7 +41,7 @@ require('config.inc.php'); } if (!isset($_SESSION["lastupdate"])) $_SESSION["lastupdate"]; -if (!isset($show_filter)) $show_filter; +if (!isset($show_filter)) $show_filter=""; if( $show_filter == 1 && $_SESSION["lastupdate"] == "" && !isset($_GET["clean"]) ) { $show_filter = filter_zeit(1); @@ -55,7 +55,7 @@ elseif( $show_filter == 1 && $_SESSION["lastupdate"] != "" && isset($_GET["clean $show_filter = " WHERE a.zeit > '$show_filter' "; } else { //if( $show_filter != 1 ) { - $show_filter = filter_zeit((isset($filter) ? $filter : 1)); + $show_filter = filter_zeit((isset($filter)) ? $filter : 1); $show_filter = " WHERE a.zeit > '$show_filter' "; } @@ -81,7 +81,7 @@ else { //if( $show_filter != 1 ) { // // Daten f¸r Formatierung holen und in array->session schreiben - if( !isset($_SESSION["formatierung"]) && !isset($_GET["nooutput"]) ) + if( (!isset($_SESSION["formatierung"]) || $_SESSION["formatierung"]=="") && (!isset($_GET["nooutput"]) || $_GET["nooutput"] == "") ) { $result = mysqli_query($dbconn, "SELECT id, bg_farbe, text_farbe, text_format, text_groesse, text_groesse_text FROM formatierung ORDER BY id ASC") or die (mysqli_error($dbconn)); while($row = mysqli_fetch_array($result)) @@ -129,7 +129,7 @@ else { //if( $show_filter != 1 ) { //$nextday = ' $show[$tageswechsel] .= ' -  Tageswechsel: '.get_date_long($row["zeit"]).' +  Tageswechsel: '.get_date_long($row["zeit"]).' '; } diff --git a/index.php b/index.php index 5155096..4623be5 100755 --- a/index.php +++ b/index.php @@ -44,25 +44,28 @@ require_once("config.inc.php"); } // Filter Status anzeigen - if( !isset($_GET["stat"]) && !isset($_SESSION["stat"]) ) + if( (!isset($_GET["stat"]) || $_GET["stat"] == "") && (!isset($_SESSION["stat"]) || $_SESSION["stat"] == "") ) { - $stat = '0'; + $stat = '0'; } - elseif( $_GET["stat"] == '' && isset($_SESSION["stat"]) ) + elseif( (isset($_GET["stat"]) && $_GET["stat"] == '') && isset($_SESSION["stat"]) ) { $stat = $_SESSION["stat"]; } - elseif( $_GET["stat"] != '' ) + elseif( isset($_GET["stat"]) && $_GET["stat"] != "" ) { $stat = $_GET["stat"]; $_SESSION["stat"] = $_GET["stat"]; } + else { + $stat = 0; + } // Wenn Aktualisierung ohne Ausgabe - if( isset($_GET["nooutput"]) ) { $filter = 1; $stat = 1; } + if( isset($_GET["nooutput"]) && $_GET["nooutput"] == 1 ) { $filter = 1; $stat = 1; } $show_filter = filter_zeit($filter); - $show_filter = " WHERE a.zeit > '$show_filter' "; + $show_filter = " WHERE a.zeit > '$show_filter' "; $refresh = ' @@ -70,9 +73,9 @@ require_once("config.inc.php"); $nav_org_filter = ' '; - if( isset($_GET["pmdo"]) && empty($can_pm) ) + if( (!isset($can_pm) || $can_pm!=1) && isset($_GET["msg_to"]) ) { // pm_allow ist auf 0 if (!isset($message_field)) $message_field=""; diff --git a/profile.php b/profile.php index abdc986..f167689 100755 --- a/profile.php +++ b/profile.php @@ -40,7 +40,7 @@ if( !isset($_GET["do"]) ) $wap_pass = $row["wap_pass"]; - if( $row["a_alarmmail2sms"] == 1 ) $checked = 'checked'; + ( $row["a_alarmmail2sms"] == 1 ) ? $checked = 'checked' : $checked=""; $mailform_checkbox = ''; $mailform_mail = ''; diff --git a/uw_check.inc.php b/uw_check.inc.php index 71038a5..334640c 100755 --- a/uw_check.inc.php +++ b/uw_check.inc.php @@ -26,7 +26,7 @@ $row = mysqli_fetch_array($result); if( ($timestampnow - $row["u_lastcheck"]) > ($uw_checktime * 100) && $_GET["nooutput"] == 1 ) { // if( $lines = file('http://www.dwd.de/de/WundK/Warnungen/zeige.php?ID='.$uw_landkreis.'#O') ) - if( $lines = file('http://www.dwd.de/dyn/app/ws/html/reports/'.$uw_landkreis.'_warning_de.html') ) + if( $lines = file('https://www.dwd.de/DE/wetter/warnungen/warnWetter_node.html?ort=Leipzig') ) { // Durchgehen des Arrays und Anzeigen des HTML Source inkl. Zeilennummern if( is_array($lines) )