Plugins have to be able to update the message cache if they manipulate messages
[squirrelmail.git] / functions / auth.php
index b7d57452d8ce123f9d4ccbb79d3c165b566df618..53b96d9f717e27ee90ef326bc99bb62dfe9fa452 100644 (file)
@@ -34,19 +34,24 @@ function sqauth_is_logged_in() {
         return true;
     }
 
-       //  First we store some information in the new session to prevent
-       //  information-loss.
-       $session_expired_post = $_POST;
-       $session_expired_location = PAGE_NAME;
-       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');
-       }
-       session_write_close();
+    //  First we store some information in the new session to prevent
+    //  information-loss.
+    $session_expired_post = $_POST;
+    if (defined('PAGE_NAME'))
+        $session_expired_location = PAGE_NAME;
+    else
+        $session_expired_location = '';
 
-       return false;
+    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');
+    }
+
+    session_write_close();
+
+    return false;
 }
 
 /**
@@ -260,7 +265,7 @@ function hmac_md5($data, $key='') {
  *
  * @param string $user Reference to SMTP username
  * @param string $pass Reference to SMTP password (unencrypted)
- * @since 1.5.0
+ * @since 1.4.11
  */
 function get_smtp_user(&$user, &$pass) {
     global $username, $smtp_auth_mech,
@@ -282,5 +287,6 @@ function get_smtp_user(&$user, &$pass) {
     // directly changing the arguments array contents 
     // in your plugin e.g., $args[0] = 'new_username';
     //
-    do_hook('smtp_auth', $temp=array(&$user, &$pass));
+    $temp = array(&$user, &$pass);
+    do_hook('smtp_auth', $temp);
 }