Use the real username in preferences and magic cookie instead of case-insensitive user input. Fixes 4616.
This commit is contained in:
parent
0a23ac18bc
commit
7d398ba622
1 changed files with 4 additions and 3 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue