drupal core updated to 7.28
This commit is contained in:
@@ -114,8 +114,23 @@ function system_test_sleep($seconds) {
|
||||
}
|
||||
|
||||
function system_test_basic_auth_page() {
|
||||
$output = t('$_SERVER[\'PHP_AUTH_USER\'] is @username.', array('@username' => $_SERVER['PHP_AUTH_USER']));
|
||||
$output .= t('$_SERVER[\'PHP_AUTH_PW\'] is @password.', array('@password' => $_SERVER['PHP_AUTH_PW']));
|
||||
// The Authorization HTTP header is forwarded via Drupal's .htaccess file even
|
||||
// for PHP CGI SAPIs.
|
||||
if (isset($_SERVER['HTTP_AUTHORIZATION'])) {
|
||||
$authorization_header = $_SERVER['HTTP_AUTHORIZATION'];
|
||||
}
|
||||
// If using CGI on Apache with mod_rewrite, the forwarded HTTP header appears
|
||||
// in the redirected HTTP headers. See
|
||||
// https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpFoundation/ServerBag.php#L61
|
||||
elseif (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) {
|
||||
$authorization_header = $_SERVER['REDIRECT_HTTP_AUTHORIZATION'];
|
||||
}
|
||||
// Resemble PHP_AUTH_USER and PHP_AUTH_PW for a Basic authentication from
|
||||
// the HTTP_AUTHORIZATION header. See
|
||||
// http://www.php.net/manual/features.http-auth.php
|
||||
list($user, $pw) = explode(':', base64_decode(substr($authorization_header, 6)));
|
||||
$output = t('Username is @username.', array('@username' => $user));
|
||||
$output .= t('Password is @password.', array('@password' => $pw));
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user