Public part: home and team part

This commit is contained in:
Némunaire 2013-10-26 08:59:59 +02:00
commit f8eff22c22
3 changed files with 13 additions and 6 deletions

View file

@ -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");
}

View file

@ -10,7 +10,7 @@ try
return "public/team";
}
catch($e)
catch(Exception $e)
{
return "404";
}

View file

@ -3,4 +3,9 @@
<h1>
Hello World!
</h1>
{foreach from=$teams item=i}
<ul>
<li><a href="/{$i->id}-{$i->company}">{$i->company}</a></li>
</ul>
{/foreach}
{/block}