Modified sqimap_session_id to return something when there is no session ID
authorfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 23 Nov 2001 15:01:18 +0000 (15:01 +0000)
committerfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 23 Nov 2001 15:01:18 +0000 (15:01 +0000)
yet.  This lets it work with the login_auth plugin.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1792 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_general.php

index 165a02a..b557628 100755 (executable)
@@ -19,7 +19,15 @@ $imap_general_debug = false;
     ******************************************************************************/
 
    function sqimap_session_id() {
-      return( substr( session_id(), -4 ) );
+      if (session_id() != '')
+         return substr(session_id(), -4);
+        
+      global $RememberedSessionID;
+      
+      if (! isset($RememberedSessionID))
+         $RememberedSessionID = GenerateRandomString(4, '', 7);
+        
+      return $RememberedSessionID;
    }