Added authentication functionality and simple role based model

This commit is contained in:
2026-02-11 15:02:37 -08:00
parent c247631de6
commit 11889e3f93
17 changed files with 341 additions and 57 deletions

18
me.php Normal file
View File

@@ -0,0 +1,18 @@
<?php
require 'auth.php';
header('Content-Type: application/json');
if (!is_logged_in()) {
echo json_encode(['logged_in' => false]);
exit;
}
echo json_encode([
'logged_in' => true,
'user' => [
'id' => intval($_SESSION['user']['id']),
'email' => $_SESSION['user']['email'],
'role' => $_SESSION['user']['role'],
'can_manage_settings' => intval($_SESSION['user']['can_manage_settings']),
]
]);