Compare commits

...
5 changed files with 17 additions and 2 deletions

No files matched your search

+1
View File
@@ -31,6 +31,7 @@ if (!in_array($token, $validTokens)) {
errorMail(
"API Login failed",
$error,
true,
);
echo $error;
exit;
+1
View File
@@ -65,6 +65,7 @@ function db_connect() {
errorMail(
"Database Connection failed",
$e->getMessage(),
false,
);
redirectToWebsite("https://blackpi.ipv64.net");
throw $e;
+2 -1
View File
@@ -93,7 +93,8 @@ function logging() {
} catch (mysqli_sql_exception $e) {
errorMail(
"Logging failed",
$e->getMessage()
$e->getMessage(),
true,
);
throw $e;
}
+11 -1
View File
@@ -24,7 +24,7 @@ function sendMail($subject, $message, $url, bool $log) {
}
}
function errorMail($title, $error) {
function errorMail($title, $error, bool $log) {
$headers = "From: bruno.eckhardt07@gmail.com\r\n";
mail(
"bruno.eckhardt07@gmail.com",
@@ -32,4 +32,14 @@ function errorMail($title, $error) {
$error,
$headers,
);
if ($log == true) {
DatabaseInsert(
"Mailing",
"DATUM, SUBJECT, MESSAGE, URL, CLIENT_IP",
(new getSpecificData())->getRequestTime(),
"ERROR: $title",
$error,
(new getSpecificData())->getClientIP(),
);
}
}
+2
View File
@@ -19,6 +19,7 @@ $db_res = DatabaseShow(
<h3 style="background-color: #007bff;">👤 Benutzerprofil</h3>
<div class="group-links" style="padding: 10px; color: inherit;">
<p style="margin: 5px 0;"><strong>Name:</strong> <code><?= htmlspecialchars($username) ?></code></p>
<?php if ($username != 'gast'): ?>
<p style="margin: 5px 0;"><strong>Nachname:</strong>
<code><?= htmlspecialchars($db_res[0]['NACHNAME']) ?></code>
</p>
@@ -31,6 +32,7 @@ $db_res = DatabaseShow(
<p style="margin: 5px 0;"><strong>Home IP:</strong>
<code><?= htmlspecialchars($db_res[0]['HOME_IP']) ?></code>
</p>
<?php endif ?>
</div>
</div>