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)}
+ {/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 @@