aboutsummaryrefslogtreecommitdiffstats
path: root/include/api_auth.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-12-08 20:42:46 -0800
committerredmatrix <redmatrix@redmatrix.me>2015-12-08 20:42:46 -0800
commit656e5fd052d0ee1e9161e25090b54be70d4880ba (patch)
treefb1dcc9d4abf7f8344b47b01e60ab56b7ac3d727 /include/api_auth.php
parent5735cad45795d1f810085a079106f9fea056bcca (diff)
downloadvolse-hubzilla-656e5fd052d0ee1e9161e25090b54be70d4880ba.tar.gz
volse-hubzilla-656e5fd052d0ee1e9161e25090b54be70d4880ba.tar.bz2
volse-hubzilla-656e5fd052d0ee1e9161e25090b54be70d4880ba.zip
use killme() instead of die() so that any sessions are closed cleanly.
Diffstat (limited to 'include/api_auth.php')
-rw-r--r--include/api_auth.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/api_auth.php b/include/api_auth.php
index ee9db3f55..b78c69bac 100644
--- a/include/api_auth.php
+++ b/include/api_auth.php
@@ -1,6 +1,6 @@
<?php /** @file */
-require_once("oauth.php");
+require_once('include/oauth.php');
/**
@@ -25,7 +25,7 @@ function api_login(&$a){
}
echo __file__.__line__.__function__."<pre>";
// var_dump($consumer, $token);
- die();
+ killme();
}
catch(Exception $e) {
logger(__file__.__line__.__function__."\n".$e);
@@ -56,7 +56,8 @@ function api_login(&$a){
logger('API_login: ' . print_r($_SERVER,true), LOGGER_DEBUG);
header('WWW-Authenticate: Basic realm="Red"');
header('HTTP/1.0 401 Unauthorized');
- die('This api requires login');
+ echo('This api requires login');
+ killme();
}
// process normal login request
@@ -81,7 +82,8 @@ function api_login(&$a){
logger('API_login failure: ' . print_r($_SERVER,true), LOGGER_DEBUG);
header('WWW-Authenticate: Basic realm="Red"');
header('HTTP/1.0 401 Unauthorized');
- die('This api requires login');
+ echo('This api requires login');
+ killme();
}
}