You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
1.7 KiB
70 lines
1.7 KiB
<?php
|
|
class UserModel
|
|
{
|
|
|
|
private EnigmeGateway $enigme_gateway;
|
|
private PartieGateway $partie_gateway;
|
|
private UtilisateurGateway $utilisateur_gateway;
|
|
|
|
function __construct()
|
|
{
|
|
try {
|
|
global $error, $view, $rep;
|
|
$this->enigme_gateway = new EnigmeGateway();
|
|
$this->partie_gateway = new PartieGateway();
|
|
$this->utilisateur_gateway = new UtilisateurGateway();
|
|
} catch (Exception $e) {
|
|
$error = $e->getMessage();
|
|
require($rep . $view['erreur']);
|
|
}
|
|
}
|
|
|
|
public function goToPresentation()
|
|
{
|
|
global $rep, $vues, $error;
|
|
try {
|
|
require($rep . $vues['presentation']);
|
|
} catch (Exception $e) {
|
|
$error = "Erreur Inconnue";
|
|
require($rep . $vues['erreur']);
|
|
}
|
|
}
|
|
|
|
public function goToHome()
|
|
{
|
|
global $rep, $vues, $error;
|
|
try {
|
|
require($rep . $vues['main']);
|
|
} catch (Exception $e) {
|
|
$error = "404";
|
|
require($rep . $vues['erreur']);
|
|
}
|
|
}
|
|
public function goToEnigme()
|
|
{
|
|
global $rep, $vues, $error;
|
|
try {
|
|
require($rep . $vues['enigme']);
|
|
} catch (Exception $e) {
|
|
$error = "404";
|
|
require($rep . $vues['erreur']);
|
|
}
|
|
}
|
|
|
|
public function goToQueue()
|
|
{
|
|
global $rep, $vues, $error;
|
|
try {
|
|
require($rep . $vues['Queue']);
|
|
} catch (Exception $e) {
|
|
$error = "404";
|
|
require($rep . $vues['erreur']);
|
|
}
|
|
}
|
|
|
|
public function logout()
|
|
{
|
|
$_SESSION['role'] = 'visitor';
|
|
header('Location: index.php');
|
|
}
|
|
} |