Merge branch 'main' into DEV
This commit is contained in:
commit
6f74a11a79
4 files changed
+15
-2
No files matched your search
@@ -31,6 +31,7 @@ if (!in_array($token, $validTokens)) {
|
||||
errorMail(
|
||||
"API Login failed",
|
||||
$error,
|
||||
true,
|
||||
);
|
||||
echo $error;
|
||||
exit;
|
||||
|
||||
@@ -65,6 +65,7 @@ function db_connect() {
|
||||
errorMail(
|
||||
"Database Connection failed",
|
||||
$e->getMessage(),
|
||||
false,
|
||||
);
|
||||
redirectToWebsite("https://blackpi.ipv64.net");
|
||||
throw $e;
|
||||
|
||||
@@ -93,7 +93,8 @@ function logging() {
|
||||
} catch (mysqli_sql_exception $e) {
|
||||
errorMail(
|
||||
"Logging failed",
|
||||
$e->getMessage()
|
||||
$e->getMessage(),
|
||||
true,
|
||||
);
|
||||
throw $e;
|
||||
}
|
||||
|
||||
@@ -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(),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user