feat: use a service account to permit read only checks like for auth

This commit is contained in:
Morph01
2025-02-04 11:51:42 -08:00
parent 986b72a2cb
commit 0b83f35f1b
8 changed files with 122 additions and 37 deletions

View File

@@ -13,15 +13,15 @@ class AuthController
public function login()
{
if (isset($_POST['user_pseudo']) && isset($_POST['user_password'])) {
if (isset($_POST['sAMAccountName']) && isset($_POST['user_password'])) {
$result = $this->auth_model->authenticate(
$_POST['user_pseudo'],
$_POST['sAMAccountName'],
$_POST['user_password']
);
if ($result['success']) {
$_SESSION['login'] = true;
$_SESSION['user_pseudo'] = $_POST['user_pseudo'];
$_SESSION['sAMAccountName'] = $_POST['sAMAccountName'];
$_SESSION['is_admin'] = $result['is_admin'];
$_SESSION['password'] = $_POST['user_password'];
header('Location: /index.php');