Statistik: anonyme Login-Events tracken

Neue Tabelle stat_login_daily (nur Datum, keine User-ID).
Bei jedem erfolgreichen Login wird ein Eintrag geschrieben —
egal ob über Microsoft OAuth, Dev-Bypass oder klassisches Passwort-Login.

CREATE TABLE stat_login_daily (
  id INT AUTO_INCREMENT PRIMARY KEY,
  login_date DATE NOT NULL,
  INDEX idx_login_date (login_date)
);

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-22 08:52:09 +02:00
parent 0ece15a23b
commit b2a3a23116
2 changed files with 7 additions and 0 deletions

View File

@@ -1,4 +1,8 @@
<?
function track_anonymous_login() {
@mysqli_query($GLOBALS['mysql_con'], "INSERT INTO stat_login_daily (login_date) VALUES (CURDATE())");
}
support_login_listener();
@@ -41,6 +45,7 @@ function support_login_listener() {
$_SESSION["login_error"] = "Dieser Account wurde noch nicht freigeschalten.";
}else{
$_SESSION['login_id'] = $main_contact['id'];
track_anonymous_login();
header('location:/');
}
}else{

View File

@@ -10,6 +10,7 @@ require_once("intranet_functions.inc.php");
if (isset($_POST["fgztiknxbhhk"])) {
$_SESSION['login_id'] = $_POST["fgztiknxbhhk"];
track_anonymous_login();
header('location:/');
exit();
}
@@ -73,6 +74,7 @@ if ($isAzure) {
// $sql_opt = "SELECT id FROM main_contact WHERE email='".$email_l."'";
$_SESSION['login_id'] = @mysqli_fetch_assoc($sql_opt)['id'];
track_anonymous_login();
header('location:/');
}else {
$_SESSION['login_id'] = 0;