diff --git a/htdocs/index.php b/htdocs/index.php
index 2af19b7b..eb5b4089 100644
--- a/htdocs/index.php
+++ b/htdocs/index.php
@@ -6,6 +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"] == "fic.nemunai.re" || $_SERVER["SERVER_NAME"] == "atlantis.chen.li")
define("DEBUG", true);
@@ -15,7 +16,14 @@ require_once("common.php");
$template->assign("SALT_USER",SALT_USER);
$template->assign("SALT_ADMIN",SALT_ADMIN);
-$n = preg_match_all("#[^/]+#", strtolower(gpc("p")), $out);
+// Convert hidden URL to raw one
+$urls = Cache::read("urls");
+$p = strtolower(gpc("p"));
+
+if (!empty($urls["/".$p]))
+ $p = $urls["/".$p];
+
+$n = preg_match_all("#[^/]+#", $p, $out);
$p = $out[0];
// Admin part
diff --git a/onyx/include/team/exercice.php b/onyx/include/team/exercice.php
index 200f26da..fa1bf93f 100644
--- a/onyx/include/team/exercice.php
+++ b/onyx/include/team/exercice.php
@@ -13,7 +13,7 @@ if (isset($VAR['submission_dir']))
if ($n >= 6 && $p[5] == "werr")
{
$template->assign("ERRcolor", "danger");
- if (DEBUG)
+ if (defined("DEBUG") && DEBUG)
$template->assign("ERRmessage", "DEBUG ERROR: le répertoire submission n'est pas accessible en écriture.");
else
$template->assign("ERRmessage", "Une erreur s'est produite durant la soumission. Veuillez réessayer dans quelques instants.");
@@ -23,15 +23,15 @@ if (isset($VAR['submission_dir']))
$template->assign("ERRcolor", "success");
$template->assign("ERRmessage", "Votre réponse a bien été prise en compte et sera évaluée dans quelques instants...");
}
-
+
if (!empty($_POST["solution"]))
{
if (is_writable("$submission_dir/"))
{
$file = $submission_dir.'/'.$p[1].'-'.$p[2].'-'.$p[3];
-
+
file_put_contents($file, $_POST['solution'], LOCK_EX);
-
+
header("Location: /".implode("/", $p));
exit;
}
@@ -45,7 +45,7 @@ if (isset($VAR['submission_dir']))
}
else
{
- if (DEBUG)
+ if (defined("DEBUG") && DEBUG)
erreur("Merci d'ajouter la variable submission_dir dans root.xml");
else
erreur("Une erreur s'est produite. Veuillez réessayer dans quelques instants.");
diff --git a/onyx/modules/templates/smarty/plugins/function.link.php b/onyx/modules/templates/smarty/plugins/function.link.php
new file mode 100644
index 00000000..d00ddca9
--- /dev/null
+++ b/onyx/modules/templates/smarty/plugins/function.link.php
@@ -0,0 +1,61 @@
+' . $label . '';
+ else
+ return $href;
+}
diff --git a/onyx/tpl/bootstrap/admin/layout.tpl b/onyx/tpl/bootstrap/admin/layout.tpl
index ea0fe9a9..bc3b77c9 100644
--- a/onyx/tpl/bootstrap/admin/layout.tpl
+++ b/onyx/tpl/bootstrap/admin/layout.tpl
@@ -25,19 +25,19 @@
- FIC
+ {link class="navbar-brand" href_prefix="/{$SALT_ADMIN}/" href="" label="FIC"}
- - Équipes
- - Thèmes
+ - {link href_prefix="/{$SALT_ADMIN}/" href="teams" label="Équipes"}
+ - {link href_prefix="/{$SALT_ADMIN}/" href="themes" label="Thèmes"}
{foreach from=$themes item=t}
diff --git a/onyx/tpl/bootstrap/clock.tpl b/onyx/tpl/bootstrap/clock.tpl
index 2b63efcb..10b4febb 100644
--- a/onyx/tpl/bootstrap/clock.tpl
+++ b/onyx/tpl/bootstrap/clock.tpl
@@ -1,6 +1,8 @@
diff --git a/onyx/tpl/bootstrap/public/layout.tpl b/onyx/tpl/bootstrap/public/layout.tpl
index e62f6151..1ce60ca4 100644
--- a/onyx/tpl/bootstrap/public/layout.tpl
+++ b/onyx/tpl/bootstrap/public/layout.tpl
@@ -21,7 +21,7 @@
Top 10
{foreach from=$top item=t key=k}
-
+
{$k+1}. {link href="{$t->id}-{$t->get_name()}" href_prefix="/" label=$t->get_name()}
{/foreach}
diff --git a/onyx/tpl/bootstrap/teams/layout.tpl b/onyx/tpl/bootstrap/teams/layout.tpl
index 6be3e306..d341bad7 100644
--- a/onyx/tpl/bootstrap/teams/layout.tpl
+++ b/onyx/tpl/bootstrap/teams/layout.tpl
@@ -39,11 +39,11 @@ $(document).ready(function() {