Changeset 2398


Ignore:
Timestamp:
11/26/2011 7:14:10 AM (6 months ago)
Author:
lowjoel
Message:

Implemented digest authentication even when using PHP as a CGI. In addition, fixed my syntax returning Error 500

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/website/scripts/BuildServer.php

    r2395 r2398  
    3636 
    3737//Challenge the client if we did not receive the digest 
     38if (empty($_SERVER['PHP_AUTH_DIGEST'])) 
     39{ 
     40    if (!empty($_SERVER['PHP_HTTP_AUTHORIZATION'])) 
     41    { 
     42        if (strtolower(substr($_SERVER['PHP_HTTP_AUTHORIZATION'], 0, 6)) == 'digest') 
     43            $_SERVER['PHP_AUTH_DIGEST'] = substr($_SERVER['PHP_HTTP_AUTHORIZATION'], 7); 
     44    } 
     45} 
    3846if (empty($_SERVER['PHP_AUTH_DIGEST'])) 
    3947    http_digest_challenge(); 
     
    113121{ 
    114122    ob_end_clean(); 
    115     header('500 Internal Server Error'); 
    116     echo $e->getMessage(); 
     123    header('HTTP/1.1 500 Internal Server Error'); 
     124    header('Status: 500 Internal Server Error'); 
     125    die($e->getMessage()); 
    117126} 
    118127?> 
Note: See TracChangeset for help on using the changeset viewer.