X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fauth.php;h=f8c45768446628cb551c8a22e090f1e3a23039d0;hb=eaddf11f4c08b8a19396d50c8f80c2360f71d70a;hp=f33904f99b695daf175e8322d05b3ee845f4d86d;hpb=ab4e0c480a1fd391cb18a4ef19eb3a20a70260f8;p=squirrelmail.git diff --git a/functions/auth.php b/functions/auth.php index f33904f9..f8c45768 100644 --- a/functions/auth.php +++ b/functions/auth.php @@ -8,7 +8,7 @@ * * Contains functions used to do authentication. * - * $Id$ + * @version $Id$ * @package squirrelmail */ @@ -42,16 +42,16 @@ function is_logged_in() { if ( sqsession_is_registered('user_is_logged_in') ) { return; } else { - global $PHP_SELF, $session_expired_post, - $session_expired_location; + global $PHP_SELF, $session_expired_post, + $session_expired_location, $squirrelmail_language; /* First we store some information in the new session to prevent * information-loss. */ - - $session_expired_post = $_POST; + + $session_expired_post = $_POST; $session_expired_location = $PHP_SELF; - if (!sqsession_is_registered('session_expired_post')) { + if (!sqsession_is_registered('session_expired_post')) { sqsession_register($session_expired_post,'session_expired_post'); } if (!sqsession_is_registered('session_expired_location')) { @@ -98,7 +98,7 @@ function cram_md5_response ($username,$password,$challenge) { */ function digest_md5_response ($username,$password,$challenge,$service,$host) { $result=digest_md5_parse_challenge($challenge); - + // verify server supports qop=auth // $qop = explode(",",$result['qop']); //if (!in_array("auth",$qop)) { @@ -110,7 +110,7 @@ function digest_md5_response ($username,$password,$challenge,$service,$host) { /* This can be auth (authentication only), auth-int (integrity protection), or auth-conf (confidentiality protection). Right now only auth is supported. - DO NOT CHANGE THIS VALUE */ + DO NOT CHANGE THIS VALUE */ $qop_value = "auth"; $digest_uri_value = $service . '/' . $host; @@ -139,7 +139,7 @@ function digest_md5_response ($username,$password,$challenge,$service,$host) { $reply .= ',qop=' . $qop_value; $reply = base64_encode($reply); return $reply . "\r\n"; - + } /** @@ -175,10 +175,10 @@ function digest_md5_parse_challenge($challenge) { // We're in a "simple" value - explode to next comma $val=explode(',',$challenge,2); if (isset($val[1])) { - $challenge=$val[1]; - } else { - unset($challenge); - } + $challenge=$val[1]; + } else { + unset($challenge); + } $value=$val[0]; } $parsed["$key"]=$value; @@ -219,14 +219,14 @@ function hmac_md5($data, $key='') { return $hmac; } -/** +/** * Fillin user and password based on SMTP auth settings. * * @param string $user Reference to SMTP username * @param string $pass Reference to SMTP password (unencrypted) */ function get_smtp_user(&$user, &$pass) { - global $username, $smtp_auth_mech, + global $username, $smtp_auth_mech, $smtp_sitewide_user, $smtp_sitewide_pass; if ($smtp_auth_mech == 'none') { @@ -242,4 +242,4 @@ function get_smtp_user(&$user, &$pass) { } } -?> +?> \ No newline at end of file