mirror of
https://github.com/php/php-src.git
synced 2025-08-19 08:49:28 +02:00
Support HTTP Auth under ISAPI. Now, these short pieces of code took *A LOT* of
research :(
This commit is contained in:
parent
cefca57c9c
commit
49b01a4b3d
2 changed files with 20 additions and 8 deletions
|
@ -111,14 +111,6 @@ SAPI_API void sapi_deactivate(SLS_D)
|
|||
if (SG(request_info).post_data) {
|
||||
efree(SG(request_info).post_data);
|
||||
}
|
||||
if (SG(server_context)) {
|
||||
if (SG(request_info).auth_user) {
|
||||
efree(SG(request_info).auth_user);
|
||||
}
|
||||
if (SG(request_info).auth_password) {
|
||||
efree(SG(request_info).auth_password);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
20
main/main.c
20
main/main.c
|
@ -629,6 +629,26 @@ int php_request_startup(CLS_D ELS_DC PLS_DC SLS_DC)
|
|||
init_executor(CLS_C ELS_CC);
|
||||
startup_scanner(CLS_C);
|
||||
|
||||
if (SG(request_info).auth_user) {
|
||||
zval *auth_user;
|
||||
|
||||
MAKE_STD_ZVAL(auth_user);
|
||||
auth_user->type = IS_STRING;
|
||||
auth_user->value.str.val = SG(request_info).auth_user;
|
||||
auth_user->value.str.len = strlen(auth_user->value.str.val);
|
||||
|
||||
zend_hash_update(&EG(symbol_table), "PHP_AUTH_USER", sizeof("PHP_AUTH_USER"), &auth_user, sizeof(zval *), NULL);
|
||||
}
|
||||
if (SG(request_info).auth_user) {
|
||||
zval *auth_password;
|
||||
|
||||
MAKE_STD_ZVAL(auth_password);
|
||||
auth_password->type = IS_STRING;
|
||||
auth_password->value.str.val = SG(request_info).auth_password;
|
||||
auth_password->value.str.len = strlen(auth_password->value.str.val);
|
||||
|
||||
zend_hash_update(&EG(symbol_table), "PHP_AUTH_PW", sizeof("PHP_AUTH_PW"), &auth_password, sizeof(zval *), NULL);
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue