diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2013-08-30 00:33:48 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2013-08-30 11:45:16 +0200 |
commit | 7d398ba62227cf77066585b47adfcb5188dd991b (patch) | |
tree | 4f09d276ece43a69c926731561b0bfc48ab6dc2b | |
parent | 0a23ac18bc1f74cea98eed2c37aa03c99fd957f7 (diff) | |
download | nextcloud-server-7d398ba62227cf77066585b47adfcb5188dd991b.tar.gz nextcloud-server-7d398ba62227cf77066585b47adfcb5188dd991b.zip |
Use the real username in preferences and magic cookie instead of case-insensitive user input. Fixes 4616.
-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(); } |