fix #46005: User not consistently logged under Apache2

This commit is contained in:
Stanislav Malyshev 2008-12-17 11:33:56 +00:00
parent 5c5a284f54
commit 4cd34ac3d3
2 changed files with 7 additions and 0 deletions

View File

@ -434,6 +434,10 @@ static void php_apache_request_ctor(ap_filter_t *f, php_struct *ctx TSRMLS_DC)
apr_table_unset(f->r->headers_out, "ETag");
auth = apr_table_get(f->r->headers_in, "Authorization");
php_handle_auth_data(auth TSRMLS_CC);
if (SG(request_info).auth_user == NULL && f->r->user) {
SG(request_info).auth_user = estrdup(f->r->user);
}
ctx->r->user = apr_pstrdup(ctx->r->pool, SG(request_info).auth_user);
php_request_startup(TSRMLS_C);
}

View File

@ -471,6 +471,9 @@ static int php_apache_request_ctor(request_rec *r, php_struct *ctx TSRMLS_DC)
apr_table_unset(r->headers_out, "ETag");
auth = apr_table_get(r->headers_in, "Authorization");
php_handle_auth_data(auth TSRMLS_CC);
if (SG(request_info).auth_user == NULL && r->user) {
SG(request_info).auth_user = estrdup(r->user);
}
ctx->r->user = apr_pstrdup(ctx->r->pool, SG(request_info).auth_user);
return php_request_startup(TSRMLS_C);
}