summaryrefslogtreecommitdiff
path: root/inc/auth.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2013-02-16 18:29:20 +0100
committerAndreas Gohr <andi@splitbrain.org>2013-02-16 18:29:20 +0100
commit9d2e1be699d573eebda922cf67f030d3d2aa462d (patch)
tree51448d2e7e695f127533c9aa3cb438d7184f89bd /inc/auth.php
parent7e9efe5266f592dc927dbf126a901e7dea2b4f5d (diff)
downloadrpg-9d2e1be699d573eebda922cf67f030d3d2aa462d.tar.gz
rpg-9d2e1be699d573eebda922cf67f030d3d2aa462d.tar.bz2
introduced http_status() for sending HTTP status code FS#1698
It seems, some servers require a special Status: header for sending the HTTP status code from PHP (F)CGI to the server. This patch introduces a new function (adopted from CodeIgniter) for simplifying the status handling.
Diffstat (limited to 'inc/auth.php')
-rw-r--r--inc/auth.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/inc/auth.php b/inc/auth.php
index 7f427bd8d..9566a2615 100644
--- a/inc/auth.php
+++ b/inc/auth.php
@@ -267,7 +267,7 @@ function auth_login($user, $pass, $sticky = false, $silent = false) {
function auth_validateToken($token) {
if(!$token || $token != $_SESSION[DOKU_COOKIE]['auth']['token']) {
// bad token
- header("HTTP/1.0 401 Unauthorized");
+ http_status(401);
print 'Invalid auth token - maybe the session timed out';
unset($_SESSION[DOKU_COOKIE]['auth']['token']); // no second chance
exit;