diff --git a/controllers/auth_ctrl2.php b/controllers/auth_ctrl2.php index 8d7d65b..92ac25c 100644 --- a/controllers/auth_ctrl2.php +++ b/controllers/auth_ctrl2.php @@ -32,6 +32,7 @@ function verify_login_ctrl(?string $route) if ($user && password_verify($passwd, $user['passwd'])) { session_regenerate_id(true); + $_SESSION['id'] = $user['ID']; $_SESSION['login'] = $user['login']; $_SESSION['role'] = $user['type']; diff --git a/controllers/operation_ctrl.php b/controllers/operation_ctrl.php index 71fe957..62473f5 100644 --- a/controllers/operation_ctrl.php +++ b/controllers/operation_ctrl.php @@ -1,15 +1,24 @@ query($sql)->fetchAll(PDO::FETCH_ASSOC); +} + function get_sauveteurs(PDO $pdo): array { $sql = "SELECT ID, nom, prenom, specialite diff --git a/models/user_crud.php b/models/user_crud.php index 9e3e3ad..5f1d5e2 100644 --- a/models/user_crud.php +++ b/models/user_crud.php @@ -4,7 +4,7 @@ function recuperation_auth(PDO $connex, string $login):?array { require_once('config/config.php'); - $req = "SELECT login, passwd, type FROM Utilisateur WHERE login = :login"; + $req = "SELECT ID, login, passwd, type FROM Utilisateur WHERE login = :login"; $prep = $connex->prepare($req); $prep->bindValue(':login', $login); diff --git a/views/contact_views.php b/views/contact_views.php index 521eab2..8778c19 100644 --- a/views/contact_views.php +++ b/views/contact_views.php @@ -1,6 +1,11 @@ -