aboutsummaryrefslogtreecommitdiff
path: root/controllers/user.php
diff options
context:
space:
mode:
Diffstat (limited to 'controllers/user.php')
-rw-r--r--controllers/user.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/controllers/user.php b/controllers/user.php
index bc3da70..1bc91cc 100644
--- a/controllers/user.php
+++ b/controllers/user.php
@@ -5,6 +5,7 @@ use Exception;
function on_post() {
global $user_status;
+ global $token;
$user_status = "";
try {
@@ -15,7 +16,8 @@ function on_post() {
catch(Exception $e) {}
try {
- Database\User::create($_POST["username"], $_POST["password"], "User");
+ $uid = Database\User::create($_POST["username"], $_POST["password"], "User");
+ $token = Database\Cookie::create($uid);
}
catch(Exception $e) {
$user_status = $e;