diff options
author | tomsmeding <tom.smeding@gmail.com> | 2017-04-22 19:14:33 +0200 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2017-04-22 19:14:33 +0200 |
commit | 5fad8375bda29e4740720438a38815b773023a38 (patch) | |
tree | d0163224006f95331494fdef27eee60d84cb8856 | |
parent | 0983e38e640d5168c31ddc6663057268afaefb4a (diff) |
server: Log out on *all* invalid logins
-rw-r--r-- | command.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -32,6 +32,11 @@ static bool cmd_login(struct conn_data *data,const char *tag,const char **args){ i64 userid=db_find_user(args[0]); if(userid==-1){ net_send_error(data->fd,tag,"User not found"); + if(data->userid!=-1){ + userdata_unregister(data->userid,data->fd); + broadcast_online_change(data->userid); + data->userid=-1; + } return false; } char *pass=db_get_pass(userid); |