From 9bac3b96f6fcf26f9dfcf55a11839d4333915add Mon Sep 17 00:00:00 2001 From: Markus Fischer Date: Mon, 10 Jun 2002 23:02:34 +0000 Subject: [PATCH] - Document the *AUTH* vars in the predefined appendix, use $_SERVER and $_REQUEST in the http auth example, closes #14804. # Wth has there been used !strcmp() to match strigns?! Removed. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@85331 c90b9560-bf6c-de11-be94-00142212c4b1 --- appendices/predefined.xml | 32 +++++++++++++++++++++++++++++++- appendices/reserved.xml | 32 +++++++++++++++++++++++++++++++- features/http-auth.xml | 18 +++++++++--------- 3 files changed, 71 insertions(+), 11 deletions(-) diff --git a/appendices/predefined.xml b/appendices/predefined.xml index 8a0c537ac6..75bb9035fc 100644 --- a/appendices/predefined.xml +++ b/appendices/predefined.xml @@ -1,5 +1,5 @@ - + + + + 'PHP_AUTH_USER' + + + When running under Apache as module doing HTTP authentication this + variable is set to the username prodived by the user. + + + + + + 'PHP_AUTH_PW' + + + When running under Apache as module doing HTTP authentication this + variable is set to the password prodived by the user. + + + + + + 'PHP_AUTH_TYPE' + + + When running under Apache as module doing HTTP authenticated this + variable is set to the authentication type. + + + diff --git a/appendices/reserved.xml b/appendices/reserved.xml index 8034fc4544..58f4575d3b 100755 --- a/appendices/reserved.xml +++ b/appendices/reserved.xml @@ -1,5 +1,5 @@ - + List of Reserved Words @@ -555,6 +555,36 @@ + + 'PHP_AUTH_USER' + + + When running under Apache as module doing HTTP authentication this + variable is set to the username prodived by the user. + + + + + + 'PHP_AUTH_PW' + + + When running under Apache as module doing HTTP authentication this + variable is set to the password prodived by the user. + + + + + + 'PHP_AUTH_TYPE' + + + When running under Apache as module doing HTTP authenticated this + variable is set to the authentication type. + + + + diff --git a/features/http-auth.xml b/features/http-auth.xml index 6f8eb12c78..889a9b3e5a 100644 --- a/features/http-auth.xml +++ b/features/http-auth.xml @@ -1,5 +1,5 @@ - + HTTP authentication with PHP @@ -25,14 +25,14 @@ Hello $PHP_AUTH_USER.

"; - echo "

You entered $PHP_AUTH_PW as your password.

"; + echo "

Hello {$_SERVER['PHP_AUTH_USER']}.

"; + echo "

You entered {$_SERVER['$PHP_AUTH_PW']} as your password.

"; } ?> ]]> @@ -104,15 +104,15 @@ exit; } - if (!isset($PHP_AUTH_USER) || ($SeenBefore == 1 && !strcmp($OldAuth, $PHP_AUTH_USER))) { + if (!isset($_SERVER['PHP_AUTH_USER']) || ($SeenBefore == 1 && $OldAuth == $_SERVER['$PHP_AUTH_USER']))) { authenticate(); } else { - echo "

Welcome: $PHP_AUTH_USER
"; - echo "Old: $OldAuth"; - echo "

\n"; + echo "

Welcome: {$_SERVER['$PHP_AUTH_USER']}
"; + echo "Old: {$_REQUEST['$OldAuth']}"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "

\n"; }