diff --git a/auth-check.php b/auth-check.php index ee05cc2..37c4786 100644 --- a/auth-check.php +++ b/auth-check.php @@ -1,7 +1,13 @@ +error_log("auth-check.php: user_id IS SET. User is authenticated."); +?> \ No newline at end of file diff --git a/index.php b/index.php index eb6cc2c..7fcb675 100644 --- a/index.php +++ b/index.php @@ -1,5 +1,9 @@ - \ No newline at end of file + diff --git a/login.php b/login.php index 41f2972..9590e2c 100644 --- a/login.php +++ b/login.php @@ -1,21 +1,28 @@ fetch(PDO::FETCH_ASSOC); if ($user && password_verify($password, $user['password'])) { + error_log("login.php: Login successful for user ID: " . $user['id']); $_SESSION['user_id'] = $user['id']; $_SESSION['user_name'] = $user['name']; $_SESSION['user_role'] = $user['role']; + error_log("login.php: \$_SESSION after login: " . print_r($_SESSION, true)); header("Location: index.php"); exit; } else { $error_message = 'Invalid email or password.'; + error_log("login.php: " . $error_message); } } catch (PDOException $e) { $error_message = 'Database error: ' . $e->getMessage(); + error_log("login.php: " . $error_message); } } } @@ -84,4 +95,4 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { - + \ No newline at end of file diff --git a/users.php b/users.php index 1dc0d4b..b94a22e 100644 --- a/users.php +++ b/users.php @@ -86,7 +86,7 @@ $users = get_users($allowed_fields);

No users found.

- +

Get started by adding your first user.

Add User @@ -112,7 +112,7 @@ $users = get_users($allowed_fields); Edit - + Delete