accounts: Disable reg if client's already registered an account

This commit is contained in:
Daniel Oaks 2017-08-24 00:37:08 +10:00
parent eb72c38d0c
commit d052ca8a8d
1 changed files with 6 additions and 0 deletions

View File

@ -92,6 +92,12 @@ func accRegisterHandler(server *Server, client *Client, msg ircmsg.IrcMessage) b
return false
}
// clients can't reg new accounts if they're already logged in
if client.account != nil {
client.Send(nil, server.name, ERR_REG_UNSPECIFIED_ERROR, client.nick, "*", "You're already logged into an account")
return false
}
// get and sanitise account name
account := strings.TrimSpace(msg.Params[1])
casefoldedAccount, err := CasefoldName(account)