Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d903ac4fc | ||
|
|
86115b18a7 | ||
|
|
19f1ac7ec8 |
+72
-66
@@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
|
||||||
|
|
||||||
// WICHTIG: Pfade aus /admin heraus korrekt auflösen
|
// WICHTIG: Pfade aus /admin heraus korrekt auflösen
|
||||||
require_once __DIR__ . "/../inc/config.inc.php";
|
require_once __DIR__ . "/../inc/config.inc.php";
|
||||||
@@ -28,7 +27,7 @@ include("templates/footer.inc.php");
|
|||||||
Herzlich Willkommen im internen Bereich!<br><br>
|
Herzlich Willkommen im internen Bereich!<br><br>
|
||||||
</div>
|
</div>
|
||||||
<div style="width:200px;">
|
<div style="width:200px;">
|
||||||
<form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'); ?>" id="formbenutzersuche" method="POST">
|
<form action="<?php echo self_action(); ?>" id="formbenutzersuche" method="POST">
|
||||||
<input type="hidden" name="aktion" value="benutzersuche" />
|
<input type="hidden" name="aktion" value="benutzersuche" />
|
||||||
<input type="hidden" name="userid_input" id="userid_input" />
|
<input type="hidden" name="userid_input" id="userid_input" />
|
||||||
<label>Benutzersuche Anfragen:</label>
|
<label>Benutzersuche Anfragen:</label>
|
||||||
@@ -67,28 +66,28 @@ if(!check_worker()){
|
|||||||
echo "</div><div class='container main-container' style='background-color:white;'>";
|
echo "</div><div class='container main-container' style='background-color:white;'>";
|
||||||
|
|
||||||
echo '<div style="float: left;padding: 20px;">
|
echo '<div style="float: left;padding: 20px;">
|
||||||
<form action="' . $_SERVER["PHP_SELF"] .'" method=POST>
|
<form action="' . self_action() .'" method=POST>
|
||||||
<input type=hidden name=aktion value="1">
|
<input type=hidden name=aktion value="1">
|
||||||
<input type=hidden name=art value="1">
|
<input type=hidden name=art value="1">
|
||||||
<input type=submit class="btn btn-primary btn-sm" value="Unbeantworte Anfragen">
|
<input type=submit class="btn btn-primary btn-sm" value="Unbeantworte Anfragen">
|
||||||
</form>
|
</form>
|
||||||
</div>';
|
</div>';
|
||||||
echo '<div style="float: left;padding: 20px;">
|
echo '<div style="float: left;padding: 20px;">
|
||||||
<form action="' . $_SERVER["PHP_SELF"] .'" method=POST>
|
<form action="' . self_action() .'" method=POST>
|
||||||
<input type=hidden name=aktion value="1">
|
<input type=hidden name=aktion value="1">
|
||||||
<input type=hidden name=art value="2">
|
<input type=hidden name=art value="2">
|
||||||
<input type=submit class="btn btn-primary btn-sm" value="Letzten 100 Anfragen">
|
<input type=submit class="btn btn-primary btn-sm" value="Letzten 100 Anfragen">
|
||||||
</form>
|
</form>
|
||||||
</div>';
|
</div>';
|
||||||
echo '<div style="float: left;padding: 20px;">
|
echo '<div style="float: left;padding: 20px;">
|
||||||
<form action="' . $_SERVER["PHP_SELF"] .'" method=POST>
|
<form action="' . self_action() .'" method=POST>
|
||||||
<input type=hidden name=aktion value="1">
|
<input type=hidden name=aktion value="1">
|
||||||
<input type=hidden name=art value="3">
|
<input type=hidden name=art value="3">
|
||||||
<input type=submit class="btn btn-primary btn-sm" value="Letzten 500 Anfragen">
|
<input type=submit class="btn btn-primary btn-sm" value="Letzten 500 Anfragen">
|
||||||
</form>
|
</form>
|
||||||
</div>';
|
</div>';
|
||||||
echo '<div style="float: left;padding: 20px;">
|
echo '<div style="float: left;padding: 20px;">
|
||||||
<form action="' . $_SERVER["PHP_SELF"] .'" method=POST>
|
<form action="' . self_action() .'" method=POST>
|
||||||
<input type=hidden name=aktion value="1">
|
<input type=hidden name=aktion value="1">
|
||||||
<input type=hidden name=art value="4">
|
<input type=hidden name=art value="4">
|
||||||
<input type=submit class="btn btn-primary btn-sm" value="Alle Anfragen">
|
<input type=submit class="btn btn-primary btn-sm" value="Alle Anfragen">
|
||||||
@@ -175,30 +174,34 @@ if(!check_worker()){
|
|||||||
$date_created = $row["create_time"];
|
$date_created = $row["create_time"];
|
||||||
$update_time = $row["update_time"];
|
$update_time = $row["update_time"];
|
||||||
|
|
||||||
$vorname = $row["vorname"];
|
// Alle vom Patienten stammenden Felder werden hier maskiert.
|
||||||
$nachname = $row["nachname"];
|
// Sie landen weiter unten unveraendert in einem HTML-String;
|
||||||
$mail = $row["email"];
|
// ohne e() koennte ein Anfragetext Skriptcode in den Browser
|
||||||
$tel = $row["tele"];
|
// der Mitarbeiterin einschleusen.
|
||||||
|
$vorname = e((string)$row["vorname"]);
|
||||||
|
$nachname = e((string)$row["nachname"]);
|
||||||
|
$mail = e((string)$row["email"]);
|
||||||
|
$tel = e((string)$row["tele"]);
|
||||||
$beantwortet = $row["beantwortet"];
|
$beantwortet = $row["beantwortet"];
|
||||||
|
|
||||||
$geburtstag = $row["geburtstag"];
|
$geburtstag = e((string)$row["geburtstag"]);
|
||||||
$ausgabegeburstag = $geburtstag;
|
$ausgabegeburstag = $geburtstag;
|
||||||
|
|
||||||
$ort = $row["ort"];
|
$ort = e((string)$row["ort"]);
|
||||||
$plz = $row["plz"];
|
$plz = e((string)$row["plz"]);
|
||||||
$strasse = $row["strasse"];
|
$strasse = e((string)$row["strasse"]);
|
||||||
|
|
||||||
$nachricht = $row["nachricht"];
|
$nachricht = e((string)$row["nachricht"]);
|
||||||
$medikamenteins = $row["medikament1"];
|
$medikamenteins = e((string)$row["medikament1"]);
|
||||||
$medikamentzwei = $row["medikament2"];
|
$medikamentzwei = e((string)$row["medikament2"]);
|
||||||
$medikamentdrei = $row["medikament3"];
|
$medikamentdrei = e((string)$row["medikament3"]);
|
||||||
$medikamentvier = $row["medikament4"];
|
$medikamentvier = e((string)$row["medikament4"]);
|
||||||
$medikamentfuenf = $row["medikament5"];
|
$medikamentfuenf = e((string)$row["medikament5"]);
|
||||||
$medikamentsechs = $row["medikament6"];
|
$medikamentsechs = e((string)$row["medikament6"]);
|
||||||
$dateiname = $row["dateiname"];
|
$dateiname = e((string)$row["dateiname"]);
|
||||||
|
|
||||||
|
|
||||||
$anfrageart = $row["artname"];
|
$anfrageart = e((string)$row["artname"]);
|
||||||
$ordnungsid = $row["ordnungsid"];
|
$ordnungsid = $row["ordnungsid"];
|
||||||
$ordnungsstring = GetOrdnungsid($ordnungsid);
|
$ordnungsstring = GetOrdnungsid($ordnungsid);
|
||||||
$WeitereInfos= "";
|
$WeitereInfos= "";
|
||||||
@@ -246,21 +249,21 @@ if(!check_worker()){
|
|||||||
$adresse = $adresse;
|
$adresse = $adresse;
|
||||||
echo "<tr style='background-color:". $farbe. ";'><td>$userausgabe <br> $mail <br>Tel:<a href='tel:".$tel."'>$tel</a></td><td>$adresse</td><td>$ordnungsstring - $anfrageart <br>$WeitereInfos</td><td>$datumausgabe</td><td>$update_time<br>$checkausgabe<br>$ausgabeworker</td><td>
|
echo "<tr style='background-color:". $farbe. ";'><td>$userausgabe <br> $mail <br>Tel:<a href='tel:".$tel."'>$tel</a></td><td>$adresse</td><td>$ordnungsstring - $anfrageart <br>$WeitereInfos</td><td>$datumausgabe</td><td>$update_time<br>$checkausgabe<br>$ausgabeworker</td><td>
|
||||||
<div style='float: left;margin:15px; height: 20px;'>
|
<div style='float: left;margin:15px; height: 20px;'>
|
||||||
<form action='". $_SERVER["PHP_SELF"] ."' method=POST>
|
<form action='". self_action() ."' method=POST>
|
||||||
<input type=hidden name=aktion value=2>
|
<input type=hidden name=aktion value=2>
|
||||||
<input type=hidden name=anfrageid value=$anfrageid>
|
<input type=hidden name=anfrageid value=$anfrageid>
|
||||||
<input type=submit class='btn btn-primary' value='Antworten'>
|
<input type=submit class='btn btn-primary' value='Antworten'>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div style='float: left;margin:15px; height: 20px;'>
|
<div style='float: left;margin:15px; height: 20px;'>
|
||||||
<form action='". $_SERVER["PHP_SELF"] ."' method=POST>
|
<form action='". self_action() ."' method=POST>
|
||||||
<input type=hidden name=aktion value=20>
|
<input type=hidden name=aktion value=20>
|
||||||
<input type=hidden name=anfrageid value=$anfrageid>
|
<input type=hidden name=anfrageid value=$anfrageid>
|
||||||
<input type=submit class='btn btn-primary' value='Telefonisch beantwortet'>
|
<input type=submit class='btn btn-primary' value='Telefonisch beantwortet'>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div style='float: left;margin:15px; height: 20px;'>
|
<div style='float: left;margin:15px; height: 20px;'>
|
||||||
<form action='". $_SERVER["PHP_SELF"] ."' method=POST>
|
<form action='". self_action() ."' method=POST>
|
||||||
<input type=hidden name=aktion value=8>
|
<input type=hidden name=aktion value=8>
|
||||||
<input type=hidden name=anfrageid value=$anfrageid>
|
<input type=hidden name=anfrageid value=$anfrageid>
|
||||||
<input type=submit class='btn btn-primary' value='Löschen'>
|
<input type=submit class='btn btn-primary' value='Löschen'>
|
||||||
@@ -269,7 +272,7 @@ if(!check_worker()){
|
|||||||
if($beantwortet){
|
if($beantwortet){
|
||||||
echo "
|
echo "
|
||||||
<div style='float: left;margin:15px; height: 20px;'>
|
<div style='float: left;margin:15px; height: 20px;'>
|
||||||
<form action='". $_SERVER["PHP_SELF"] ."' method=POST>
|
<form action='". self_action() ."' method=POST>
|
||||||
<input type=hidden name=aktion value=11>
|
<input type=hidden name=aktion value=11>
|
||||||
<input type=hidden name=anfrageid value=$anfrageid>
|
<input type=hidden name=anfrageid value=$anfrageid>
|
||||||
<input type=submit class='btn btn-primary' value='Antwort einsehen'>
|
<input type=submit class='btn btn-primary' value='Antwort einsehen'>
|
||||||
@@ -290,7 +293,7 @@ if(!check_worker()){
|
|||||||
// Benutzer nachtragen
|
// Benutzer nachtragen
|
||||||
}else if (($_POST["aktion"] ?? '') == "2") {
|
}else if (($_POST["aktion"] ?? '') == "2") {
|
||||||
|
|
||||||
echo "<form action='". $_SERVER['PHP_SELF'] . "' method=POST>";
|
echo "<form action='". self_action() . "' method=POST>";
|
||||||
|
|
||||||
|
|
||||||
$anfrageid = (int)($_POST["anfrageid"] ?? 0);
|
$anfrageid = (int)($_POST["anfrageid"] ?? 0);
|
||||||
@@ -330,31 +333,33 @@ if(!check_worker()){
|
|||||||
$antwortid = $row["antwortid"] ?? null;
|
$antwortid = $row["antwortid"] ?? null;
|
||||||
$date_created = $row["create_time"];
|
$date_created = $row["create_time"];
|
||||||
|
|
||||||
$vorname = $row["vorname"];
|
// Patientendaten maskieren - sie werden unten in HTML-Strings
|
||||||
$nachname = $row["nachname"];
|
// eingesetzt und ausgegeben.
|
||||||
$mail = $row["email"];
|
$vorname = e((string)$row["vorname"]);
|
||||||
$tel = $row["tele"];
|
$nachname = e((string)$row["nachname"]);
|
||||||
|
$mail = e((string)$row["email"]);
|
||||||
|
$tel = e((string)$row["tele"]);
|
||||||
|
|
||||||
$geburtstag = $row["geburtstag"];
|
$geburtstag = e((string)$row["geburtstag"]);
|
||||||
$ausgabegeburstag = $geburtstag;
|
$ausgabegeburstag = $geburtstag;
|
||||||
|
|
||||||
$ort = $row["ort"];
|
$ort = e((string)$row["ort"]);
|
||||||
$plz = $row["plz"];
|
$plz = e((string)$row["plz"]);
|
||||||
$strasse = $row["strasse"];
|
$strasse = e((string)$row["strasse"]);
|
||||||
|
|
||||||
$ordnungsid = $row["ordnungsid"];
|
$ordnungsid = $row["ordnungsid"];
|
||||||
$ordnungsstring = GetOrdnungsid($ordnungsid);
|
$ordnungsstring = GetOrdnungsid($ordnungsid);
|
||||||
|
|
||||||
$nachricht = $row["nachricht"];
|
$nachricht = e((string)$row["nachricht"]);
|
||||||
|
|
||||||
$medikamenteins = $row["medikament1"];
|
$medikamenteins = e((string)$row["medikament1"]);
|
||||||
$medikamentzwei = $row["medikament2"];
|
$medikamentzwei = e((string)$row["medikament2"]);
|
||||||
$medikamentdrei = $row["medikament3"];
|
$medikamentdrei = e((string)$row["medikament3"]);
|
||||||
$medikamentvier = $row["medikament4"];
|
$medikamentvier = e((string)$row["medikament4"]);
|
||||||
$medikamentfuenf = $row["medikament5"];
|
$medikamentfuenf = e((string)$row["medikament5"]);
|
||||||
$medikamentsechs = $row["medikament6"];
|
$medikamentsechs = e((string)$row["medikament6"]);
|
||||||
|
|
||||||
$anfrageart = $row["artname"];
|
$anfrageart = e((string)$row["artname"]);
|
||||||
$antworttext = $row["antworttext"] ?? null;
|
$antworttext = $row["antworttext"] ?? null;
|
||||||
|
|
||||||
$WeitereInfos = "";
|
$WeitereInfos = "";
|
||||||
@@ -464,12 +469,12 @@ if(!check_worker()){
|
|||||||
|
|
||||||
echo "<h1>E-Mail bearbeiten</h1><br>";
|
echo "<h1>E-Mail bearbeiten</h1><br>";
|
||||||
|
|
||||||
echo "<form action='". $_SERVER['PHP_SELF'] . "' method=POST>";
|
echo "<form action='". self_action() . "' method=POST>";
|
||||||
echo "Betreff:<br>";
|
echo "Betreff:<br>";
|
||||||
echo "<input class='form-control' name=betreff type=text value='$betreff' id='betreff' onclick='checkTemplate()'><br>";
|
echo "<input class='form-control' name=betreff type=text value='$betreff' id='betreff' onclick='checkTemplate()'><br>";
|
||||||
echo '<textarea height=400 name="body" id="trumbowyg-demo" ></textarea>';
|
echo '<textarea height=400 name="body" id="trumbowyg-demo" ></textarea>';
|
||||||
echo "<input name=aktion type=hidden value=3>";
|
echo "<input name=aktion type=hidden value=3>";
|
||||||
echo "<input name=anfrageid type=hidden value='". $_POST["anfrageid"] ."' id='anfrageid'><br><br>";
|
echo "<input name=anfrageid type=hidden value='". (int)($_POST["anfrageid"] ?? 0) ."' id='anfrageid'><br><br>";
|
||||||
echo "<input type=submit class='btn btn-primary' value='Mail versenden'><br>";
|
echo "<input type=submit class='btn btn-primary' value='Mail versenden'><br>";
|
||||||
echo '</form>';
|
echo '</form>';
|
||||||
echo "<br><br>";
|
echo "<br><br>";
|
||||||
@@ -624,7 +629,7 @@ if(!check_worker()){
|
|||||||
So sollten Sie bei Urlaub ab Montag hier den Starttermin auf Freitag oder Samstag stellen. <br>
|
So sollten Sie bei Urlaub ab Montag hier den Starttermin auf Freitag oder Samstag stellen. <br>
|
||||||
Gleiches gilt für ein Ende an einem Freitag. Tragen Sie dann hier als Ende Sonntag ein.<br><br><br>";
|
Gleiches gilt für ein Ende an einem Freitag. Tragen Sie dann hier als Ende Sonntag ein.<br><br><br>";
|
||||||
|
|
||||||
echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="POST">';
|
echo '<form action="' . self_action() . '" method="POST">';
|
||||||
|
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
$start = (string)$row["start"];
|
$start = (string)$row["start"];
|
||||||
@@ -754,7 +759,7 @@ if(!check_worker()){
|
|||||||
echo "<h3>Aktuell gibt es folgende Einträge für die Notfallsprechstunde</h3>";
|
echo "<h3>Aktuell gibt es folgende Einträge für die Notfallsprechstunde</h3>";
|
||||||
echo "Soll die Notfallsprechstunde deaktiviert / gelöscht werden, dann das Anfangs- und Enddatum in die Vergangenheit legen und den Eintrag speichern.<br><br><br>";
|
echo "Soll die Notfallsprechstunde deaktiviert / gelöscht werden, dann das Anfangs- und Enddatum in die Vergangenheit legen und den Eintrag speichern.<br><br><br>";
|
||||||
|
|
||||||
echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="POST">';
|
echo '<form action="' . self_action() . '" method="POST">';
|
||||||
|
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
$start = $row["start"];
|
$start = $row["start"];
|
||||||
@@ -840,7 +845,7 @@ if(!check_worker()){
|
|||||||
}
|
}
|
||||||
die("Fehler beim Eintragen in der Datenbank: " . $e->getMessage());
|
die("Fehler beim Eintragen in der Datenbank: " . $e->getMessage());
|
||||||
}
|
}
|
||||||
echo' <form action="'. $_SERVER["PHP_SELF"] .'" method=POST>
|
echo' <form action="'. self_action() .'" method=POST>
|
||||||
<input type=hidden name=aktion value=6>
|
<input type=hidden name=aktion value=6>
|
||||||
<input type=submit class="btn btn-primary" value="Zurück">
|
<input type=submit class="btn btn-primary" value="Zurück">
|
||||||
</form>';
|
</form>';
|
||||||
@@ -875,12 +880,12 @@ if(!check_worker()){
|
|||||||
|
|
||||||
echo "Name:<br>$userausgabe<br>Anforderung: $impfstofftext<br>";
|
echo "Name:<br>$userausgabe<br>Anforderung: $impfstofftext<br>";
|
||||||
echo "Wollen Sie wirklich diesen Eintrag löschen?<br>Dieses ist nicht rückgängig zu machen!<br>Dann bestätigen Sie die Abmeldung:<br>";
|
echo "Wollen Sie wirklich diesen Eintrag löschen?<br>Dieses ist nicht rückgängig zu machen!<br>Dann bestätigen Sie die Abmeldung:<br>";
|
||||||
echo "<form action='". $_SERVER['PHP_SELF'] . "' method=POST>";
|
echo "<form action='". self_action() . "' method=POST>";
|
||||||
echo '<input type="hidden" name="aktion" id="aktion" value="9" />';
|
echo '<input type="hidden" name="aktion" id="aktion" value="9" />';
|
||||||
echo '<input type="hidden" name="anfrageid" id="anfrageid" value="'. $anfrageid .'" /><br>';
|
echo '<input type="hidden" name="anfrageid" id="anfrageid" value="'. $anfrageid .'" /><br>';
|
||||||
echo '<input type="submit" class="btn btn-primary" id="submitbox" value="Anforderung löschen (mit Mail)" />';
|
echo '<input type="submit" class="btn btn-primary" id="submitbox" value="Anforderung löschen (mit Mail)" />';
|
||||||
echo "<br>";
|
echo "<br>";
|
||||||
echo "<form action='". $_SERVER['PHP_SELF'] . "' method=POST>";
|
echo "<form action='". self_action() . "' method=POST>";
|
||||||
echo '<input type="hidden" name="aktion" id="aktion" value="10" />';
|
echo '<input type="hidden" name="aktion" id="aktion" value="10" />';
|
||||||
echo '<input type="hidden" name="anfrageid" id="anfrageid" value="'. $anfrageid .'" /><br>';
|
echo '<input type="hidden" name="anfrageid" id="anfrageid" value="'. $anfrageid .'" /><br>';
|
||||||
echo '<input type="submit" class="btn btn-primary" id="submitbox" value="Anforderung löschen (ohne Mail)" />';
|
echo '<input type="submit" class="btn btn-primary" id="submitbox" value="Anforderung löschen (ohne Mail)" />';
|
||||||
@@ -1196,7 +1201,7 @@ if(!check_worker()){
|
|||||||
$stmt->execute([':term' => $like]);
|
$stmt->execute([':term' => $like]);
|
||||||
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
echo "<form action='" . $_SERVER['PHP_SELF'] . "' id='formbenutzersuche' method='POST'>";
|
echo "<form action='" . self_action() . "' id='formbenutzersuche' method='POST'>";
|
||||||
echo '<input type="hidden" name="aktion" value="benutzersuche" />';
|
echo '<input type="hidden" name="aktion" value="benutzersuche" />';
|
||||||
echo '<label>Benutzersuche:</label>';
|
echo '<label>Benutzersuche:</label>';
|
||||||
echo '<select class="form-control" name="userid_input" required>';
|
echo '<select class="form-control" name="userid_input" required>';
|
||||||
@@ -1374,7 +1379,7 @@ if(!check_worker()){
|
|||||||
. "</td>";
|
. "</td>";
|
||||||
|
|
||||||
echo "<td>
|
echo "<td>
|
||||||
<form action='" . $_SERVER["PHP_SELF"] . "' method='POST'>
|
<form action='" . self_action() . "' method='POST'>
|
||||||
<input type='hidden' name='aktion' value='11'>
|
<input type='hidden' name='aktion' value='11'>
|
||||||
<input type='hidden' name='anfrageid' value='" . (int)$anfrageid . "'>
|
<input type='hidden' name='anfrageid' value='" . (int)$anfrageid . "'>
|
||||||
<button type='submit' class='btn btn-primary btn-sm'>Antwort einsehen</button>
|
<button type='submit' class='btn btn-primary btn-sm'>Antwort einsehen</button>
|
||||||
@@ -1429,7 +1434,7 @@ if(!check_worker()){
|
|||||||
|
|
||||||
// Umbuchen-Form (person_id weitergeben)
|
// Umbuchen-Form (person_id weitergeben)
|
||||||
echo "
|
echo "
|
||||||
<form action='" . $_SERVER["PHP_SELF"] . "' method='POST'>
|
<form action='" . self_action() . "' method='POST'>
|
||||||
<input type='hidden' name='aktion' value='umbuchen'>
|
<input type='hidden' name='aktion' value='umbuchen'>
|
||||||
<input type='hidden' name='person_id' value='" . (int)$personId . "'>
|
<input type='hidden' name='person_id' value='" . (int)$personId . "'>
|
||||||
<input type='submit' class='btn btn-primary btn-sm' value='Neuer Termin'>
|
<input type='submit' class='btn btn-primary btn-sm' value='Neuer Termin'>
|
||||||
@@ -1798,7 +1803,7 @@ if(!check_worker()){
|
|||||||
|
|
||||||
echo "<br><br>";
|
echo "<br><br>";
|
||||||
|
|
||||||
echo "<form action='". $_SERVER['PHP_SELF'] . "' method=POST>";
|
echo "<form action='". self_action() . "' method=POST>";
|
||||||
echo "Betreff:<br>";
|
echo "Betreff:<br>";
|
||||||
echo "<input class='form-control' name=betreff type=text value='". $betreff . "'> <br>";
|
echo "<input class='form-control' name=betreff type=text value='". $betreff . "'> <br>";
|
||||||
echo '<textarea height=200 name="body" id="mytextarea"> '. $body . '</textarea>';
|
echo '<textarea height=200 name="body" id="mytextarea"> '. $body . '</textarea>';
|
||||||
@@ -1832,7 +1837,7 @@ if(!check_worker()){
|
|||||||
// Auswahl der E-Mail Vorlagen
|
// Auswahl der E-Mail Vorlagen
|
||||||
} else if (($_POST["aktion"] ?? '') == "16") {
|
} else if (($_POST["aktion"] ?? '') == "16") {
|
||||||
|
|
||||||
echo "<form action='" . $_SERVER['PHP_SELF'] . "' method='POST'>";
|
echo "<form action='" . self_action() . "' method='POST'>";
|
||||||
echo "Wählen Sie die zu bearbeitende Mailvorlage aus:<br><br>";
|
echo "Wählen Sie die zu bearbeitende Mailvorlage aus:<br><br>";
|
||||||
|
|
||||||
$stmt = $pdo->prepare("
|
$stmt = $pdo->prepare("
|
||||||
@@ -1903,7 +1908,7 @@ if(!check_worker()){
|
|||||||
|
|
||||||
echo "<br><br>";
|
echo "<br><br>";
|
||||||
|
|
||||||
echo "<form action='". $_SERVER['PHP_SELF'] . "' method=POST>";
|
echo "<form action='". self_action() . "' method=POST>";
|
||||||
echo "Name der Vorlage:<br>";
|
echo "Name der Vorlage:<br>";
|
||||||
echo "<input class='form-control' name=name type=text value='$name' required><br>";
|
echo "<input class='form-control' name=name type=text value='$name' required><br>";
|
||||||
echo "Betreff:<br>";
|
echo "Betreff:<br>";
|
||||||
@@ -1979,25 +1984,25 @@ if(!check_worker()){
|
|||||||
echo '<h3>Welche Aktion möchtest du durchführen?</h3>
|
echo '<h3>Welche Aktion möchtest du durchführen?</h3>
|
||||||
<table width=100%><tr><td width=40%>
|
<table width=100%><tr><td width=40%>
|
||||||
|
|
||||||
<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>
|
<form action="'. self_action() .'" method=POST>
|
||||||
<input type=hidden name=aktion value=1>
|
<input type=hidden name=aktion value=1>
|
||||||
<input type=submit class="btn btn-primary btn-lg" value="Formular-Anfragen bearbeiten">
|
<input type=submit class="btn btn-primary btn-lg" value="Formular-Anfragen bearbeiten">
|
||||||
</form>
|
</form>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
<tr><td><br><br>
|
<tr><td><br><br>
|
||||||
<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>
|
<form action="'. self_action() .'" method=POST>
|
||||||
<input type=hidden name=aktion value=18>
|
<input type=hidden name=aktion value=18>
|
||||||
<input type=submit class="btn btn-primary" value="Mailvorlagen anlegen">
|
<input type=submit class="btn btn-primary" value="Mailvorlagen anlegen">
|
||||||
</form>
|
</form>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
<tr><td><br><br>
|
<tr><td><br><br>
|
||||||
<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>
|
<form action="'. self_action() .'" method=POST>
|
||||||
<input type=hidden name=aktion value=12>
|
<input type=hidden name=aktion value=12>
|
||||||
<input type=submit class="btn btn-primary" value="Formular Auswertung">
|
<input type=submit class="btn btn-primary" value="Formular Auswertung">
|
||||||
</form>
|
</form>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
<tr><td><br><br>
|
<tr><td><br><br>
|
||||||
<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>
|
<form action="'. self_action() .'" method=POST>
|
||||||
<input type=hidden name=aktion value=16>
|
<input type=hidden name=aktion value=16>
|
||||||
<input type=submit class="btn btn-primary" value="Mailvorlagen anpassen">
|
<input type=submit class="btn btn-primary" value="Mailvorlagen anpassen">
|
||||||
</form>
|
</form>
|
||||||
@@ -2005,13 +2010,13 @@ if(!check_worker()){
|
|||||||
<tr></tr>
|
<tr></tr>
|
||||||
<tr><td><h3>Urlaub / Hinweis planen</h3></td><td></td></tr>
|
<tr><td><h3>Urlaub / Hinweis planen</h3></td><td></td></tr>
|
||||||
<tr><td>
|
<tr><td>
|
||||||
<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>
|
<form action="'. self_action() .'" method=POST>
|
||||||
<input type=hidden name=aktion value=4>
|
<input type=hidden name=aktion value=4>
|
||||||
<input type=submit class="btn btn-primary btn-lg" value="Urlaub eintragen">
|
<input type=submit class="btn btn-primary btn-lg" value="Urlaub eintragen">
|
||||||
</form>
|
</form>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
<tr><td><br><br>
|
<tr><td><br><br>
|
||||||
<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>
|
<form action="'. self_action() .'" method=POST>
|
||||||
<input type=hidden name=aktion value=6>
|
<input type=hidden name=aktion value=6>
|
||||||
<input type=submit class="btn btn-primary" value="Notfallsprechstunde eintragen">
|
<input type=submit class="btn btn-primary" value="Notfallsprechstunde eintragen">
|
||||||
</form>
|
</form>
|
||||||
@@ -2043,7 +2048,7 @@ if(!check_worker()){
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<br><br><br><input type="button" class='btn btn-secondary' value="Zum Hauptmenü" onClick="location.href='<?php echo $_SERVER['PHP_SELF'];?>'">
|
<br><br><br><input type="button" class='btn btn-secondary' value="Zum Hauptmenü" onClick="location.href='<?php echo self_action();?>'">
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
@@ -2092,7 +2097,8 @@ if(!check_worker()){
|
|||||||
url: 'mailtemplate.php',
|
url: 'mailtemplate.php',
|
||||||
data: {
|
data: {
|
||||||
templetid: templetid,
|
templetid: templetid,
|
||||||
anfrageid: anfrageid
|
anfrageid: anfrageid,
|
||||||
|
csrf_token: "<?php echo csrf_token(); ?>"
|
||||||
},
|
},
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
|
||||||
require_once(__DIR__ . "/../inc/config.inc.php");
|
require_once(__DIR__ . "/../inc/config.inc.php");
|
||||||
require_once(__DIR__ . "/../inc/functions.inc.php");
|
require_once(__DIR__ . "/../inc/functions.inc.php");
|
||||||
|
|
||||||
@@ -24,7 +23,7 @@ if (!$user) {
|
|||||||
<?php
|
<?php
|
||||||
##test2
|
##test2
|
||||||
echo '<div style="float: right; width: 200px; ">';
|
echo '<div style="float: right; width: 200px; ">';
|
||||||
echo "<form action='". $_SERVER['PHP_SELF'] . "' id='formbenutzersuche' method=POST>";
|
echo "<form action='". self_action() . "' id='formbenutzersuche' method=POST>";
|
||||||
echo '<input type="hidden" name="aktion" value="benutzersuche" />';
|
echo '<input type="hidden" name="aktion" value="benutzersuche" />';
|
||||||
echo '<input type="hidden" name="userid_input" id="userid_input" />';
|
echo '<input type="hidden" name="userid_input" id="userid_input" />';
|
||||||
echo '<label>Benutzersuche Anfragen:</label>
|
echo '<label>Benutzersuche Anfragen:</label>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
|
||||||
|
|
||||||
require_once __DIR__ . "/../inc/config.inc.php";
|
require_once __DIR__ . "/../inc/config.inc.php";
|
||||||
require_once __DIR__ . "/../inc/functions.inc.php";
|
require_once __DIR__ . "/../inc/functions.inc.php";
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
<?php
|
<?php
|
||||||
$_GET['view'] = 'event-create';
|
$_GET['view'] = 'event-create';
|
||||||
require_once __DIR__ . '/impfworkflow.php';
|
require_once __DIR__ . '/impfworkflow.php';
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
<?php
|
<?php
|
||||||
$_GET['view'] = 'event-teilnehmer';
|
$_GET['view'] = 'event-teilnehmer';
|
||||||
require_once __DIR__ . '/impfworkflow.php';
|
require_once __DIR__ . '/impfworkflow.php';
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
|
||||||
|
|
||||||
require_once __DIR__ . "/../inc/config.inc.php";
|
require_once __DIR__ . "/../inc/config.inc.php";
|
||||||
require_once __DIR__ . "/../inc/functions.inc.php";
|
require_once __DIR__ . "/../inc/functions.inc.php";
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
<?php
|
<?php
|
||||||
$_GET['view'] = 'teilnehmer';
|
$_GET['view'] = 'teilnehmer';
|
||||||
require_once __DIR__ . '/impfworkflow.php';
|
require_once __DIR__ . '/impfworkflow.php';
|
||||||
|
|||||||
+6
-9
@@ -1,7 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
if (session_status() !== PHP_SESSION_ACTIVE) {
|
|
||||||
session_start();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
require_once(__DIR__ . "/../inc/config.inc.php");
|
require_once(__DIR__ . "/../inc/config.inc.php");
|
||||||
@@ -67,25 +64,25 @@ include("templates/footer.inc.php");
|
|||||||
echo '<h4>Welche Aktion möchtest du durchführen?</h4>
|
echo '<h4>Welche Aktion möchtest du durchführen?</h4>
|
||||||
<table width=100%><tr><td width=40%>
|
<table width=100%><tr><td width=40%>
|
||||||
|
|
||||||
<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>
|
<form action="'. self_action() .'" method=POST>
|
||||||
<input type=hidden name=aktion value=1>
|
<input type=hidden name=aktion value=1>
|
||||||
<input type=submit class="btn btn-primary btn-lg" value="Formular-Anfragen bearbeiten">
|
<input type=submit class="btn btn-primary btn-lg" value="Formular-Anfragen bearbeiten">
|
||||||
</form>
|
</form>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
<tr><td><br><br>
|
<tr><td><br><br>
|
||||||
<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>
|
<form action="'. self_action() .'" method=POST>
|
||||||
<input type=hidden name=aktion value=18>
|
<input type=hidden name=aktion value=18>
|
||||||
<input type=submit class="btn btn-primary" value="Mailvorlagen anlegen">
|
<input type=submit class="btn btn-primary" value="Mailvorlagen anlegen">
|
||||||
</form>
|
</form>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
<tr><td><br><br>
|
<tr><td><br><br>
|
||||||
<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>
|
<form action="'. self_action() .'" method=POST>
|
||||||
<input type=hidden name=aktion value=12>
|
<input type=hidden name=aktion value=12>
|
||||||
<input type=submit class="btn btn-primary" value="Formular Auswertung">
|
<input type=submit class="btn btn-primary" value="Formular Auswertung">
|
||||||
</form>
|
</form>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
<tr><td><br><br>
|
<tr><td><br><br>
|
||||||
<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>
|
<form action="'. self_action() .'" method=POST>
|
||||||
<input type=hidden name=aktion value=16>
|
<input type=hidden name=aktion value=16>
|
||||||
<input type=submit class="btn btn-primary" value="Mailvorlagen anpassen">
|
<input type=submit class="btn btn-primary" value="Mailvorlagen anpassen">
|
||||||
</form>
|
</form>
|
||||||
@@ -93,13 +90,13 @@ include("templates/footer.inc.php");
|
|||||||
<tr></tr>
|
<tr></tr>
|
||||||
<tr><td><h3>Urlaub / Hinweis planen</h3></td><td></td></tr>
|
<tr><td><h3>Urlaub / Hinweis planen</h3></td><td></td></tr>
|
||||||
<tr><td>
|
<tr><td>
|
||||||
<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>
|
<form action="'. self_action() .'" method=POST>
|
||||||
<input type=hidden name=aktion value=4>
|
<input type=hidden name=aktion value=4>
|
||||||
<input type=submit class="btn btn-primary btn-lg" value="Urlaub eintragen">
|
<input type=submit class="btn btn-primary btn-lg" value="Urlaub eintragen">
|
||||||
</form>
|
</form>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
<tr><td><br><br>
|
<tr><td><br><br>
|
||||||
<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>
|
<form action="'. self_action() .'" method=POST>
|
||||||
<input type=hidden name=aktion value=6>
|
<input type=hidden name=aktion value=6>
|
||||||
<input type=submit class="btn btn-primary" value="Notfallsprechstunde eintragen">
|
<input type=submit class="btn btn-primary" value="Notfallsprechstunde eintragen">
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
+1
-2
@@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
|
||||||
require_once(__DIR__ . "/../inc/config.inc.php");
|
require_once(__DIR__ . "/../inc/config.inc.php");
|
||||||
require_once(__DIR__ . "/../inc/functions.inc.php");
|
require_once(__DIR__ . "/../inc/functions.inc.php");
|
||||||
|
|
||||||
@@ -55,7 +54,7 @@ function build_calendar($month, $year) {
|
|||||||
$calendar .= "<td class='day' rel='$date' onClick='submitForm(\"".$date ."\")'>$currentDay";
|
$calendar .= "<td class='day' rel='$date' onClick='submitForm(\"".$date ."\")'>$currentDay";
|
||||||
|
|
||||||
}
|
}
|
||||||
$calendar .= "<form action='". $_SERVER['PHP_SELF'] . "' name='".$date ."' method=POST><input type=hidden name=searchdate value='". $date. "'><input type=hidden name=aktion value='4'></form>";
|
$calendar .= "<form action='". self_action() . "' name='".$date ."' method=POST><input type=hidden name=searchdate value='". $date. "'><input type=hidden name=aktion value='4'></form>";
|
||||||
$calendar .= AuswertungImpfungdailycalendar($date);
|
$calendar .= AuswertungImpfungdailycalendar($date);
|
||||||
$calendar .= "</td>";
|
$calendar .= "</td>";
|
||||||
|
|
||||||
|
|||||||
+66
-56
@@ -1,9 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
// admin/bootstrap.php
|
// admin/bootstrap.php
|
||||||
ob_start(); // fängt zufälligen Output ab, verhindert "headers already sent" Folgeschäden
|
ob_start(); // fängt zufälligen Output ab, verhindert "headers already sent" Folgeschäden
|
||||||
if (session_status() !== PHP_SESSION_ACTIVE) {
|
|
||||||
session_start();
|
|
||||||
}
|
|
||||||
|
|
||||||
require_once(__DIR__ . "/../inc/config.inc.php");
|
require_once(__DIR__ . "/../inc/config.inc.php");
|
||||||
require_once(__DIR__ . "/../inc/functions.inc.php");
|
require_once(__DIR__ . "/../inc/functions.inc.php");
|
||||||
@@ -14,61 +11,74 @@ if (!empty($_POST['email']) && !empty($_POST['passwort'])) {
|
|||||||
$email = $_POST['email'];
|
$email = $_POST['email'];
|
||||||
$passwort = $_POST['passwort'];
|
$passwort = $_POST['passwort'];
|
||||||
|
|
||||||
$statement = $pdo->prepare("SELECT * FROM users WHERE email = :email LIMIT 1");
|
// Brute-Force-Bremse: nach mehreren Fehlversuchen ist die Anmeldung fuer
|
||||||
$statement->execute(['email' => $email]);
|
// dieses Konto bzw. diese IP zeitweise gesperrt. Die Pruefung laeuft vor
|
||||||
$user = $statement->fetch(PDO::FETCH_ASSOC);
|
// password_verify(), damit gesperrte Versuche gar nicht erst rechnen.
|
||||||
|
$sperreSekunden = login_gesperrt($pdo, $email);
|
||||||
|
|
||||||
if ($user && password_verify($passwort, $user['passwort'])) {
|
if ($sperreSekunden > 0) {
|
||||||
|
$error_msg = login_sperr_text($sperreSekunden);
|
||||||
// Session IMMER setzen
|
|
||||||
session_regenerate_id(true);
|
|
||||||
$_SESSION['auth'] = [
|
|
||||||
'type' => 'admin',
|
|
||||||
'id' => (int)$user['id'],
|
|
||||||
];
|
|
||||||
|
|
||||||
// "Angemeldet bleiben" optional
|
|
||||||
if (!empty($_POST['angemeldet_bleiben'])) {
|
|
||||||
$identifier = bin2hex(random_bytes(16));
|
|
||||||
$securitytoken = bin2hex(random_bytes(32)); // stärker als random_string()
|
|
||||||
|
|
||||||
$hash = hash('sha256', $securitytoken);
|
|
||||||
|
|
||||||
// Ablaufdatum nur setzen, wenn die Spalte existiert - der Code laeuft
|
|
||||||
// damit vor und nach der Migration. Ablauf per NOW() in SQL, weil
|
|
||||||
// Webserver und DB-Server in verschiedenen Zeitzonen laufen.
|
|
||||||
if (securitytokensHatAblaufspalte($pdo)) {
|
|
||||||
$insert = $pdo->prepare("
|
|
||||||
INSERT INTO securitytokens (user_id, identifier, securitytoken, user_type, expires_at)
|
|
||||||
VALUES (:user_id, :identifier, :securitytoken, 'admin', DATE_ADD(NOW(), INTERVAL 30 DAY))
|
|
||||||
");
|
|
||||||
} else {
|
|
||||||
$insert = $pdo->prepare("
|
|
||||||
INSERT INTO securitytokens (user_id, identifier, securitytoken, user_type)
|
|
||||||
VALUES (:user_id, :identifier, :securitytoken, 'admin')
|
|
||||||
");
|
|
||||||
}
|
|
||||||
$insert->execute([
|
|
||||||
'user_id' => (int)$user['id'],
|
|
||||||
'identifier' => $identifier,
|
|
||||||
'securitytoken' => $hash
|
|
||||||
]);
|
|
||||||
|
|
||||||
$cookieOpts = [
|
|
||||||
'expires' => time() + 30*24*3600, // deckungsgleich mit dem Token-Ablauf
|
|
||||||
'path' => '/',
|
|
||||||
'secure' => true, // nur wenn HTTPS
|
|
||||||
'httponly' => true,
|
|
||||||
'samesite' => 'Lax',
|
|
||||||
];
|
|
||||||
setcookie('identifier', $identifier, $cookieOpts);
|
|
||||||
setcookie('securitytoken', $securitytoken, $cookieOpts);
|
|
||||||
}
|
|
||||||
|
|
||||||
header("Location: index.php");
|
|
||||||
exit;
|
|
||||||
} else {
|
} else {
|
||||||
$error_msg = "E-Mail oder Passwort war ungültig<br><br>";
|
|
||||||
|
$statement = $pdo->prepare("SELECT * FROM users WHERE email = :email LIMIT 1");
|
||||||
|
$statement->execute(['email' => $email]);
|
||||||
|
$user = $statement->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
if ($user && password_verify($passwort, $user['passwort'])) {
|
||||||
|
|
||||||
|
login_versuch_merken($pdo, $email, true);
|
||||||
|
|
||||||
|
// Session IMMER setzen
|
||||||
|
session_regenerate_id(true);
|
||||||
|
$_SESSION['auth'] = [
|
||||||
|
'type' => 'admin',
|
||||||
|
'id' => (int)$user['id'],
|
||||||
|
];
|
||||||
|
|
||||||
|
// "Angemeldet bleiben" optional
|
||||||
|
if (!empty($_POST['angemeldet_bleiben'])) {
|
||||||
|
$identifier = bin2hex(random_bytes(16));
|
||||||
|
$securitytoken = bin2hex(random_bytes(32)); // stärker als random_string()
|
||||||
|
|
||||||
|
$hash = hash('sha256', $securitytoken);
|
||||||
|
|
||||||
|
// Ablaufdatum nur setzen, wenn die Spalte existiert - der Code laeuft
|
||||||
|
// damit vor und nach der Migration. Ablauf per NOW() in SQL, weil
|
||||||
|
// Webserver und DB-Server in verschiedenen Zeitzonen laufen.
|
||||||
|
if (securitytokensHatAblaufspalte($pdo)) {
|
||||||
|
$insert = $pdo->prepare("
|
||||||
|
INSERT INTO securitytokens (user_id, identifier, securitytoken, user_type, expires_at)
|
||||||
|
VALUES (:user_id, :identifier, :securitytoken, 'admin', DATE_ADD(NOW(), INTERVAL 30 DAY))
|
||||||
|
");
|
||||||
|
} else {
|
||||||
|
$insert = $pdo->prepare("
|
||||||
|
INSERT INTO securitytokens (user_id, identifier, securitytoken, user_type)
|
||||||
|
VALUES (:user_id, :identifier, :securitytoken, 'admin')
|
||||||
|
");
|
||||||
|
}
|
||||||
|
$insert->execute([
|
||||||
|
'user_id' => (int)$user['id'],
|
||||||
|
'identifier' => $identifier,
|
||||||
|
'securitytoken' => $hash
|
||||||
|
]);
|
||||||
|
|
||||||
|
$cookieOpts = [
|
||||||
|
'expires' => time() + 30*24*3600, // deckungsgleich mit dem Token-Ablauf
|
||||||
|
'path' => '/',
|
||||||
|
'secure' => true, // nur wenn HTTPS
|
||||||
|
'httponly' => true,
|
||||||
|
'samesite' => 'Lax',
|
||||||
|
];
|
||||||
|
setcookie('identifier', $identifier, $cookieOpts);
|
||||||
|
setcookie('securitytoken', $securitytoken, $cookieOpts);
|
||||||
|
}
|
||||||
|
|
||||||
|
header("Location: index.php");
|
||||||
|
exit;
|
||||||
|
} else {
|
||||||
|
login_versuch_merken($pdo, $email, false);
|
||||||
|
$error_msg = "E-Mail oder Passwort war ungültig<br><br>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+17
-8
@@ -1,15 +1,24 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
|
||||||
session_destroy();
|
|
||||||
unset($_SESSION['userid']);
|
|
||||||
|
|
||||||
//Remove Cookies
|
|
||||||
setcookie("identifier","",time()-(3600*24*365));
|
|
||||||
setcookie("securitytoken","",time()-(3600*24*365));
|
|
||||||
|
|
||||||
require_once(__DIR__ . "/../inc/config.inc.php");
|
require_once(__DIR__ . "/../inc/config.inc.php");
|
||||||
require_once(__DIR__ . "/../inc/functions.inc.php");
|
require_once(__DIR__ . "/../inc/functions.inc.php");
|
||||||
|
|
||||||
|
// Die Sitzung wird von config.inc.php mit den richtigen Cookie-Parametern
|
||||||
|
// gestartet, deshalb erst danach abraeumen.
|
||||||
|
$_SESSION = [];
|
||||||
|
session_destroy();
|
||||||
|
|
||||||
|
// Cookies der Funktion "Angemeldet bleiben" entfernen. Die Parameter muessen
|
||||||
|
// denen beim Setzen entsprechen, sonst bleibt das Cookie stehen.
|
||||||
|
$cookieOpts = [
|
||||||
|
'expires' => time() - 3600,
|
||||||
|
'path' => '/',
|
||||||
|
'secure' => true,
|
||||||
|
'httponly' => true,
|
||||||
|
'samesite' => 'Lax',
|
||||||
|
];
|
||||||
|
setcookie('identifier', '', $cookieOpts);
|
||||||
|
setcookie('securitytoken', '', $cookieOpts);
|
||||||
|
|
||||||
include("templates/header.inc.php");
|
include("templates/header.inc.php");
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
|
||||||
require_once(__DIR__ . "/../inc/config.inc.php");
|
require_once(__DIR__ . "/../inc/config.inc.php");
|
||||||
require_once(__DIR__ . "/../inc/functions.inc.php");
|
require_once(__DIR__ . "/../inc/functions.inc.php");
|
||||||
include("templates/header.inc.php");
|
include("templates/header.inc.php");
|
||||||
@@ -44,7 +43,7 @@ dein IT Team';
|
|||||||
|
|
||||||
//echo $text;
|
//echo $text;
|
||||||
|
|
||||||
$ok = SendMailMessage($pdo, $mail, $betreff, $body);
|
$ok = SendMailMessage($pdo, $empfaenger, $betreff, $text);
|
||||||
|
|
||||||
if ($ok) {
|
if ($ok) {
|
||||||
echo "<b>Ihre Nachricht wurde erfolgreich versendet!</b><br>";
|
echo "<b>Ihre Nachricht wurde erfolgreich versendet!</b><br>";
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
|
||||||
require_once(__DIR__ . "/../inc/config.inc.php");
|
require_once(__DIR__ . "/../inc/config.inc.php");
|
||||||
require_once(__DIR__ . "/../inc/functions.inc.php");
|
require_once(__DIR__ . "/../inc/functions.inc.php");
|
||||||
if(!isset($_GET['userid']) || !isset($_GET['code'])) {
|
if(!isset($_GET['userid']) || !isset($_GET['code'])) {
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
|
||||||
require_once(__DIR__ . "/../inc/config.inc.php");
|
require_once(__DIR__ . "/../inc/config.inc.php");
|
||||||
require_once(__DIR__ . "/../inc/functions.inc.php");
|
require_once(__DIR__ . "/../inc/functions.inc.php");
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
|
||||||
|
|
||||||
// WICHTIG: Pfade aus /admin heraus korrekt auflösen
|
// WICHTIG: Pfade aus /admin heraus korrekt auflösen
|
||||||
require_once __DIR__ . "/../inc/config.inc.php";
|
require_once __DIR__ . "/../inc/config.inc.php";
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
-- Brute-Force-Bremse fuer die Anmeldung.
|
||||||
|
--
|
||||||
|
-- Haelt fehlgeschlagene und erfolgreiche Anmeldeversuche fest, damit
|
||||||
|
-- login_gesperrt() in inc/security.inc.php nach mehreren Fehlversuchen
|
||||||
|
-- zeitweise sperren kann. Ohne diese Tabelle laeuft der Login unveraendert
|
||||||
|
-- weiter, nur eben ohne Bremse.
|
||||||
|
--
|
||||||
|
-- Aufraeumen passiert im Code (Eintraege aelter als 30 Tage).
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS login_attempts (
|
||||||
|
id INT NOT NULL AUTO_INCREMENT,
|
||||||
|
email VARCHAR(255) NOT NULL,
|
||||||
|
ip_address VARCHAR(45) NOT NULL,
|
||||||
|
erfolg TINYINT(1) NOT NULL DEFAULT 0,
|
||||||
|
attempted_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
PRIMARY KEY (id),
|
||||||
|
KEY idx_email_zeit (email, attempted_at),
|
||||||
|
KEY idx_ip_zeit (ip_address, attempted_at)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="de">
|
<html lang="de">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
|
|||||||
+30
-31
@@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
|
||||||
|
|
||||||
// WICHTIG: Pfade aus /admin heraus korrekt auflösen
|
// WICHTIG: Pfade aus /admin heraus korrekt auflösen
|
||||||
require_once __DIR__ . "/../inc/config.inc.php";
|
require_once __DIR__ . "/../inc/config.inc.php";
|
||||||
@@ -24,7 +23,7 @@ include("templates/footer.inc.php");
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
echo '<div style="float: right; width: 200px; ">';
|
echo '<div style="float: right; width: 200px; ">';
|
||||||
echo "<form action='". $_SERVER['PHP_SELF'] . "' id='formbenutzersuche' method=POST>";
|
echo "<form action='". self_action() . "' id='formbenutzersuche' method=POST>";
|
||||||
echo '<input type="hidden" name="aktion" value="benutzersuche" />';
|
echo '<input type="hidden" name="aktion" value="benutzersuche" />';
|
||||||
echo '<input type="hidden" name="userid_input" id="userid_input" />';
|
echo '<input type="hidden" name="userid_input" id="userid_input" />';
|
||||||
echo '<label>Benutzersuche Impfen:</label>
|
echo '<label>Benutzersuche Impfen:</label>
|
||||||
@@ -55,7 +54,7 @@ if(!check_worker()){
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
echo '<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>';
|
echo '<form action="'. self_action() .'" method=POST>';
|
||||||
echo "Wochentag:<br>";
|
echo "Wochentag:<br>";
|
||||||
echo "<select name=date>";
|
echo "<select name=date>";
|
||||||
echo "<option value=Mo>montags</option>";
|
echo "<option value=Mo>montags</option>";
|
||||||
@@ -91,14 +90,14 @@ if(!check_worker()){
|
|||||||
|
|
||||||
|
|
||||||
echo "<br><br>";
|
echo "<br><br>";
|
||||||
echo '<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>';
|
echo '<form action="'. self_action() .'" method=POST>';
|
||||||
echo '<input type=submit class="btn btn-primary btn-sm" value="zurück">';
|
echo '<input type=submit class="btn btn-primary btn-sm" value="zurück">';
|
||||||
echo "</form>";
|
echo "</form>";
|
||||||
|
|
||||||
}elseif($_POST["aktion"] == "folgenewtermin"){
|
}elseif($_POST["aktion"] == "folgenewtermin"){
|
||||||
|
|
||||||
echo "<h3>Folge von Terminen anlegen</h3><br>";
|
echo "<h3>Folge von Terminen anlegen</h3><br>";
|
||||||
echo '<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>';
|
echo '<form action="'. self_action() .'" method=POST>';
|
||||||
echo "Datum: <input name=date type=date class='form-control' required><br>";
|
echo "Datum: <input name=date type=date class='form-control' required><br>";
|
||||||
echo "Startzeit: <input name=folgestartzeit type=time class='form-control' required><br>";
|
echo "Startzeit: <input name=folgestartzeit type=time class='form-control' required><br>";
|
||||||
echo "Länge eines Termins (Min): <input name=folgelaenge type=number class='form-control' required><br>";
|
echo "Länge eines Termins (Min): <input name=folgelaenge type=number class='form-control' required><br>";
|
||||||
@@ -112,7 +111,7 @@ if(!check_worker()){
|
|||||||
echo '<input type=submit class="btn btn-primary" value="Neue Zeitslots anlegen"></form>';
|
echo '<input type=submit class="btn btn-primary" value="Neue Zeitslots anlegen"></form>';
|
||||||
|
|
||||||
echo "<br><br>";
|
echo "<br><br>";
|
||||||
echo '<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>';
|
echo '<form action="'. self_action() .'" method=POST>';
|
||||||
echo '<input type=submit class="btn btn-primary btn-sm" value="zurück">';
|
echo '<input type=submit class="btn btn-primary btn-sm" value="zurück">';
|
||||||
echo "</form>";
|
echo "</form>";
|
||||||
|
|
||||||
@@ -128,7 +127,7 @@ if(!check_worker()){
|
|||||||
$sqlstring = "DELETE FROM togo_termin_teilnehmer WHERE terminteilnehmerid = " . (int)$_GET["uid"];
|
$sqlstring = "DELETE FROM togo_termin_teilnehmer WHERE terminteilnehmerid = " . (int)$_GET["uid"];
|
||||||
$query = mysqli_query($con,$sqlstring);
|
$query = mysqli_query($con,$sqlstring);
|
||||||
if($query){
|
if($query){
|
||||||
$sqlstring = "Update togo_termin SET count=count-1 WHERE terminid = ". $_GET["id"] . "";
|
$sqlstring = "Update togo_termin SET count=count-1 WHERE terminid = " . (int)($_GET["id"] ?? 0);
|
||||||
$query = mysqli_query($con,$sqlstring);
|
$query = mysqli_query($con,$sqlstring);
|
||||||
echo "<div class='infofenster'><h4>Eintrag wurde gelöscht!<h4></div>";
|
echo "<div class='infofenster'><h4>Eintrag wurde gelöscht!<h4></div>";
|
||||||
|
|
||||||
@@ -153,14 +152,14 @@ if(!check_worker()){
|
|||||||
$togoid = $row["IP"];
|
$togoid = $row["IP"];
|
||||||
$togodate = $row["create_time"];
|
$togodate = $row["create_time"];
|
||||||
|
|
||||||
echo "<tr><td>" . $i . "</td><td>". $togoname ." - " . $togomail . "</td><td>" . $togoid . "</td><td>" . $togodate . "</td><td> <a href=". $_SERVER["PHP_SELF"] ."?a=showtogotermin&b=removeentry&id=$terminid&uid=$terminteilnehmerid class='glyphicon glyphicon-remove' onclick=\"return confirm('Eintrag ". $togoname ."/". $togomail." wirklich löschen?');\" title='löschen'></a> </td></tr>";
|
echo "<tr><td>" . $i . "</td><td>". $togoname ." - " . $togomail . "</td><td>" . $togoid . "</td><td>" . $togodate . "</td><td> <a href=". self_action() ."?a=showtogotermin&b=removeentry&id=$terminid&uid=$terminteilnehmerid class='glyphicon glyphicon-remove' onclick=\"return confirm('Eintrag ". $togoname ."/". $togomail." wirklich löschen?');\" title='löschen'></a> </td></tr>";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
echo "</table>";
|
echo "</table>";
|
||||||
|
|
||||||
|
|
||||||
echo "<br><br>";
|
echo "<br><br>";
|
||||||
echo '<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>';
|
echo '<form action="'. self_action() .'" method=POST>';
|
||||||
echo "<input type=hidden name=aktion value=togoterminverwaltung >";
|
echo "<input type=hidden name=aktion value=togoterminverwaltung >";
|
||||||
echo '<input type=submit class="btn btn-primary btn-sm" value="zurück">';
|
echo '<input type=submit class="btn btn-primary btn-sm" value="zurück">';
|
||||||
echo "</form>";
|
echo "</form>";
|
||||||
@@ -183,7 +182,7 @@ if(!check_worker()){
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo "<h3>Termin Anpassung</h3>";
|
echo "<h3>Termin Anpassung</h3>";
|
||||||
echo '<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>';
|
echo '<form action="'. self_action() .'" method=POST>';
|
||||||
|
|
||||||
echo "Datum:<br>";
|
echo "Datum:<br>";
|
||||||
echo "<input type=date name=date class='form-control' value=$date>";
|
echo "<input type=date name=date class='form-control' value=$date>";
|
||||||
@@ -208,14 +207,14 @@ if(!check_worker()){
|
|||||||
echo "<input type=int name=error class='form-control' value=$error>";
|
echo "<input type=int name=error class='form-control' value=$error>";
|
||||||
echo "<br><br>";
|
echo "<br><br>";
|
||||||
echo "<input type=hidden name=save value=saveediteinzeltermin >";
|
echo "<input type=hidden name=save value=saveediteinzeltermin >";
|
||||||
echo "<input type=hidden name=terminid value=". $_GET["id"] . " >";
|
echo "<input type=hidden name=terminid value=" . (int)($_GET["id"] ?? 0) . " >";
|
||||||
echo '<input type=submit class="btn btn-primary btn-sm" value="Termin speichern">';
|
echo '<input type=submit class="btn btn-primary btn-sm" value="Termin speichern">';
|
||||||
echo "</form>";
|
echo "</form>";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo "<br><br>";
|
echo "<br><br>";
|
||||||
echo '<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>';
|
echo '<form action="'. self_action() .'" method=POST>';
|
||||||
//echo "<input type=hidden name=aktion value=togoterminverwaltung >";
|
//echo "<input type=hidden name=aktion value=togoterminverwaltung >";
|
||||||
|
|
||||||
echo '<input type=submit class="btn btn-primary btn-sm" value="zurück">';
|
echo '<input type=submit class="btn btn-primary btn-sm" value="zurück">';
|
||||||
@@ -243,14 +242,14 @@ if(!check_worker()){
|
|||||||
Standort: $standort<br>
|
Standort: $standort<br>
|
||||||
<br>";
|
<br>";
|
||||||
|
|
||||||
echo "<form action='". $_SERVER['PHP_SELF'] . "' method=POST>";
|
echo "<form action='". self_action() . "' method=POST>";
|
||||||
echo "Betreff:<br>";
|
echo "Betreff:<br>";
|
||||||
echo "<input name=betreff type=text class='form-control' ><br>";
|
echo "<input name=betreff type=text class='form-control' ><br>";
|
||||||
echo "<div id=my-editor></div>";
|
echo "<div id=my-editor></div>";
|
||||||
echo "Inhalt:<br>";
|
echo "Inhalt:<br>";
|
||||||
echo '<textarea height=200 name="body" id="trumbowyg-demo"></textarea>';
|
echo '<textarea height=200 name="body" id="trumbowyg-demo"></textarea>';
|
||||||
echo "<input name=save type=hidden value=savesendmail>";
|
echo "<input name=save type=hidden value=savesendmail>";
|
||||||
echo "<input name=id type=hidden value='". $_GET["id"] . "'><br><br>";
|
echo "<input name=id type=hidden value='" . (int)($_GET["id"] ?? 0) . "'><br><br>";
|
||||||
echo "<input type=submit value='Speichern'><br>";
|
echo "<input type=submit value='Speichern'><br>";
|
||||||
echo '</form>';
|
echo '</form>';
|
||||||
}else if($_GET["a"] == "togomaildeletetimes" ){
|
}else if($_GET["a"] == "togomaildeletetimes" ){
|
||||||
@@ -261,7 +260,7 @@ if(!check_worker()){
|
|||||||
echo "Hiermit werden alle Benutzer mit abgesagten Terminen informiert und die Einträge dann gelöscht.<br>";
|
echo "Hiermit werden alle Benutzer mit abgesagten Terminen informiert und die Einträge dann gelöscht.<br>";
|
||||||
|
|
||||||
|
|
||||||
echo "<form action='". $_SERVER['PHP_SELF'] . "' method=POST>";
|
echo "<form action='". self_action() . "' method=POST>";
|
||||||
echo "Betreff:<br>";
|
echo "Betreff:<br>";
|
||||||
echo "<input name=betreff type=text class='form-control' ><br>";
|
echo "<input name=betreff type=text class='form-control' ><br>";
|
||||||
echo "<div id=my-editor></div>";
|
echo "<div id=my-editor></div>";
|
||||||
@@ -288,7 +287,7 @@ if(!check_worker()){
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo "<h3>Serientermin Anpassung</h3>";
|
echo "<h3>Serientermin Anpassung</h3>";
|
||||||
echo '<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>';
|
echo '<form action="'. self_action() .'" method=POST>';
|
||||||
echo "<input type=hidden name=aktion value=togoeditserientermin class='form-control'>";
|
echo "<input type=hidden name=aktion value=togoeditserientermin class='form-control'>";
|
||||||
echo "Wochentag:<br>";
|
echo "Wochentag:<br>";
|
||||||
|
|
||||||
@@ -358,7 +357,7 @@ if(!check_worker()){
|
|||||||
|
|
||||||
|
|
||||||
echo "<br><br>";
|
echo "<br><br>";
|
||||||
echo '<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>';
|
echo '<form action="'. self_action() .'" method=POST>';
|
||||||
echo "<input type=hidden name=aktion value=togoterminverwaltung >";
|
echo "<input type=hidden name=aktion value=togoterminverwaltung >";
|
||||||
echo '<input type=submit class="btn btn-primary btn-sm" value="zurück">';
|
echo '<input type=submit class="btn btn-primary btn-sm" value="zurück">';
|
||||||
echo "</form>";
|
echo "</form>";
|
||||||
@@ -370,7 +369,7 @@ if(!check_worker()){
|
|||||||
}elseif($_GET["a"] == "togoAddUser" || $_POST["aktion"] == "togoAddUser" ){
|
}elseif($_GET["a"] == "togoAddUser" || $_POST["aktion"] == "togoAddUser" ){
|
||||||
|
|
||||||
$textausgabe .= "<h3>ToGo Anmeldung</h3>";
|
$textausgabe .= "<h3>ToGo Anmeldung</h3>";
|
||||||
$textausgabe .= '<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>';
|
$textausgabe .= '<form action="'. self_action() .'" method=POST>';
|
||||||
$textausgabe .= "Melden Sie sich unverbindlich an.<br>Es wird Ihre IP-Addresse gespeichert.<br><br><h3>Dieses dient nur zur Planung und ist keine feste Terminzusage!</h3>";
|
$textausgabe .= "Melden Sie sich unverbindlich an.<br>Es wird Ihre IP-Addresse gespeichert.<br><br><h3>Dieses dient nur zur Planung und ist keine feste Terminzusage!</h3>";
|
||||||
$textausgabe .= "Bitte beachten Sie, dass die angezeigte Anzahl der Online Anmeldungen vom tatsächlichen Andrang vor Ort abweichen kann.<br>Auch ist eine Verschiebung der Impfung für einzelne Impflinge immer möglich!<br><br>";
|
$textausgabe .= "Bitte beachten Sie, dass die angezeigte Anzahl der Online Anmeldungen vom tatsächlichen Andrang vor Ort abweichen kann.<br>Auch ist eine Verschiebung der Impfung für einzelne Impflinge immer möglich!<br><br>";
|
||||||
$textausgabe .= "";
|
$textausgabe .= "";
|
||||||
@@ -384,7 +383,7 @@ if(!check_worker()){
|
|||||||
$textausgabe .= "<input type=hidden name=save value=saveadduser >";
|
$textausgabe .= "<input type=hidden name=save value=saveadduser >";
|
||||||
//$textausgabe .= "<input type=hidden name=aktion value=togoAddUser >";
|
//$textausgabe .= "<input type=hidden name=aktion value=togoAddUser >";
|
||||||
$textausgabe .= "<input type=hidden name=ip value='PraxisTeam Eintrag' >";
|
$textausgabe .= "<input type=hidden name=ip value='PraxisTeam Eintrag' >";
|
||||||
$textausgabe .= "<input type=hidden name=terminid value='".$_GET["id"] ."' >";
|
$textausgabe .= "<input type=hidden name=terminid value='" . (int)($_GET["id"] ?? 0) . "' >";
|
||||||
$textausgabe .= '<input type=submit class="btn btn-primary btn-sm" value="Unverbindlich anmelden"><br>';
|
$textausgabe .= '<input type=submit class="btn btn-primary btn-sm" value="Unverbindlich anmelden"><br>';
|
||||||
$textausgabe .= "</form>";
|
$textausgabe .= "</form>";
|
||||||
$textausgabe .= "<br><br>Bitte beachten Sie, dass die angezeigte Anzahl der Online Anmeldungen vom tatsächlichen Andrang vor Ort abweichen kann.<br>Auch ist eine Verschiebung der Impfung für einzelne Impflinge immer möglich!<br><br>";
|
$textausgabe .= "<br><br>Bitte beachten Sie, dass die angezeigte Anzahl der Online Anmeldungen vom tatsächlichen Andrang vor Ort abweichen kann.<br>Auch ist eine Verschiebung der Impfung für einzelne Impflinge immer möglich!<br><br>";
|
||||||
@@ -399,7 +398,7 @@ if(!check_worker()){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo '<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>';
|
echo '<form action="'. self_action() .'" method=POST>';
|
||||||
|
|
||||||
echo "<input type=date name=date class='form-control'>";
|
echo "<input type=date name=date class='form-control'>";
|
||||||
echo "<br><br>";
|
echo "<br><br>";
|
||||||
@@ -423,7 +422,7 @@ if(!check_worker()){
|
|||||||
|
|
||||||
|
|
||||||
echo "<br><br>";
|
echo "<br><br>";
|
||||||
echo '<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>';
|
echo '<form action="'. self_action() .'" method=POST>';
|
||||||
echo '<input type=submit class="btn btn-primary btn-sm" value="zurück">';
|
echo '<input type=submit class="btn btn-primary btn-sm" value="zurück">';
|
||||||
echo "</form>";
|
echo "</form>";
|
||||||
|
|
||||||
@@ -453,7 +452,7 @@ if(!check_worker()){
|
|||||||
|
|
||||||
if($_GET["a"] == "activetogotermin" ){
|
if($_GET["a"] == "activetogotermin" ){
|
||||||
|
|
||||||
$sqlstring = "Update togo_termin SET count='0' WHERE terminid = ". $_GET["id"] . "";
|
$sqlstring = "Update togo_termin SET count='0' WHERE terminid = " . (int)($_GET["id"] ?? 0);
|
||||||
$query = mysqli_query($con,$sqlstring);
|
$query = mysqli_query($con,$sqlstring);
|
||||||
if($query){
|
if($query){
|
||||||
echo "<div class='infofenster'><h4>Termin wurde aktiviert!<h4></div>";
|
echo "<div class='infofenster'><h4>Termin wurde aktiviert!<h4></div>";
|
||||||
@@ -465,7 +464,7 @@ if(!check_worker()){
|
|||||||
}
|
}
|
||||||
if($_GET["a"] == "removetogotermin" ){
|
if($_GET["a"] == "removetogotermin" ){
|
||||||
|
|
||||||
$sqlstring = "Update togo_termin SET count='-1' WHERE terminid = ". $_GET["id"] . "";
|
$sqlstring = "Update togo_termin SET count='-1' WHERE terminid = " . (int)($_GET["id"] ?? 0);
|
||||||
$query = mysqli_query($con,$sqlstring);
|
$query = mysqli_query($con,$sqlstring);
|
||||||
|
|
||||||
if($query){
|
if($query){
|
||||||
@@ -815,11 +814,11 @@ $queryinsert = $stmt->execute([
|
|||||||
$togostandort = $row["standort"];
|
$togostandort = $row["standort"];
|
||||||
$togowarning = $row["warning"];
|
$togowarning = $row["warning"];
|
||||||
$togoerror = $row["error"];
|
$togoerror = $row["error"];
|
||||||
echo "<tr><td>" . $ausgabedate . "</td><td>" . date("H:i", strtotime($togostart)) . " - " . date("H:i", strtotime($togoende)) . "</td><td>" . $togostandort . " - Gelb:" . $togowarning . " Rot:" . $togoerror . "</td><td> <a href=". $_SERVER["PHP_SELF"] ."?a=removeserie&id=$togovorgabenid class='glyphicon glyphicon-remove' title='löschen' onclick=\"return confirm('Eintrag " . $ausgabedate . " " . date("H:i", strtotime($togostart)) . " - " . date("H:i", strtotime($togoende)) . " wirklich löschen?');\" ></a></td><td>";
|
echo "<tr><td>" . $ausgabedate . "</td><td>" . date("H:i", strtotime($togostart)) . " - " . date("H:i", strtotime($togoende)) . "</td><td>" . $togostandort . " - Gelb:" . $togowarning . " Rot:" . $togoerror . "</td><td> <a href=". self_action() ."?a=removeserie&id=$togovorgabenid class='glyphicon glyphicon-remove' title='löschen' onclick=\"return confirm('Eintrag " . $ausgabedate . " " . date("H:i", strtotime($togostart)) . " - " . date("H:i", strtotime($togoende)) . " wirklich löschen?');\" ></a></td><td>";
|
||||||
|
|
||||||
}
|
}
|
||||||
echo "</table><br>";
|
echo "</table><br>";
|
||||||
echo '<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>';
|
echo '<form action="'. self_action() .'" method=POST>';
|
||||||
echo "<input type=hidden name=aktion value=togoterminverwaltungnewserie >";
|
echo "<input type=hidden name=aktion value=togoterminverwaltungnewserie >";
|
||||||
echo '<input type=submit class="btn btn-primary btn-sm" value="neuer Serientermin">';
|
echo '<input type=submit class="btn btn-primary btn-sm" value="neuer Serientermin">';
|
||||||
echo "</form>";
|
echo "</form>";
|
||||||
@@ -842,18 +841,18 @@ $queryinsert = $stmt->execute([
|
|||||||
$togoerror = $row["error"];
|
$togoerror = $row["error"];
|
||||||
if($togocount >= 0){
|
if($togocount >= 0){
|
||||||
|
|
||||||
echo "<tr><td>" . date("d.m.y", strtotime($togodate)) . "</td><td>" . date("H:i", strtotime($togostart)) . " - " . date("H:i", strtotime($togoende)) . "</td><td>" . $togostandort . "</td><td>Meldung:" . $togocount . " - Gelb:" . $togowarning . " Rot:" . $togoerror . "</td><td><a href=". $_SERVER["PHP_SELF"] ."?a=togoAddUser&id=$togoterminid class='glyphicon glyphicon-plus' title='Patient hinzufügen'></a> <a href=". $_SERVER["PHP_SELF"] ."?a=showtogotermin&id=$togoterminid class='glyphicon glyphicon-eye-open' title='einsehen'></a> <a href=". $_SERVER["PHP_SELF"] ."?a=togoedittermin&id=$togoterminid class='glyphicon glyphicon-pencil' title='anpassen'></a> <a href=". $_SERVER["PHP_SELF"] ."?a=togosendmail&id=$togoterminid class='glyphicon glyphicon-envelope' title='Mail an alle Teilnehmer'></a> <a href=". $_SERVER["PHP_SELF"] ."?a=removetogotermin&id=$togoterminid class='glyphicon glyphicon-remove' title='deaktiveren'></a> </td></tr>";
|
echo "<tr><td>" . date("d.m.y", strtotime($togodate)) . "</td><td>" . date("H:i", strtotime($togostart)) . " - " . date("H:i", strtotime($togoende)) . "</td><td>" . $togostandort . "</td><td>Meldung:" . $togocount . " - Gelb:" . $togowarning . " Rot:" . $togoerror . "</td><td><a href=". self_action() ."?a=togoAddUser&id=$togoterminid class='glyphicon glyphicon-plus' title='Patient hinzufügen'></a> <a href=". self_action() ."?a=showtogotermin&id=$togoterminid class='glyphicon glyphicon-eye-open' title='einsehen'></a> <a href=". self_action() ."?a=togoedittermin&id=$togoterminid class='glyphicon glyphicon-pencil' title='anpassen'></a> <a href=". self_action() ."?a=togosendmail&id=$togoterminid class='glyphicon glyphicon-envelope' title='Mail an alle Teilnehmer'></a> <a href=". self_action() ."?a=removetogotermin&id=$togoterminid class='glyphicon glyphicon-remove' title='deaktiveren'></a> </td></tr>";
|
||||||
}else{
|
}else{
|
||||||
echo "<tr><td>" . date("d.m.y", strtotime($togodate)) . "</td><td>" . date("H:i", strtotime($togostart)) . " - " . date("H:i", strtotime($togoende)) . "</td><td>" . $togostandort . "</td><td>deaktivert - Gelb:" . $togowarning . " Rot:" . $togoerror . "</td><td> <a href=". $_SERVER["PHP_SELF"] ."?a=activetogotermin&id=$togoterminid class='glyphicon glyphicon-ok' title='aktivieren'></a> <a href=". $_SERVER["PHP_SELF"] ."?a=showtogotermin&id=$togoterminid class='glyphicon glyphicon-eye-open' title='einsehen'></a> <a href=". $_SERVER["PHP_SELF"] ."?a=togosendmail&id=$togoterminid class='glyphicon glyphicon-envelope' title='Mail an alle Teilnehmer'></a> <a href=". $_SERVER["PHP_SELF"] ."?a=deletetogotermin&id=$togoterminid class='glyphicon glyphicon-remove' title='Dauerhaft löschen' onclick=\"return confirm('Eintrag " . $togodate . " " . date("H:i", strtotime($togostart)) . " - " . date("H:i", strtotime($togoende)) . " wirklich löschen? Serientermine dürfen nicht gelöscht werden, da diese sonst wieder erstellt werden.');\"></a> </td></tr>";
|
echo "<tr><td>" . date("d.m.y", strtotime($togodate)) . "</td><td>" . date("H:i", strtotime($togostart)) . " - " . date("H:i", strtotime($togoende)) . "</td><td>" . $togostandort . "</td><td>deaktivert - Gelb:" . $togowarning . " Rot:" . $togoerror . "</td><td> <a href=". self_action() ."?a=activetogotermin&id=$togoterminid class='glyphicon glyphicon-ok' title='aktivieren'></a> <a href=". self_action() ."?a=showtogotermin&id=$togoterminid class='glyphicon glyphicon-eye-open' title='einsehen'></a> <a href=". self_action() ."?a=togosendmail&id=$togoterminid class='glyphicon glyphicon-envelope' title='Mail an alle Teilnehmer'></a> <a href=". self_action() ."?a=deletetogotermin&id=$togoterminid class='glyphicon glyphicon-remove' title='Dauerhaft löschen' onclick=\"return confirm('Eintrag " . $togodate . " " . date("H:i", strtotime($togostart)) . " - " . date("H:i", strtotime($togoende)) . " wirklich löschen? Serientermine dürfen nicht gelöscht werden, da diese sonst wieder erstellt werden.');\"></a> </td></tr>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo "</table><br>";
|
echo "</table><br>";
|
||||||
echo '<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>';
|
echo '<form action="'. self_action() .'" method=POST>';
|
||||||
echo "<input type=hidden name=aktion value=togoterminverwaltungnewtogo >";
|
echo "<input type=hidden name=aktion value=togoterminverwaltungnewtogo >";
|
||||||
echo '<input type=submit class="btn btn-primary btn-sm" value="neuer Einzeltermin">';
|
echo '<input type=submit class="btn btn-primary btn-sm" value="neuer Einzeltermin">';
|
||||||
echo "</form>";
|
echo "</form>";
|
||||||
echo "<br>";
|
echo "<br>";
|
||||||
echo '<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>';
|
echo '<form action="'. self_action() .'" method=POST>';
|
||||||
echo "<input type=hidden name=aktion value=folgenewtermin >";
|
echo "<input type=hidden name=aktion value=folgenewtermin >";
|
||||||
echo '<input type=submit class="btn btn-primary btn-sm" value="neue Terminfolge">';
|
echo '<input type=submit class="btn btn-primary btn-sm" value="neue Terminfolge">';
|
||||||
echo "</form>";
|
echo "</form>";
|
||||||
@@ -907,10 +906,10 @@ $queryinsert = $stmt->execute([
|
|||||||
|
|
||||||
if( $anzahlzeilen != 0){
|
if( $anzahlzeilen != 0){
|
||||||
echo "<h4>Abgesagte Termine</h4>";
|
echo "<h4>Abgesagte Termine</h4>";
|
||||||
echo "<a href=". $_SERVER["PHP_SELF"] ."?a=togomaildeletetimes title='Mail an alle Teilnehmer' class='btn btn-primary btn-sm'>Mail an alle Teilnehmer bei abgesagten Terminen</a> ";
|
echo "<a href=". self_action() ."?a=togomaildeletetimes title='Mail an alle Teilnehmer' class='btn btn-primary btn-sm'>Mail an alle Teilnehmer bei abgesagten Terminen</a> ";
|
||||||
}
|
}
|
||||||
echo "<br><br>";
|
echo "<br><br>";
|
||||||
echo '<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>';
|
echo '<form action="'. self_action() .'" method=POST>';
|
||||||
echo "<input type=hidden name=aktion value=togoterminverwaltung >";
|
echo "<input type=hidden name=aktion value=togoterminverwaltung >";
|
||||||
echo '<input type=submit class="btn btn-primary btn-sm" value="zurück">';
|
echo '<input type=submit class="btn btn-primary btn-sm" value="zurück">';
|
||||||
echo "</form>";
|
echo "</form>";
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
|
||||||
|
|
||||||
// WICHTIG: Pfade aus /admin heraus korrekt auflösen
|
// WICHTIG: Pfade aus /admin heraus korrekt auflösen
|
||||||
require_once __DIR__ . "/../inc/config.inc.php";
|
require_once __DIR__ . "/../inc/config.inc.php";
|
||||||
@@ -24,7 +23,7 @@ include("templates/footer.inc.php");
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
echo '<div style="float: right; width: 200px; ">';
|
echo '<div style="float: right; width: 200px; ">';
|
||||||
echo "<form action='" . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . "' id='formbenutzersuche' method='POST'>";
|
echo "<form action='" . self_action() . "' id='formbenutzersuche' method='POST'>";
|
||||||
echo '<input type="hidden" name="aktion" value="benutzersuche" />';
|
echo '<input type="hidden" name="aktion" value="benutzersuche" />';
|
||||||
echo '<input type="hidden" name="userid_input" id="userid_input" />';
|
echo '<input type="hidden" name="userid_input" id="userid_input" />';
|
||||||
echo '<label>Benutzersuche Impfen:</label>
|
echo '<label>Benutzersuche Impfen:</label>
|
||||||
@@ -111,7 +110,7 @@ if (!check_worker()) {
|
|||||||
echo "<h4>Vorlage: " . htmlspecialchars($webseitentitel, ENT_QUOTES, 'UTF-8') . "</h4>";
|
echo "<h4>Vorlage: " . htmlspecialchars($webseitentitel, ENT_QUOTES, 'UTF-8') . "</h4>";
|
||||||
echo "<br><br>";
|
echo "<br><br>";
|
||||||
|
|
||||||
echo "<form action='" . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . "' method='POST'>";
|
echo "<form action='" . self_action() . "' method='POST'>";
|
||||||
echo "<label>Titel</label><br>";
|
echo "<label>Titel</label><br>";
|
||||||
echo "<input name='webseitentitel' type='text' class='form-control' value='" . htmlspecialchars($webseitentitel, ENT_QUOTES, 'UTF-8') . "'><br><br>";
|
echo "<input name='webseitentitel' type='text' class='form-control' value='" . htmlspecialchars($webseitentitel, ENT_QUOTES, 'UTF-8') . "'><br><br>";
|
||||||
echo "<label>Beschreibung</label><br>";
|
echo "<label>Beschreibung</label><br>";
|
||||||
@@ -128,7 +127,7 @@ if (!check_worker()) {
|
|||||||
echo "</form>";
|
echo "</form>";
|
||||||
|
|
||||||
echo "<br><br>";
|
echo "<br><br>";
|
||||||
echo "<form action='" . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . "' method='POST'>";
|
echo "<form action='" . self_action() . "' method='POST'>";
|
||||||
echo "<input type='submit' class='btn btn-primary btn-sm' value='zurück'>";
|
echo "<input type='submit' class='btn btn-primary btn-sm' value='zurück'>";
|
||||||
echo "</form>";
|
echo "</form>";
|
||||||
}
|
}
|
||||||
@@ -144,7 +143,7 @@ if (!check_worker()) {
|
|||||||
// =========================
|
// =========================
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
echo "<form action='" . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . "' method='POST'>";
|
echo "<form action='" . self_action() . "' method='POST'>";
|
||||||
echo "Wählen Sie die zu bearbeitenden Webseiteninhalt aus:<br><br>";
|
echo "Wählen Sie die zu bearbeitenden Webseiteninhalt aus:<br><br>";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
|
||||||
|
|
||||||
require_once __DIR__ . "/../inc/config.inc.php";
|
require_once __DIR__ . "/../inc/config.inc.php";
|
||||||
require_once __DIR__ . "/../inc/functions.inc.php";
|
require_once __DIR__ . "/../inc/functions.inc.php";
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once __DIR__ . '/impfbestaetigung.php';
|
require_once __DIR__ . '/impfbestaetigung.php';
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once __DIR__ . '/impfwarteliste.php';
|
require_once __DIR__ . '/impfwarteliste.php';
|
||||||
|
|||||||
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once __DIR__ . '/impfwarteliste.php';
|
require_once __DIR__ . '/impfwarteliste.php';
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
<!DOCTYPE HTML>
|
<!DOCTYPE HTML>
|
||||||
<!--
|
<!--
|
||||||
Alpha by HTML5 UP
|
Alpha by HTML5 UP
|
||||||
html5up.net | @n33co
|
html5up.net | @n33co
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once __DIR__ . '/impfwarteliste.php';
|
require_once __DIR__ . '/impfwarteliste.php';
|
||||||
|
|||||||
+26
-1
@@ -12,6 +12,8 @@ if (!is_readable($credentials)) {
|
|||||||
}
|
}
|
||||||
require $credentials; // liefert $dbhost, $dbuser, $dbpassword, $dbname
|
require $credentials; // liefert $dbhost, $dbuser, $dbpassword, $dbname
|
||||||
|
|
||||||
|
require_once __DIR__ . '/security.inc.php';
|
||||||
|
|
||||||
|
|
||||||
$organisationsname = "Praxis Creutzburg";
|
$organisationsname = "Praxis Creutzburg";
|
||||||
$organisationsurl = "https://www.praxis-creutzburg.de/";
|
$organisationsurl = "https://www.praxis-creutzburg.de/";
|
||||||
@@ -79,4 +81,27 @@ ini_set('session.use_strict_mode', '1');
|
|||||||
ini_set('session.cookie_secure', '1'); // bei HTTPS
|
ini_set('session.cookie_secure', '1'); // bei HTTPS
|
||||||
ini_set('session.cookie_httponly', '1');
|
ini_set('session.cookie_httponly', '1');
|
||||||
|
|
||||||
session_start();
|
if (session_status() !== PHP_SESSION_ACTIVE) {
|
||||||
|
session_start();
|
||||||
|
}
|
||||||
|
|
||||||
|
// CSRF-Schutz fuer die angemeldeten Bereiche: Token in jedes POST-Formular
|
||||||
|
// einsetzen und eingehende POSTs pruefen. Muss nach session_start() und vor
|
||||||
|
// jeder Ausgabe der Seite laufen. Der oeffentliche Bereich bleibt aussen vor,
|
||||||
|
// dort gibt es keine Sitzung, die missbraucht werden koennte.
|
||||||
|
$geschuetzteBereiche = [
|
||||||
|
realpath(__DIR__ . '/../admin'),
|
||||||
|
realpath(__DIR__ . '/../intern'),
|
||||||
|
];
|
||||||
|
$laufendesSkript = realpath($_SERVER['SCRIPT_FILENAME'] ?? '');
|
||||||
|
|
||||||
|
foreach ($geschuetzteBereiche as $verzeichnis) {
|
||||||
|
if ($verzeichnis === false || $laufendesSkript === false) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (strncmp($laufendesSkript, $verzeichnis . DIRECTORY_SEPARATOR, strlen($verzeichnis) + 1) === 0) {
|
||||||
|
csrf_autoinject();
|
||||||
|
csrf_require();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,258 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Sicherheitsfunktionen: CSRF-Schutz, Brute-Force-Bremse, sichere Formularziele.
|
||||||
|
*
|
||||||
|
* Wird von inc/config.inc.php eingebunden und steht damit ueberall zur
|
||||||
|
* Verfuegung, wo auch $pdo verfuegbar ist.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
// CSRF
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Liefert das CSRF-Token der aktuellen Sitzung und legt es beim ersten
|
||||||
|
* Aufruf an.
|
||||||
|
*/
|
||||||
|
function csrf_token(): string
|
||||||
|
{
|
||||||
|
if (empty($_SESSION['csrf_token'])) {
|
||||||
|
$_SESSION['csrf_token'] = bin2hex(random_bytes(32));
|
||||||
|
}
|
||||||
|
return $_SESSION['csrf_token'];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fertiges Hidden-Feld fuer Formulare.
|
||||||
|
*/
|
||||||
|
function csrf_field(): string
|
||||||
|
{
|
||||||
|
return '<input type="hidden" name="csrf_token" value="'
|
||||||
|
. htmlspecialchars(csrf_token(), ENT_QUOTES, 'UTF-8') . '">';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prueft das mitgeschickte Token. Akzeptiert das Formularfeld und den
|
||||||
|
* Header X-CSRF-Token, damit auch AJAX-Aufrufe funktionieren.
|
||||||
|
*/
|
||||||
|
function csrf_valid(): bool
|
||||||
|
{
|
||||||
|
if (empty($_SESSION['csrf_token'])) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$token = $_POST['csrf_token'] ?? ($_SERVER['HTTP_X_CSRF_TOKEN'] ?? '');
|
||||||
|
if (!is_string($token) || $token === '') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return hash_equals($_SESSION['csrf_token'], $token);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bricht jeden POST ohne gueltiges Token ab. Fuer GET-Anfragen wirkungslos.
|
||||||
|
*/
|
||||||
|
function csrf_require(): void
|
||||||
|
{
|
||||||
|
if (($_SERVER['REQUEST_METHOD'] ?? 'GET') !== 'POST') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (csrf_valid()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
http_response_code(403);
|
||||||
|
|
||||||
|
$istAjax = ($_SERVER['HTTP_X_REQUESTED_WITH'] ?? '') === 'XMLHttpRequest';
|
||||||
|
if ($istAjax) {
|
||||||
|
header('Content-Type: application/json');
|
||||||
|
echo json_encode(['error' => 'Sicherheitstoken ungueltig. Bitte neu anmelden.']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
header('Content-Type: text/html; charset=utf-8');
|
||||||
|
echo '<h3>Die Anfrage wurde abgelehnt.</h3>';
|
||||||
|
echo 'Das Sicherheitstoken war ungültig oder die Sitzung ist abgelaufen.<br>';
|
||||||
|
echo 'Bitte die Seite neu laden und den Vorgang wiederholen.<br><br>';
|
||||||
|
echo '<a href="index.php">Zurück zur Übersicht</a>';
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Haengt das Token an jedes POST-Formular der Ausgabe. Wird als Callback von
|
||||||
|
* ob_start() benutzt, damit die rund 60 bestehenden Formulare nicht einzeln
|
||||||
|
* angefasst werden muessen.
|
||||||
|
*/
|
||||||
|
function csrf_inject_output(string $html): string
|
||||||
|
{
|
||||||
|
$ersetzt = preg_replace_callback(
|
||||||
|
'/<form\b[^>]*>/i',
|
||||||
|
static function (array $treffer): string {
|
||||||
|
$tag = $treffer[0];
|
||||||
|
// Nur POST-Formulare brauchen ein Token.
|
||||||
|
if (!preg_match('/method\s*=\s*["\']?\s*post/i', $tag)) {
|
||||||
|
return $tag;
|
||||||
|
}
|
||||||
|
return $tag . csrf_field();
|
||||||
|
},
|
||||||
|
$html
|
||||||
|
);
|
||||||
|
|
||||||
|
// preg_replace_callback liefert bei einem Fehler null - dann lieber die
|
||||||
|
// unveraenderte Seite ausliefern als eine leere.
|
||||||
|
return $ersetzt ?? $html;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Aktiviert das automatische Einfuegen. Muss vor jeder Ausgabe laufen.
|
||||||
|
*/
|
||||||
|
function csrf_autoinject(): void
|
||||||
|
{
|
||||||
|
ob_start('csrf_inject_output');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sicheres Ziel fuer Formulare und Links auf die eigene Seite.
|
||||||
|
*
|
||||||
|
* Ersetzt $_SERVER['PHP_SELF']: das enthaelt bei Aufrufen wie
|
||||||
|
* /admin/anfragen.php/"><script> auch den angehaengten Pfad und landete
|
||||||
|
* ungeprueft im HTML.
|
||||||
|
*/
|
||||||
|
function self_action(): string
|
||||||
|
{
|
||||||
|
return htmlspecialchars(basename($_SERVER['SCRIPT_NAME'] ?? ''), ENT_QUOTES, 'UTF-8');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
// Brute-Force-Bremse fuer Anmeldungen
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
const LOGIN_MAX_VERSUCHE_KONTO = 5; // pro E-Mail-Adresse
|
||||||
|
const LOGIN_MAX_VERSUCHE_IP = 20; // pro IP-Adresse
|
||||||
|
const LOGIN_ZEITFENSTER_MIN = 15; // Minuten
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Existiert die Tabelle login_attempts? Ohne sie laeuft der Login wie bisher
|
||||||
|
* weiter - gleiche Vorgehensweise wie bei securitytokensHatAblaufspalte().
|
||||||
|
*/
|
||||||
|
function loginAttemptsTabelleVorhanden(PDO $pdo): bool
|
||||||
|
{
|
||||||
|
static $vorhanden = null;
|
||||||
|
if ($vorhanden !== null) {
|
||||||
|
return $vorhanden;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
$st = $pdo->query("SHOW TABLES LIKE 'login_attempts'");
|
||||||
|
$vorhanden = (bool)$st->fetchColumn();
|
||||||
|
} catch (Throwable $e) {
|
||||||
|
$vorhanden = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $vorhanden;
|
||||||
|
}
|
||||||
|
|
||||||
|
function login_ip(): string
|
||||||
|
{
|
||||||
|
return substr((string)($_SERVER['REMOTE_ADDR'] ?? ''), 0, 45);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ist die Anmeldung gerade gesperrt? Liefert die Restdauer in Sekunden,
|
||||||
|
* sonst 0.
|
||||||
|
*/
|
||||||
|
function login_gesperrt(PDO $pdo, string $email): int
|
||||||
|
{
|
||||||
|
if (!loginAttemptsTabelleVorhanden($pdo)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
$st = $pdo->prepare("
|
||||||
|
SELECT
|
||||||
|
SUM(email = :email) AS konto,
|
||||||
|
SUM(ip_address = :ip) AS ip,
|
||||||
|
MAX(attempted_at) AS letzter
|
||||||
|
FROM login_attempts
|
||||||
|
WHERE erfolg = 0
|
||||||
|
AND attempted_at > DATE_SUB(NOW(), INTERVAL :fenster MINUTE)
|
||||||
|
AND (email = :email2 OR ip_address = :ip2)
|
||||||
|
");
|
||||||
|
$st->bindValue(':email', $email);
|
||||||
|
$st->bindValue(':email2', $email);
|
||||||
|
$st->bindValue(':ip', login_ip());
|
||||||
|
$st->bindValue(':ip2', login_ip());
|
||||||
|
$st->bindValue(':fenster', LOGIN_ZEITFENSTER_MIN, PDO::PARAM_INT);
|
||||||
|
$st->execute();
|
||||||
|
$row = $st->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
if (!$row || $row['letzter'] === null) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
$ueberschritten = (int)$row['konto'] >= LOGIN_MAX_VERSUCHE_KONTO
|
||||||
|
|| (int)$row['ip'] >= LOGIN_MAX_VERSUCHE_IP;
|
||||||
|
if (!$ueberschritten) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sperre laeuft aus, sobald der letzte Fehlversuch aus dem Zeitfenster
|
||||||
|
// faellt. Zeitrechnung in SQL, weil Web- und DB-Server in
|
||||||
|
// unterschiedlichen Zeitzonen laufen.
|
||||||
|
$st = $pdo->prepare("
|
||||||
|
SELECT GREATEST(0, TIMESTAMPDIFF(SECOND, NOW(),
|
||||||
|
DATE_ADD(:letzter, INTERVAL :fenster MINUTE)))
|
||||||
|
");
|
||||||
|
$st->bindValue(':letzter', $row['letzter']);
|
||||||
|
$st->bindValue(':fenster', LOGIN_ZEITFENSTER_MIN, PDO::PARAM_INT);
|
||||||
|
$st->execute();
|
||||||
|
|
||||||
|
return (int)$st->fetchColumn();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Haelt einen Anmeldeversuch fest.
|
||||||
|
*/
|
||||||
|
function login_versuch_merken(PDO $pdo, string $email, bool $erfolg): void
|
||||||
|
{
|
||||||
|
if (!loginAttemptsTabelleVorhanden($pdo)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
$st = $pdo->prepare("
|
||||||
|
INSERT INTO login_attempts (email, ip_address, erfolg)
|
||||||
|
VALUES (:email, :ip, :erfolg)
|
||||||
|
");
|
||||||
|
$st->execute([
|
||||||
|
':email' => substr($email, 0, 255),
|
||||||
|
':ip' => login_ip(),
|
||||||
|
':erfolg' => $erfolg ? 1 : 0,
|
||||||
|
]);
|
||||||
|
|
||||||
|
if ($erfolg) {
|
||||||
|
// Nach erfolgreicher Anmeldung ist die Bremse fuer dieses Konto
|
||||||
|
// wieder offen.
|
||||||
|
$del = $pdo->prepare("DELETE FROM login_attempts WHERE email = :email AND erfolg = 0");
|
||||||
|
$del->execute([':email' => $email]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Alte Eintraege gelegentlich aufraeumen.
|
||||||
|
if (random_int(1, 50) === 1) {
|
||||||
|
$pdo->exec("DELETE FROM login_attempts WHERE attempted_at < DATE_SUB(NOW(), INTERVAL 30 DAY)");
|
||||||
|
}
|
||||||
|
} catch (Throwable $e) {
|
||||||
|
error_log('login_versuch_merken: ' . $e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Einheitlicher Text fuer eine aktive Sperre.
|
||||||
|
*/
|
||||||
|
function login_sperr_text(int $sekunden): string
|
||||||
|
{
|
||||||
|
$minuten = (int)ceil($sekunden / 60);
|
||||||
|
return 'Zu viele fehlgeschlagene Anmeldeversuche. '
|
||||||
|
. 'Bitte in ' . $minuten . ' Minute' . ($minuten === 1 ? '' : 'n') . ' erneut versuchen.<br><br>';
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @package Patientsuche
|
* @package Patientsuche
|
||||||
* @copyright Copyright (C) 2021 ctb-it.de Inc. All rights reserved.
|
* @copyright Copyright (C) 2021 ctb-it.de Inc. All rights reserved.
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
|
||||||
require_once(__DIR__ . "/../inc/config.inc.php");
|
require_once(__DIR__ . "/../inc/config.inc.php");
|
||||||
require_once(__DIR__ . "/../inc/functions.inc.php");
|
require_once(__DIR__ . "/../inc/functions.inc.php");
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
|
||||||
require_once(__DIR__ . "/../inc/config.inc.php");
|
require_once(__DIR__ . "/../inc/config.inc.php");
|
||||||
require_once(__DIR__ . "/../inc/functions.inc.php");
|
require_once(__DIR__ . "/../inc/functions.inc.php");
|
||||||
include("templates/header.inc.php");
|
include("templates/header.inc.php");
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
// Ausgabe puffern: check_intern_user() setzt Cookies und leitet per header() um,
|
// Ausgabe puffern: check_intern_user() setzt Cookies und leitet per header() um,
|
||||||
// obwohl das Header-Template weiter unten schon Ausgabe erzeugt hat.
|
// obwohl das Header-Template weiter unten schon Ausgabe erzeugt hat.
|
||||||
ob_start();
|
ob_start();
|
||||||
session_start();
|
|
||||||
require_once(__DIR__ . "/../inc/config.inc.php");
|
require_once(__DIR__ . "/../inc/config.inc.php");
|
||||||
require_once(__DIR__ . "/../inc/functions.inc.php");
|
require_once(__DIR__ . "/../inc/functions.inc.php");
|
||||||
|
|
||||||
|
|||||||
+5
-3
@@ -7,10 +7,12 @@
|
|||||||
ob_start();
|
ob_start();
|
||||||
require_once(__DIR__ . "/../inc/config.inc.php");
|
require_once(__DIR__ . "/../inc/config.inc.php");
|
||||||
require_once(__DIR__ . "/../inc/functions.inc.php");
|
require_once(__DIR__ . "/../inc/functions.inc.php");
|
||||||
session_start();
|
|
||||||
|
|
||||||
ini_set('session.gc_maxlifetime', 30*24*60*60); // 30 Tage
|
// Hinweis: hier standen zwei ini_set() auf session.gc_maxlifetime und
|
||||||
ini_set('session.cookie_lifetime', 30*24*60*60); // 30 Tage
|
// session.cookie_lifetime. Beide liefen ins Leere, weil die Sitzung zu
|
||||||
|
// diesem Zeitpunkt schon laeuft - PHP ignoriert Session-Einstellungen
|
||||||
|
// dann und meldet eine Warnung. Die Lebensdauer des Cookies kommt aus
|
||||||
|
// session_set_cookie_params() in inc/config.inc.php (30 Tage).
|
||||||
include(__DIR__ . "/../inc/password.inc.php");
|
include(__DIR__ . "/../inc/password.inc.php");
|
||||||
|
|
||||||
$error_msg = "";
|
$error_msg = "";
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
|
||||||
require_once(__DIR__ . "/../inc/config.inc.php");
|
require_once(__DIR__ . "/../inc/config.inc.php");
|
||||||
require_once(__DIR__ . "/../inc/functions.inc.php");
|
require_once(__DIR__ . "/../inc/functions.inc.php");
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
|
||||||
require_once(__DIR__ . "/../inc/config.inc.php");
|
require_once(__DIR__ . "/../inc/config.inc.php");
|
||||||
require_once(__DIR__ . "/../inc/functions.inc.php");
|
require_once(__DIR__ . "/../inc/functions.inc.php");
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
|
||||||
require_once(__DIR__ . "/../inc/config.inc.php");
|
require_once(__DIR__ . "/../inc/config.inc.php");
|
||||||
require_once(__DIR__ . "/../inc/functions.inc.php");
|
require_once(__DIR__ . "/../inc/functions.inc.php");
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
|
||||||
require_once(__DIR__ . "/../inc/config.inc.php");
|
require_once(__DIR__ . "/../inc/config.inc.php");
|
||||||
require_once(__DIR__ . "/../inc/functions.inc.php");
|
require_once(__DIR__ . "/../inc/functions.inc.php");
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
|
||||||
require_once(__DIR__ . "/../inc/config.inc.php");
|
require_once(__DIR__ . "/../inc/config.inc.php");
|
||||||
require_once(__DIR__ . "/../inc/functions.inc.php");
|
require_once(__DIR__ . "/../inc/functions.inc.php");
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
|
||||||
require_once(__DIR__ . "/../inc/config.inc.php");
|
require_once(__DIR__ . "/../inc/config.inc.php");
|
||||||
require_once(__DIR__ . "/../inc/functions.inc.php");
|
require_once(__DIR__ . "/../inc/functions.inc.php");
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
ob_start();
|
ob_start();
|
||||||
session_start();
|
|
||||||
require_once(__DIR__ . "/../inc/config.inc.php");
|
require_once(__DIR__ . "/../inc/config.inc.php");
|
||||||
require_once(__DIR__ . "/../inc/functions.inc.php");
|
require_once(__DIR__ . "/../inc/functions.inc.php");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user