From f8eff22c225c88dc88f24198c002d404fc275b46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A9munaire?= Date: Sat, 26 Oct 2013 08:59:59 +0200 Subject: [PATCH] Public part: home and team part --- htdocs/index.php | 12 +++++++----- onyx/include/public/team.php | 2 +- onyx/tpl/bootstrap/public/home.tpl | 5 +++++ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/htdocs/index.php b/htdocs/index.php index 57e1f8f3..50a4aeb4 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -12,6 +12,9 @@ if ($_SERVER["SERVER_NAME"] == "localhost" || $_SERVER["SERVER_NAME"] == "fic" | //Chargement de tout le nécessaire pour le site require_once("common.php"); +$template->assign("SALT_USER",SALT_USER); +$template->assign("SALT_ADMIN",SALT_ADMIN); + $n = preg_match_all("#[^/]+#", strtolower(gpc("p")), $out); $p = $out[0]; @@ -46,7 +49,6 @@ if ($n && $p[0] == SALT_ADMIN) else if ($n && $p[0] == SALT_USER) { $connected = true; - if ($n <= 1) $page = require("team/home.php"); else @@ -59,9 +61,9 @@ else if ($n && $p[0] == SALT_USER) { switch($p[2]) { - case "change/": - case "change": - $page = require("team/change.php"); + case "me/": + case "me": + $page = require("team/me.php"); break; case "summary": @@ -92,7 +94,7 @@ else $page = require("public/home.php"); else if ($n == 1) { - $TEAM = $p[0]; + $TEAM = intval(substr($p[0], 0, strpos($p[0], "-"))); $page = require("public/team.php"); } diff --git a/onyx/include/public/team.php b/onyx/include/public/team.php index dfd91661..71ccb620 100644 --- a/onyx/include/public/team.php +++ b/onyx/include/public/team.php @@ -10,7 +10,7 @@ try return "public/team"; } -catch($e) +catch(Exception $e) { return "404"; } diff --git a/onyx/tpl/bootstrap/public/home.tpl b/onyx/tpl/bootstrap/public/home.tpl index 68369382..fb80872d 100644 --- a/onyx/tpl/bootstrap/public/home.tpl +++ b/onyx/tpl/bootstrap/public/home.tpl @@ -3,4 +3,9 @@

Hello World!

+{foreach from=$teams item=i} + +{/foreach} {/block}