28 lines
706 B
Plaintext
28 lines
706 B
Plaintext
#load "../../lib/app.uce"
|
|
|
|
RENDER(Request& context)
|
|
{
|
|
starter_boot(context);
|
|
StarterUser users(context);
|
|
if(!users.is_signed_in())
|
|
{
|
|
starter_redirect("account/login", context);
|
|
return;
|
|
}
|
|
context.call["starter"]["page_title"] = "Profile";
|
|
DTree user = users.current();
|
|
String roles = "";
|
|
user["roles"].each([&](DTree role, String key) {
|
|
if(roles != "")
|
|
roles += ", ";
|
|
roles += role.to_string();
|
|
});
|
|
<>
|
|
<h1>Profile</h1>
|
|
<p>Email: <?= user["email"].to_string() ?></p>
|
|
<p>Roles: <?= roles ?></p>
|
|
<p>Created: <?= time_format_local("%Y-%m-%dT%H:%M:%S", int_val(user["created"].to_string())) ?></p>
|
|
<p><a href="<?= starter_link("account/logout", context) ?>">Logout</a></p>
|
|
</>
|
|
}
|