BUGFIX Fixed hardcoded HTTP protocol information in BasicAuth

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63464 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2008-10-01 14:41:15 +00:00
parent 655395a8e7
commit fd175cdbd3

View File

@ -39,7 +39,7 @@ class BasicAuth extends Object {
// If we've failed the authentication mechanism, then show the login form
if(!isset($authenticated)) {
header("WWW-Authenticate: Basic realm=\"$realm\"");
header('HTTP/1.0 401 Unauthorized');
header($_SERVER['SERVER_PROTOCOL'] . ' 401 Unauthorized');
if(isset($_SERVER['PHP_AUTH_USER'])) {
echo _t('BasicAuth.ERRORNOTREC', "That username / password isn't recognised");
@ -52,7 +52,7 @@ class BasicAuth extends Object {
if(!Permission::checkMember($member->ID, $permissionCode)) {
header("WWW-Authenticate: Basic realm=\"$realm\"");
header('HTTP/1.0 401 Unauthorized');
header($_SERVER['SERVER_PROTOCOL'] . ' 401 Unauthorized');
if(isset($_SERVER['PHP_AUTH_USER'])) {
echo _t('BasicAuth.ERRORNOTADMIN', "That user is not an administrator.");