From 24587c1d6eaa081a1b11dd15681cf21d9d60f2d3 Mon Sep 17 00:00:00 2001 From: Quitta Date: Wed, 26 Jun 2013 17:43:29 +0200 Subject: [PATCH] show name when logged in in main top bar --- .../tools/server/ryzom_ams/www/html/index.php | 14 +++++++------- .../server/ryzom_ams/www/html/templates/layout.tpl | 6 ++++-- .../server/ryzom_ams/www/html/templates/login.tpl | 4 ++-- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/index.php b/code/ryzom/tools/server/ryzom_ams/www/html/index.php index e09d3a0f3..dfd194049 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/index.php +++ b/code/ryzom/tools/server/ryzom_ams/www/html/index.php @@ -7,9 +7,16 @@ session_start(); //print_r($_SESSION); +//perform an action in case one is specified +if ( isset( $_POST["function"] ) ){ + require( "inc/" . $_POST["function"] . ".php" ); + $return = $_POST["function"](); +} + //Decide what page to load if(isset($_SESSION['user'])){ $page = 'home'; + $return['username'] = $_SESSION['user']; }else{ //default page $page = 'login'; @@ -19,13 +26,6 @@ if ( isset( $_GET["page"] ) ){ $page = $_GET["page"]; } -//perform an action in case one is specified -if ( isset( $_POST["function"] ) ){ - require( "inc/" . $_POST["function"] . ".php" ); - $return = $_POST["function"](); -} - - function loadpage ( $page ){ $filename = 'autoload/' . $page . '.php'; if(is_file($filename)){ diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/templates/layout.tpl b/code/ryzom/tools/server/ryzom_ams/www/html/templates/layout.tpl index 5cbc80a2d..16d032be1 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/templates/layout.tpl +++ b/code/ryzom/tools/server/ryzom_ams/www/html/templates/layout.tpl @@ -89,17 +89,19 @@ + {if isset($username)}
- admin + {$username}
+ {/if} diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/templates/login.tpl b/code/ryzom/tools/server/ryzom_ams/www/html/templates/login.tpl index 29dea8036..a31bfe6c7 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/templates/login.tpl +++ b/code/ryzom/tools/server/ryzom_ams/www/html/templates/login.tpl @@ -15,12 +15,12 @@
- +
- +