diff options
-rw-r--r-- | lib/base.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/base.php b/lib/base.php index 2e6a37c9f4e..c6e031e61d6 100644 --- a/lib/base.php +++ b/lib/base.php @@ -791,14 +791,15 @@ class OC { self::$session->set('timezone', $_POST['timezone-offset']); } - self::cleanupLoginTokens($_POST['user']); + $userid = OC_User::getUser(); + self::cleanupLoginTokens($userid); if (!empty($_POST["remember_login"])) { if (defined("DEBUG") && DEBUG) { OC_Log::write('core', 'Setting remember login to cookie', OC_Log::DEBUG); } $token = OC_Util::generate_random_bytes(32); - OC_Preferences::setValue($_POST['user'], 'login_token', $token, time()); - OC_User::setMagicInCookie($_POST["user"], $token); + OC_Preferences::setValue($userid, 'login_token', $token, time()); + OC_User::setMagicInCookie($userid, $token); } else { OC_User::unsetMagicInCookie(); } |