Use mongodb instead of MySQL for user UIDs tracking

This commit is contained in:
Aleksei Miheev
2016-01-31 07:55:58 +00:00
parent 1259469303
commit 49203676fd

View File

@@ -75,6 +75,7 @@ function loadUserSettings()
{
global $modSettings, $user_settings;
global $ID_MEMBER, $db_prefix, $cookiename, $user_info, $language;
global $mongodb;
// Check first the cookie, then the session.
if (isset($_COOKIE[$cookiename]))
@@ -149,9 +150,11 @@ function loadUserSettings()
);
$__uid = str_replace("uid=","",$_SERVER['USERID']);
db_query("
INSERT IGNORE INTO smf_member_uids VALUES('{$ID_MEMBER}', '{$__uid}')",
__FILE__, __LINE__);
$mongodb->rock->memberUids->update(
array('member' => $ID_MEMBER),
array('$addToSet' => array('uids' => $__uid)),
array('upsert' => true)
);
}
// If the user is a guest, initialize all the critial user settings.