Moved userbox to separate template and fixed sUser creation

feature/node-rewrite
Sven Slootweg 13 years ago
parent 29dcececb6
commit a102627c9f

@ -14,9 +14,14 @@
$_CVM = true;
require("includes/include.base.php");
$sUserbox = "";
if(!empty($_SESSION['userid']))
{
$sUser = new User($sUser);
$sUser = new User($_SESSION['userid']);
$sUserbox = Templater::InlineRender("userbox", $locale->strings, array(
'username' => "joepie91"
));
}
else
{
@ -57,6 +62,7 @@ catch (UnauthorizedException $e)
}
echo(Templater::InlineRender("main", $locale->strings, array(
'userbox' => $sUserbox,
'title' => $sPageTitle,
'main' => $sMainContents,
'main-class' => $sMainClass

@ -14,10 +14,7 @@
<div class="wrapper">
<div class="header">
<img src="/images/logo.png">
<div class="userbox">
<div>You are logged in as <strong>joepie91</strong>.</div>
<div><a href="/">Account overview</a> | <a href="/containers/">My VPSes</a></div>
</div>
<%?userbox>
</div>
<div class="main <%?main-class>">
<%?main>

Loading…
Cancel
Save