Added a counter pref and a fix for the imapid
This commit is contained in:
parent
fad6c7dbcd
commit
9d1cdf9457
3 changed files with 7 additions and 2 deletions
|
@ -20,9 +20,12 @@
|
||||||
*/
|
*/
|
||||||
function sqimap_session_id() {
|
function sqimap_session_id() {
|
||||||
|
|
||||||
|
global $data_dir, $username;
|
||||||
|
|
||||||
$IMAPSessionID = substr(session_id(), -4);
|
$IMAPSessionID = substr(session_id(), -4);
|
||||||
if( $IMAPSessionID == '' ) {
|
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 );
|
||||||
|
|
|
@ -70,7 +70,7 @@
|
||||||
if (isset($prefs_cache[$string]))
|
if (isset($prefs_cache[$string]))
|
||||||
return $prefs_cache[$string];
|
return $prefs_cache[$string];
|
||||||
else
|
else
|
||||||
return $default;
|
return $default;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -104,6 +104,8 @@
|
||||||
session_register ('username');
|
session_register ('username');
|
||||||
setcookie('key', $key, 0, $base_uri);
|
setcookie('key', $key, 0, $base_uri);
|
||||||
do_hook ('login_verified');
|
do_hook ('login_verified');
|
||||||
|
setPref( $data_dir, $username, 'counter',
|
||||||
|
getPref( $data_dir, $username, 'counter', 0 ) + 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the login variables. */
|
/* Set the login variables. */
|
||||||
|
|
Loading…
Add table
Reference in a new issue