mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
force users to log out their unregistered session after logging in with a new registered account
This commit is contained in:
parent
1bee788210
commit
3bb1d9a1de
6 changed files with 10 additions and 3 deletions
|
|
@ -46,8 +46,11 @@ AuthenticationResult Server::loginUser(Server_ProtocolHandler *session, QString
|
|||
|
||||
if (authState == PasswordRight) {
|
||||
Server_ProtocolHandler *oldSession = users.value(name);
|
||||
if (oldSession)
|
||||
if (oldSession) {
|
||||
if (!(oldSession->getUserInfo()->getUserLevel() & ServerInfo_User::IsRegistered))
|
||||
return WouldOverwriteOldSession;
|
||||
delete oldSession; // ~Server_ProtocolHandler() will call Server::removeClient
|
||||
}
|
||||
} else if (authState == UnknownUser) {
|
||||
// Change user name so that no two users have the same names,
|
||||
// don't interfere with registered user names though.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue