summaryrefslogtreecommitdiff
path: root/sapi/isapi
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2002-12-01 12:48:08 +0000
committerStanislav Malyshev <stas@php.net>2002-12-01 12:48:08 +0000
commit2c7d6f9a7431de44a1f47dff3533a487625d5eca (patch)
tree7048ac6d920a1de1a1d43e0446ac0f9a391bf24f /sapi/isapi
parent1356e60fa3e45fb8c0c4d59e4755fb7ad7657197 (diff)
downloadphp-git-2c7d6f9a7431de44a1f47dff3533a487625d5eca.tar.gz
improve username/password detection for IIS
Diffstat (limited to 'sapi/isapi')
-rw-r--r--sapi/isapi/php4isapi.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sapi/isapi/php4isapi.c b/sapi/isapi/php4isapi.c
index 6f9db5c454..f7758fac69 100644
--- a/sapi/isapi/php4isapi.c
+++ b/sapi/isapi/php4isapi.c
@@ -571,6 +571,25 @@ static void sapi_isapi_register_server_variables(zval *track_vars_array TSRMLS_D
}
php_register_variable("DOCUMENT_ROOT", humi.lpszPath, track_vars_array TSRMLS_CC);
}
+
+ if (!SG(request_info).auth_user || !SG(request_info).auth_password ||
+ !SG(request_info).auth_user[0] || !SG(request_info).auth_password[0]) {
+ DWORD variable_len;
+ char static_variable_buf[ISAPI_SERVER_VAR_BUF_SIZE];
+
+ variable_len = ISAPI_SERVER_VAR_BUF_SIZE;
+ if (lpECB->GetServerVariable(lpECB->ConnID, "HTTP_AUTHORIZATION", static_variable_buf, &variable_len)
+ && static_variable_buf[0]) {
+ php_handle_auth_data(static_variable_buf TSRMLS_CC);
+ }
+ }
+
+ if (SG(request_info).auth_user) {
+ php_register_variable("PHP_AUTH_USER", SG(request_info).auth_user, track_vars_array TSRMLS_CC );
+ }
+ if (SG(request_info).auth_password) {
+ php_register_variable("PHP_AUTH_PW", SG(request_info).auth_password, track_vars_array TSRMLS_CC );
+ }
}
#endif
}