mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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:
parent
655395a8e7
commit
fd175cdbd3
@ -39,7 +39,7 @@ class BasicAuth extends Object {
|
|||||||
// If we've failed the authentication mechanism, then show the login form
|
// If we've failed the authentication mechanism, then show the login form
|
||||||
if(!isset($authenticated)) {
|
if(!isset($authenticated)) {
|
||||||
header("WWW-Authenticate: Basic realm=\"$realm\"");
|
header("WWW-Authenticate: Basic realm=\"$realm\"");
|
||||||
header('HTTP/1.0 401 Unauthorized');
|
header($_SERVER['SERVER_PROTOCOL'] . ' 401 Unauthorized');
|
||||||
|
|
||||||
if(isset($_SERVER['PHP_AUTH_USER'])) {
|
if(isset($_SERVER['PHP_AUTH_USER'])) {
|
||||||
echo _t('BasicAuth.ERRORNOTREC', "That username / password isn't recognised");
|
echo _t('BasicAuth.ERRORNOTREC', "That username / password isn't recognised");
|
||||||
@ -52,7 +52,7 @@ class BasicAuth extends Object {
|
|||||||
|
|
||||||
if(!Permission::checkMember($member->ID, $permissionCode)) {
|
if(!Permission::checkMember($member->ID, $permissionCode)) {
|
||||||
header("WWW-Authenticate: Basic realm=\"$realm\"");
|
header("WWW-Authenticate: Basic realm=\"$realm\"");
|
||||||
header('HTTP/1.0 401 Unauthorized');
|
header($_SERVER['SERVER_PROTOCOL'] . ' 401 Unauthorized');
|
||||||
|
|
||||||
if(isset($_SERVER['PHP_AUTH_USER'])) {
|
if(isset($_SERVER['PHP_AUTH_USER'])) {
|
||||||
echo _t('BasicAuth.ERRORNOTADMIN', "That user is not an administrator.");
|
echo _t('BasicAuth.ERRORNOTADMIN', "That user is not an administrator.");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user