From 9f8d4b4346060ef1491be834a6a104dfc1217e6d Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Thu, 30 Dec 2010 18:59:19 +1300 Subject: [PATCH] Actually use new calculated per principal auth_realm. Signed-off-by: Andrew McMillan --- inc/HTTPAuthSession.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/inc/HTTPAuthSession.php b/inc/HTTPAuthSession.php index b0514fa4..52100659 100644 --- a/inc/HTTPAuthSession.php +++ b/inc/HTTPAuthSession.php @@ -67,13 +67,14 @@ class HTTPAuthSession { global $c; if ( $auth_header == "" ) { $auth_realm = $c->system_name; - if ( isset($c->per_principal_realm) ) { + if ( isset($c->per_principal_realm) && $c->per_principal_realm ) { $principal_name = preg_replace( '{^/(.*?)/.*$}', '$1', $_SERVER["PATH_INFO"]); if ( $principal_name != $_SERVER["PATH_INFO"] ) { $auth_realm .= ' - ' . $principal_name; } } - $auth_header = sprintf( 'WWW-Authenticate: Basic realm="%s"', $c->system_name); + dbg_error_log( "HTTPAuth", ":AuthFailedResponse Requesting authentictaion in the '%s' realm", $auth_realm ); + $auth_header = sprintf( 'WWW-Authenticate: Basic realm="%s"', $auth_realm ); } header('HTTP/1.1 401 Unauthorized', true, 401 );