Commit fad7f53c authored by Bong Cosca's avatar Bong Cosca
Browse files

Bug fix: Basic HTTP authentication and BAIL context

parent 8ff7c57d
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -186,9 +186,8 @@ class Auth {
	*	HTTP basic auth mechanism
	*	@return bool
	*	@param $func callback
	*	@param $halt bool
	**/
	function basic($func=NULL,$halt=TRUE) {
	function basic($func=NULL) {
		$fw=Base::instance();
		$realm=$fw->get('REALM');
		if (isset($_SERVER['HTTP_AUTHORIZATION']))
@@ -206,8 +205,7 @@ class Auth {
			return TRUE;
		if (PHP_SAPI!='cli')
			header('WWW-Authenticate: Basic realm="'.$realm.'"');
		if ($halt)
			$fw->error(401);
		$fw->status(401);
		return FALSE;
	}

+2 −1
Original line number Diff line number Diff line
@@ -908,6 +908,7 @@ final class Base {
				($src.$line)).$eol;
		}
		$this->hive['ERROR']=array(
			'status'=>$header,
			'code'=>$code,
			'text'=>$text,
			'trace'=>$trace
@@ -1520,7 +1521,7 @@ final class Base {
			'AJAX'=>isset($headers['X-Requested-With']) &&
				$headers['X-Requested-With']=='XMLHttpRequest',
			'AUTOLOAD'=>'./',
			'BAIL'=>FALSE,
			'BAIL'=>TRUE,
			'BASE'=>$base,
			'BODY'=>file_get_contents('php://input'),
			'CACHE'=>FALSE,