aboutsummaryrefslogtreecommitdiff
path: root/routes/index.php
diff options
context:
space:
mode:
authorwinter Sparkles2026-08-09 02:26:33 +0100
committerwinter Sparkles2026-08-09 02:26:33 +0100
commit3354d45762bbe0db33e3d26d8997e6f6624f24d7 (patch)
tree4bef4bf59488f443ed54ff6e30002268836ac259 /routes/index.php
parent4bb659e1f7bb5850db5695a536428a9b71e3ffe5 (diff)
implement sessions and also log in/out
session data is stored in sqlite, not using php sessions
Diffstat (limited to 'routes/index.php')
-rw-r--r--routes/index.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/routes/index.php b/routes/index.php
index 685ab92..f884be5 100644
--- a/routes/index.php
+++ b/routes/index.php
@@ -1,8 +1,20 @@
<?php
function GET() {
+ $session = Psso\Session::get();
+
+ // all of this markup is temporary and for testing only :3
$resp = new Psso\XMLResponse;
$content = $resp->doc->addChild('content');
$content->addChild('p', 'Welcome to Pleasant SSO!');
+ $identity = $session->getIdentity();
+ $content->addChild('pre', 'Your identity: ' . print_r($identity, true));
+ if ($identity === null) {
+ $link = $content->addChild('a', L('login.title'));
+ $link->addAttribute('href', '/login');
+ } else {
+ $link = $content->addChild('a', L('logout.title'));
+ $link->addAttribute('href', '/logout');
+ }
$resp->send();
}