@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 107 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 159 KiB After Width: | Height: | Size: 159 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="PhpIncludePathManager">
|
||||
<include_path>
|
||||
<path value="$PROJECT_DIR$/vendor/twig/twig" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-ctype" />
|
||||
<path value="$PROJECT_DIR$/vendor/composer" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-mbstring" />
|
||||
<path value="$PROJECT_DIR$/vendor/altorouter/altorouter" />
|
||||
</include_path>
|
||||
</component>
|
||||
<component name="PhpProjectSharedConfiguration" php_language_level="7.4">
|
||||
<option name="suggestChangeDefaultLanguageLevel" value="false" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/config" isTestSource="false" packagePrefix="config\" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/controller" isTestSource="false" packagePrefix="controller\" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/model" isTestSource="false" packagePrefix="model\" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/model/gateways" isTestSource="false" packagePrefix="model\" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/model/metier" isTestSource="false" packagePrefix="model\" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/twig/twig" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-ctype" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/composer" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-mbstring" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/altorouter/altorouter" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace controller;
|
||||
|
||||
use model\Connection;
|
||||
use model\GameGateway;
|
||||
|
||||
class UserController {
|
||||
public function CreateParty() {
|
||||
global $twig;
|
||||
|
||||
$dVueCreate = \model\GameGateway::getGames();
|
||||
echo $twig->render('create.html', ['dVueCreate' => $dVueCreate]);
|
||||
}
|
||||
|
||||
public function JoinParty() {
|
||||
global $twig;
|
||||
global $base;
|
||||
global $login;
|
||||
global $mdp;
|
||||
|
||||
$con = new Connection($base, $login, $mdp);
|
||||
|
||||
$gg = new GameGateway($con);
|
||||
if(!isset($_REQUEST['code'])) {
|
||||
echo $twig->render('join.html');
|
||||
} elseif (empty($_REQUEST['code']) || !sizeof($gg->getGameByCode($_REQUEST['code']))) {
|
||||
$dErreur[] = 'Code de partie invalide';
|
||||
echo $twig->render('join.html',['dErreur' => $dErreur]);
|
||||
} else {
|
||||
// rejoindre la partie
|
||||
}
|
||||
}
|
||||
|
||||
public function accueil(array $params) {
|
||||
global $twig;
|
||||
global $dVue;
|
||||
|
||||
echo $twig->render('accueil.html',['dVue' => $dVue]);
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace model;
|
||||
|
||||
class ModelAdmin {
|
||||
public static function isAdmin() {
|
||||
if(!isset($_SESSION['admin'])
|
||||
|| !$_SESSION['admin']
|
||||
|| !isset($_SESSION['email'])
|
||||
|| $_SESSION['email'] == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function logout() {
|
||||
global $basePath;
|
||||
|
||||
session_unset();
|
||||
session_destroy();
|
||||
$_SESSION = array();
|
||||
header("Location: .");
|
||||
}
|
||||
}
|