ID: 11578
Updated by: rasmus
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: HTTP related
Operating system: 
PHP Version: 4.0.5
Assigned To: 
Comments:

Are you using the Apache module version of PHP on Windows
or the standalone CGI binary version?  And what do you 
mean the headers are in the wrong order?  The order of
HTTP headers is not significant.

Previous Comments:
---------------------------------------------------------------------------

[2001-06-20 09:10:55] [EMAIL PROTECTED]
<?

//------------------------------------
// description : ntlm authentification module
//------------------------------------

//get the msg wich is contained in the headers of the apache server. 
  function get_msg_auth() {
        //$msg="no auth scheme//";
    $headers = getallheaders(); 
    while (list($header, $value) = each($headers)) { 
      if ($header == "Authorization") {
        $msg=$value;
      }
    } 
    $msg=substr($msg,5,strlen($msg));
    return $msg;
  }

  
//return to the browser the first step of the ntlm authentification schema.
  function beginntlm() {
    header("HTTP/1.1 401 accès refusé"); 
    header("WWW-Authenticate: NTLM"); 
  }

//send the msg2 to the client.
  function putmsg2($msg) {
    header("HTTP/1.1 401 accès refusé");
    header("www-authenticate: NTLM ".$msg);
    return($msg);
  }

//do the authentification
  function ntlm_auth () {
  
  $fp = fopen("c:/test.txt","w+");
  
  beginntlm();
  
  fwrite($fp,"msg1 = ");
  
  fwrite($fp,get_msg_auth());
 
  fwrite($fp,"nmsg2 = ");
  //msg2 not in  the script cause it is too big
  
fwrite($fp,putmsg2("TlRMTVNTUAACAAAADAAMADAAAAAFgoGgPhfzJ50JifsAAAAAAAAAAHIAcgA8AAAARABPAE0ARwBFAE4AAgAMAEQATwBNAEcARQBOAAEAHABTAFIAVgBHAEUAVABJAFQAXwBJAFMAUwBZADEABAAMAGQAbwBtAGcAZQBuAAMAKgBzAHIAdgBnAGUAdABpAHQAXwBpAHMAcwB5ADEALgBkAG8AbQBnAGUAbgAAAAAA"));

    
  fwrite($fp,"nmsg3 = ");
  
  fwrite($fp,get_msg_auth());
  
  fclose($fp);
  
  }

ntlm_auth();
 
 // header("location: index.php");


?> 

the following code is working(IE only..), i get the correct test.txt but if i 
uncomment the last line "header(location..=) the redirection is done but the auth 
header are not correct.. i've used tcpdump to see what is the problem and i've find 
that the header are not transmitted in the correct order and are modified.... i 
doesn't know if its the apache fault or the php optimer fault by my compagny really 
wait for a php version that permit to send and to get the headers correctly..
Thanks a lot
the php used is the binary for win32 with default modules and default php.ini (apache 
is used)
php is used an module of apache.

---------------------------------------------------------------------------



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=11578&edit=2


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to