adding password strength meter and session ui
Deploy / deploy (push) Successful in 34s

This commit is contained in:
2026-05-07 23:51:33 +02:00
parent 69a6da90c5
commit d7632748ab
8 changed files with 256 additions and 1 deletions
+13
View File
@@ -295,6 +295,19 @@ function append_auth_token_to_redirect(string $redirect, string $auth_token): st
return $redirect . $separator . 'auth=' . rawurlencode($auth_token);
}
function log_activity(mysqli $conn, int $user_id, string $action, string $details = ''): void
{
$forwarded_for = $_SERVER['HTTP_X_FORWARDED_FOR'] ?? $_SERVER['REMOTE_ADDR'] ?? '';
$ip = trim(explode(',', $forwarded_for)[0]);
$user_agent = $_SERVER['HTTP_USER_AGENT'] ?? '';
$sql = "INSERT INTO activity_log (user_id, action, ip, user_agent, details) VALUES (?, ?, ?, ?, ?)";
$stmt = mysqli_prepare($conn, $sql);
mysqli_stmt_bind_param($stmt, 'issss', $user_id, $action, $ip, $user_agent, $details);
mysqli_stmt_execute($stmt);
mysqli_stmt_close($stmt);
}
function is_external_domain(string $url): ?string
{
if (!str_starts_with($url, 'http://') && !str_starts_with($url, 'https://')) {