[PHP4BETA] CVS update: php4

From: Date: Wed, 12 May 1999 21:35:16 +0000
Subject: [PHP4BETA] CVS update: php4
Groups: php.version4 
Request: Send a blank email to php-version4+get-831@lists.php.net to get a copy of this message
Date: Wednesday May 12, 1999 @ 17:35 Author: zeev Update of /repository/php4 In directory php:/tmp/cvs-serv17694 Modified Files: SAPI.c main.c Log Message: Support HTTP Auth under ISAPI. Now, these short pieces of code took *A LOT* of research :( Index: php4/SAPI.c diff -u php4/SAPI.c:1.17 php4/SAPI.c:1.18 --- php4/SAPI.c:1.17 Tue May 11 16:38:12 1999 +++ php4/SAPI.c Wed May 12 17:35:15 1999 @@ -111,14 +111,6 @@ 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); - } - } } Index: php4/main.c diff -u php4/main.c:1.55 php4/main.c:1.56 --- php4/main.c:1.55 Tue May 11 12:52:57 1999 +++ php4/main.c Wed May 12 17:35:16 1999 @@ -29,7 +29,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: main.c,v 1.55 1999/05/11 16:52:57 zeev Exp $ */ +/* $Id: main.c,v 1.56 1999/05/12 21:35:16 zeev Exp $ */ #include <stdio.h> @@ -629,6 +629,26 @@ 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; } -- PHP 4 Beta

« previous php.version4 (#831) next »