aboutsummaryrefslogtreecommitdiff
path: root/routes/index.php
blob: f884be5c3d9a9bde0c8f5839304daf651f62f0bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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();
}