rafael          Tue Jun 11 04:59:23 2002 EDT

  Modified files:              
    /phpdoc-es/features http-auth.xml 
  Log:
  Sync with english version. 
  
  
Index: phpdoc-es/features/http-auth.xml
diff -u phpdoc-es/features/http-auth.xml:1.9 phpdoc-es/features/http-auth.xml:1.10
--- phpdoc-es/features/http-auth.xml:1.9        Fri May 31 15:34:57 2002
+++ phpdoc-es/features/http-auth.xml    Tue Jun 11 04:59:23 2002
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.9 $ -->
-<!-- EN-Revision: 1.22 Maintainer: rafael Status: ready -->
+<!-- $Revision: 1.10 $ -->
+<!-- EN-Revision: 1.23 Maintainer: rafael Status: ready -->
 
  <chapter id="features.http-auth">
   <title>Autentificaci&oacute;n HTTP con PHP</title>
@@ -29,14 +29,14 @@
    <programlisting role="php">
 <![CDATA[
 <?php
-  if (!isset($PHP_AUTH_USER)) {
+  if (!isset($_SERVER['PHP_AUTH_USER'])) {
     header("WWW-Authenticate: Basic realm=\"My Realm\"");
     header("HTTP/1.0 401 Unauthorized");
     echo "Text to send if user hits Cancel button\n";
     exit;
   } else {
-    echo "<p>Hello $PHP_AUTH_USER.</p>";
-    echo "<p>You entered $PHP_AUTH_PW as your password.</p>";
+    echo "<p>Hello {$_SERVER['PHP_AUTH_USER']}.</p>";
+    echo "<p>You entered {$_SERVER['$PHP_AUTH_PW']} as your password.</p>";
   }
 ?>
 ]]>
@@ -111,19 +111,22 @@
   function authenticate() {
     header( "WWW-Authenticate: Basic realm=\"Test Authentication System\"");
     header( "HTTP/1.0 401 Unauthorized");
-    echo "You must enter a valid login ID and password to access this resource\n";
+    echo "You must enter a valid login ID and password to access this resource\n"
+;
     exit;
   }
  
-  if (!isset($PHP_AUTH_USER) || ($SeenBefore == 1 && !strcmp($OldAuth, 
$PHP_AUTH_USER))) {
+  if (!isset($_SERVER['PHP_AUTH_USER']) || ($SeenBefore == 1 && $OldAuth == $_SER
+VER['$PHP_AUTH_USER']))) {
    authenticate();
   } 
   else {
-   echo "<p>Welcome: $PHP_AUTH_USER<br>";
-   echo "Old: $OldAuth";
-   echo "<form action='$PHP_SELF' METHOD='POST'>\n";
+   echo "<p>Welcome: {$_SERVER['$PHP_AUTH_USER']}<br>";
+   echo "Old: {$_REQUEST['$OldAuth']}";
+   echo "<form action='{$_SERVER['$PHP_SELF']}' METHOD='POST'>\n";
    echo "<input type='hidden' name='SeenBefore' value='1'>\n";
-   echo "<input type='hidden' name='OldAuth' value='$PHP_AUTH_USER'>\n";
+   echo "<input type='hidden' name='OldAuth' value='{$_SERVER['$PHP_AUTH_USER']}'
+>\n";
    echo "<input type='submit' value='Re Authenticate'>\n";
    echo "</form></p>\n";
   }


Reply via email to