aboutsummaryrefslogtreecommitdiff
path: root/controllers/user.php
blob: 78797db4e501d5b59de996a6a6317db95acd3011 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php

function on_get() {
    global $user;
    try {
        $user = Database\User::fromDB($_GET["user"]);
    }
    catch(Exception $e) {}
}

function on_post() {
    global $user;
    try {
        $headers = apache_request_headers();
        $user = Database\Cookie::fromDB($headers["Authorization"]);
    }
    catch(Exception $e) {}
}