[PHP4BETA] CVS update: php4
| From: | zeev | Date: | Wed, 12 May 1999 22:49:23 +0000 |
| Subject: | [PHP4BETA] CVS update: php4 | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-834@lists.php.net to get a copy of this message | ||
Date: Wednesday May 12, 1999 @ 18:49
Author: zeev
Update of /repository/php4
In directory php:/tmp/cvs-serv24382
Modified Files:
mod_php3.c
Log Message:
Enable Apache HTTP Auth
Index: php4/mod_php3.c
diff -u php4/mod_php3.c:1.19 php4/mod_php3.c:1.20
--- php4/mod_php3.c:1.19 Tue May 11 14:36:35 1999
+++ php4/mod_php3.c Wed May 12 18:49:22 1999
@@ -28,7 +28,7 @@
| PHP 4.0 patches by Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: mod_php3.c,v 1.19 1999/05/11 18:36:35 zeev Exp $ */
+/* $Id: mod_php3.c,v 1.20 1999/05/12 22:49:22 zeev Exp $ */
#include "httpd.h"
#include "http_config.h"
@@ -201,6 +201,8 @@
{
request_rec *r = ((request_rec *) SG(server_context));
char *content_length = (char *) table_get(r->subprocess_env, "CONTENT_LENGTH");
+ const char *authorization=NULL;
+ char *tmp;
SG(request_info).query_string = r->args;
SG(request_info).path_translated = r->filename;
@@ -208,6 +210,26 @@
SG(request_info).request_method = r->method;
SG(request_info).content_type = (char *) table_get(r->subprocess_env,
"CONTENT_TYPE");
SG(request_info).content_length = (content_length ? atoi(content_length) : 0);
+
+ if (r->headers_in) {
+ authorization = table_get(r->headers_in, "Authorization");
+ }
+ if (authorization
+ && !auth_type(r)
+ && !strcmp(getword(r->pool, &authorization, ' '), "Basic")) {
+ tmp = uudecode(r->pool, authorization);
+ SG(request_info).auth_user = getword_nulls_nc(r->pool, &tmp, ':');
+ if (SG(request_info).auth_user) {
+ SG(request_info).auth_user = estrdup(SG(request_info).auth_user);
+ }
+ SG(request_info).auth_password = tmp;
+ if (SG(request_info).auth_password) {
+ SG(request_info).auth_password = estrdup(SG(request_info).auth_password);
+ }
+ } else {
+ SG(request_info).auth_user = NULL;
+ SG(request_info).auth_password = NULL;
+ }
}
@@ -275,7 +297,6 @@
chdir_file(filename);
add_common_vars(r);
add_cgi_vars(r);
- init_request_info();
apache_php3_module_main(r, fd, display_source_mode SLS_CC);
/* Done, restore umask, turn off timeout, close file and return */
--
PHP 4 Beta