Added a counter pref and a fix for the imapid
authorphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 28 Nov 2001 19:48:30 +0000 (19:48 +0000)
committerphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 28 Nov 2001 19:48:30 +0000 (19:48 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1813 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_general.php
functions/prefs.php
src/redirect.php

index 8bd2485aee551001430052b15421889c12bb489e..066fb4c2d80138bfc1eb815979893dd6fb47e0df 100755 (executable)
     */
     function sqimap_session_id() {
 
     */
     function sqimap_session_id() {
 
+        global $data_dir, $username;
+
         $IMAPSessionID = substr(session_id(), -4);
         if( $IMAPSessionID == '' ) {
         $IMAPSessionID = substr(session_id(), -4);
         if( $IMAPSessionID == '' ) {
-            $IMAPSessionID = GenerateRandomString(4, '', 7);
+            $IMAPSessionID = str_pad( dechex( getPref( $data_dir, $username, 'counter', 0 ) ),
+                                      4, '0', STR_PAD_LEFT);
         }
 
         return( $IMAPSessionID );
         }
 
         return( $IMAPSessionID );
index 5ecf530f94476e64b9e831386f583201b8a36184..1d5fb68fb67cec349c5010213daf20b11082957e 100644 (file)
@@ -70,7 +70,7 @@
       if (isset($prefs_cache[$string]))
           return $prefs_cache[$string];
       else
       if (isset($prefs_cache[$string]))
           return $prefs_cache[$string];
       else
-        return $default;
+          return $default;
    }
 
 
    }
 
 
index f409105762487181968d20a8ffe0af98ead0c669..011b14b2882e261dfd3b63e8ff2574e368f9ede8 100644 (file)
         session_register ('username');
         setcookie('key', $key, 0, $base_uri);
         do_hook ('login_verified');
         session_register ('username');
         setcookie('key', $key, 0, $base_uri);
         do_hook ('login_verified');
+        setPref( $data_dir, $username, 'counter',
+            getPref( $data_dir, $username, 'counter', 0 ) + 1 );
     }
 
     /* Set the login variables. */
     }
 
     /* Set the login variables. */