The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

php prob after update

Discussion in 'General Discussion' started by DigiCrime, Nov 24, 2005.

  1. DigiCrime

    DigiCrime Well-Known Member

    Joined:
    Nov 27, 2002
    Messages:
    399
    Likes Received:
    0
    Trophy Points:
    16
    user is complaining that a partciular variable $_SERVER is not working after the update to 4.4.1 wondered if anyone else has encountered it

    PHP:
    <?php 
    if (!isset($PHP_AUTH_USER)) { 
    header('WWW-Authenticate: Basic realm="zzzzxxxxxxxx"'); 
    header('HTTP/1.0 401 Unauthorized'); 
    echo 
    'Authorization Required.'
    echo 
    "USER:".$_SERVER['PHP_AUTH_USER']."<br>"
    echo 
    "PASS:".$_SERVER['PHP_AUTH_PW']."<br>"
    exit; 

    elseif (isset(
    $_SERVER['PHP_AUTH_USER'])) { 
    if(
    $_SERVER['PHP_AUTH_USER'] == "greenfield" && $_SERVER['PHP_AUTH_PW'] == "znort") { 

    ............................. 
    authorized entry ....................... 


    else { 
    header('WWW-Authenticate: Basic realm="zzzzzzzzzxxxxxxxxx"'); 

    header('HTTP/1.0 401 Unauthorized'); 
    echo 
    'Authorization Required.'
    echo 
    "USER:".$_SERVER['PHP_AUTH_USER']."<br>"
    echo 
    "PASS:".$_SERVER['PHP_AUTH_PW']."<br>"
    exit; 


    ?>
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    You didn't switch to using phpsuexec did you?
     
  3. DigiCrime

    DigiCrime Well-Known Member

    Joined:
    Nov 27, 2002
    Messages:
    399
    Likes Received:
    0
    Trophy Points:
    16
    hmm good point... Yes but not that recent guess it took that long for user to figure out something was wrong, ill troubleshoot without phpsuexec see what happens
     
  4. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    Enabling phpsuexec will effectively disable http authentication in PHP scripts, hence the script you posted won't work.

    However I don't find this to be much of a problem because, on the whole, I find http authentication, from the user perspective, to be pretty intrusive and unpleasant.
     
Loading...

Share This Page