diff options
author | Simon Rettberg | 2013-10-17 19:45:55 +0200 |
---|---|---|
committer | Simon Rettberg | 2013-10-17 19:45:55 +0200 |
commit | 0869034ed71e3d3a6bc03551e48657bd83be9b96 (patch) | |
tree | d14a007fb1f198d7320ad0983c6f737422760495 /inc/util.inc.php | |
parent | New stuff (diff) | |
download | slx-admin-0869034ed71e3d3a6bc03551e48657bd83be9b96.tar.gz slx-admin-0869034ed71e3d3a6bc03551e48657bd83be9b96.tar.xz slx-admin-0869034ed71e3d3a6bc03551e48657bd83be9b96.zip |
Day 3
Diffstat (limited to 'inc/util.inc.php')
-rw-r--r-- | inc/util.inc.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/inc/util.inc.php b/inc/util.inc.php index 793902ec..b4a0036e 100644 --- a/inc/util.inc.php +++ b/inc/util.inc.php @@ -20,9 +20,17 @@ class Util public static function redirect($location) { - session_write_close(); + Session::save(); Header('Location: ' . $location); exit(0); } + + public static function verifyToken() + { + if (Session::get('token') === false) return true; + if (isset($_REQUEST['token']) && Session::get('token') === $_REQUEST['token']) return true; + Message::addError('token'); + return false; + } } |