Minor cleanups
[squirrelmail.git] / functions / auth.php
index 0765e7e2b92a2b89fcbedf2034b5467acf874c77..caef3b5e937b1a39bb58e7936f365ebb42387c9f 100644 (file)
@@ -8,7 +8,7 @@
  *
  * Contains functions used to do authentication.
  *
- * $Id$
+ * @version $Id$
  * @package squirrelmail
  */
 
@@ -42,22 +42,23 @@ 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_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')) {
            sqsession_register($session_expired_location,'session_expired_location');
         }
         include_once( SM_PATH . 'functions/display_messages.php' );
+        set_up_language($squirrelmail_language, true);
         logout_error( _("You must be logged in to access this page.") );
         exit;
     }
@@ -97,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)) {
@@ -138,7 +139,7 @@ function digest_md5_response ($username,$password,$challenge,$service,$host) {
   $reply .= ',qop=' . $qop_value;
   $reply = base64_encode($reply);
   return $reply . "\r\n";
+
 }
 
 /**
@@ -218,15 +219,14 @@ function hmac_md5($data, $key='') {
     return $hmac;
 }
 
-/** 
+/**
  * Fillin user and password based on SMTP auth settings.
  *
- * @global
  * @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