瀏覽代碼

Modified sqimap_session_id to return something when there is no session ID
yet. This lets it work with the login_auth plugin.

Tyler Akins 23 年之前
父節點
當前提交
495b22fb6f
共有 1 個文件被更改,包括 9 次插入1 次删除
  1. 9 1
      functions/imap_general.php

+ 9 - 1
functions/imap_general.php

@@ -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;
    }