Plein de trucs fonctionnent maintenant
This commit is contained in:
parent
8758598104
commit
e3384eaa6b
22 changed files with 323 additions and 354 deletions
|
@ -6,7 +6,7 @@ define("SALT_USER", "connected");
|
|||
define("SALT_ADMIN", "admin");
|
||||
|
||||
//On active le débogage si l'on est sur le domaine de debug
|
||||
if ($_SERVER["SERVER_NAME"] == "localhost" || $_SERVER["SERVER_NAME"] == "fic" || $_SERVER["SERVER_NAME"] == "atlantis.chen.li")
|
||||
if ($_SERVER["SERVER_NAME"] == "localhost" || $_SERVER["SERVER_NAME"] == "fic" || $_SERVER["SERVER_NAME"] == "fic.nemunai.re" || $_SERVER["SERVER_NAME"] == "atlantis.chen.li")
|
||||
define("DEBUG", true);
|
||||
|
||||
//Chargement de tout le nécessaire pour le site
|
||||
|
@ -50,10 +50,15 @@ else if ($n && $p[0] == SALT_USER)
|
|||
{
|
||||
$connected = true;
|
||||
if ($n <= 1)
|
||||
$page = require("team/home.php");
|
||||
{
|
||||
require("public/home.php");
|
||||
$page = "teams/list";
|
||||
}
|
||||
else
|
||||
{
|
||||
$TEAM = $p[1];
|
||||
$TEAM = new Team($p[1]);
|
||||
$template->assign("my_team", $TEAM);
|
||||
$template->assign("themes", Theme::get_themes());
|
||||
|
||||
if ($n <= 2)
|
||||
$page = require("team/team.php");
|
||||
|
@ -79,18 +84,38 @@ else if ($n && $p[0] == SALT_USER)
|
|||
// SALT/$team/$theme
|
||||
if (empty($page))
|
||||
{
|
||||
$THEME = $p[2];
|
||||
$tmp = explode("-", $p[2]);
|
||||
$id = intval($tmp[0]);
|
||||
$THEME = new Theme($id);
|
||||
unset($tmp, $id);
|
||||
$template->assign("cur_theme", $THEME);
|
||||
|
||||
if ($n == 4)
|
||||
if ($n == 4 || ($n == 5 && $p[4] == "submission"))
|
||||
$id_exo = $p[3];
|
||||
else if ($n == 3)
|
||||
{
|
||||
$EXERCICE = $p[3];
|
||||
foreach($THEME->get_exercicesOrdered() as $exo)
|
||||
{
|
||||
if (! $exo->has_solved($TEAM))
|
||||
break;
|
||||
}
|
||||
$id_exo = $exo->id;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$EXERCICE = new Exercice($id_exo, $THEME);
|
||||
$template->assign("cur_exercice", $EXERCICE);
|
||||
$page = require("team/exercice.php");
|
||||
}
|
||||
else if ($n == 5)
|
||||
{
|
||||
if ($p[4] == "submission")
|
||||
$page = require("team/submission.php");
|
||||
}
|
||||
catch(ExerciceNotFoundException $e)
|
||||
{
|
||||
$page = "404";
|
||||
}
|
||||
catch(InvalidThemeException $e)
|
||||
{
|
||||
$page = "404";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -110,7 +135,7 @@ else
|
|||
}
|
||||
|
||||
// No page here...?
|
||||
if (empty($page))
|
||||
if (empty($page) || $page == "404" || ! file_exists(ONYX . "/tpl/bootstrap/".$page.".tpl"))
|
||||
{
|
||||
$template->assign("err", 404);
|
||||
$template->display("404.tpl");
|
||||
|
|
Reference in a new issue