diff --git a/server_files/classes/Role.php b/server_files/classes/Role.php index 5fa557a..28ef255 100644 --- a/server_files/classes/Role.php +++ b/server_files/classes/Role.php @@ -2,6 +2,7 @@ class Role { + const OBSERVER = -1; const PARTICIPANT = 0; const ENCADRANT = 1; const ORGANIZER = 2; @@ -9,6 +10,8 @@ class Role public static function getTranslatedName($role) { switch ($role) { + case self::OBSERVER: + return "Observateur"; case self::ENCADRANT: return "Encadrant"; case self::ORGANIZER: @@ -22,6 +25,8 @@ class Role public static function getName($role) { switch ($role) { + case self::OBSERVER: + return "OBSERVER"; case self::ENCADRANT: return "ENCADRANT"; case self::ORGANIZER: @@ -35,6 +40,8 @@ class Role public static function fromName($name) { switch ($name) { + case "OBSERVER": + return self::OBSERVER; case "ENCADRANT": return self::ENCADRANT; case "ORGANIZER": diff --git a/server_files/classes/User.php b/server_files/classes/User.php index b069b97..e9fd91f 100644 --- a/server_files/classes/User.php +++ b/server_files/classes/User.php @@ -90,7 +90,7 @@ class User { global $DB, $YEAR; $admins = []; - $req = $DB->query("SELECT * FROM `users` WHERE `role` = 'ORGANIZER' OR `role` = 'ADMIN' AND `year` = $YEAR ORDER BY `role`, `surname`, `first_name`;"); + $req = $DB->query("SELECT * FROM `users` WHERE `role` = 'ORGANIZER' OR `role` = 'ADMIN' AND `year` = $YEAR ORDER BY `role` DESC, `surname`, `first_name`;"); while (($data = $req->fetch()) !== false) { $admin = new User(); diff --git a/server_files/controllers/inscription.php b/server_files/controllers/inscription.php index 9f2ebbb..d0ab6f3 100644 --- a/server_files/controllers/inscription.php +++ b/server_files/controllers/inscription.php @@ -57,7 +57,7 @@ class NewUser ensure($this->first_name != "", "Le prénom est obligatoire."); ensure(dateWellFormed($this->birth_date), "La date de naissance est invalide."); ensure($this->birth_date < $YEAR . "-01-01", "Vous devez être né."); - ensure($this->gender == "M" || $this->gender == "F", "Le sexe indiqué est invalide."); + ensure($this->gender == "M" || $this->gender == "F", "Merci de spécifier un genre."); ensure(preg_match("#^[0-9]{4}[0-9]?$#", $this->postal_code) && intval($this->postal_code) >= 01000 && intval($this->postal_code) <= 95999, "Le code postal est invalide."); if ($this->country == "") $this->country = "France"; diff --git a/server_files/controllers/mon_compte.php b/server_files/controllers/mon_compte.php index 9d7998c..71d26cf 100644 --- a/server_files/controllers/mon_compte.php +++ b/server_files/controllers/mon_compte.php @@ -101,7 +101,7 @@ class MyAccount ensure($this->email == $this->user->getEmail() || !userExists($this->email), "Un compte existe déjà avec cette adresse e-mail."); ensure(dateWellFormed($this->birth_date), "La date de naissance est invalide."); ensure($this->birth_date < $YEAR . "-01-01", "Vous devez être né."); - ensure($this->gender == "M" || $this->gender == "F", "Le sexe indiqué est invalide."); + ensure($this->gender == "M" || $this->gender == "F", "Merci de spécifier un genre."); ensure(preg_match("#^[0-9]{4}[0-9]?$#", $this->postal_code) && intval($this->postal_code) >= 01000 && intval($this->postal_code) <= 95999, "Le code postal est invalide."); ensure(strlen($this->phone_number) >= 10, "Le numéro de téléphone est invalide."); diff --git a/server_files/views/informations.php b/server_files/views/informations.php index 3cd165a..61b06fa 100644 --- a/server_files/views/informations.php +++ b/server_files/views/informations.php @@ -74,7 +74,7 @@ if ($user->getRole() == Role::PARTICIPANT || $user->getRole() == Role::ENCADRANT