1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-12-27 12:22:21 +00:00
plateforme-tfjm2/server_files/classes/Role.php

55 lines
1.1 KiB
PHP
Raw Normal View History

<?php
class Role
{
2020-02-21 22:26:47 +00:00
const OBSERVER = -1;
const PARTICIPANT = 0;
const ENCADRANT = 1;
const ORGANIZER = 2;
const ADMIN = 3;
public static function getTranslatedName($role) {
switch ($role) {
2020-02-21 22:26:47 +00:00
case self::OBSERVER:
return "Observateur";
case self::ENCADRANT:
return "Encadrant";
case self::ORGANIZER:
return "Organisateur";
case self::ADMIN:
return "Administrateur";
default:
return "Participant";
}
}
public static function getName($role) {
switch ($role) {
2020-02-21 22:26:47 +00:00
case self::OBSERVER:
return "OBSERVER";
case self::ENCADRANT:
return "ENCADRANT";
case self::ORGANIZER:
return "ORGANIZER";
case self::ADMIN:
return "ADMIN";
default:
return "PARTICIPANT";
}
}
public static function fromName($name) {
switch ($name) {
2020-02-21 22:26:47 +00:00
case "OBSERVER":
return self::OBSERVER;
case "ENCADRANT":
return self::ENCADRANT;
case "ORGANIZER":
return self::ORGANIZER;
case "ADMIN":
return self::ADMIN;
default:
return self::PARTICIPANT;
}
}
}