From: philippe_mingo Date: Wed, 28 Nov 2001 19:48:30 +0000 (+0000) Subject: Added a counter pref and a fix for the imapid X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=71257f8b1bbf95b87735f654487efbad21b138a0 Added a counter pref and a fix for the imapid git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1813 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/imap_general.php b/functions/imap_general.php index 8bd2485a..066fb4c2 100755 --- a/functions/imap_general.php +++ b/functions/imap_general.php @@ -20,9 +20,12 @@ */ function sqimap_session_id() { + global $data_dir, $username; + $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 ); diff --git a/functions/prefs.php b/functions/prefs.php index 5ecf530f..1d5fb68f 100644 --- a/functions/prefs.php +++ b/functions/prefs.php @@ -70,7 +70,7 @@ if (isset($prefs_cache[$string])) return $prefs_cache[$string]; else - return $default; + return $default; } diff --git a/src/redirect.php b/src/redirect.php index f4091057..011b14b2 100644 --- a/src/redirect.php +++ b/src/redirect.php @@ -104,6 +104,8 @@ 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. */