Fixed JS not working because of removed charts
This commit is contained in:
@@ -10,12 +10,14 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
$stmt->execute([$username]);
|
||||
$user = $stmt->fetch();
|
||||
|
||||
if ($user && password_verify($password, $user['password'])) {
|
||||
if ($user && password_verify($password, $user['password']) && !$user['disabled']) {
|
||||
// Store user ID, username, and role in session
|
||||
$_SESSION['user_id'] = $user['id'];
|
||||
$_SESSION['username'] = $user['username'];
|
||||
$_SESSION['role'] = $user['role']; // Store user role
|
||||
echo 'success';
|
||||
} else {
|
||||
echo 'Invalid login credentials';
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user