mirror of https://github.com/calzoneman/sync.git
Disallow duplicate guest names
This commit is contained in:
parent
6a6dd7bc21
commit
beb26f45fb
11
user.js
11
user.js
|
@ -574,6 +574,17 @@ User.prototype.login = function(name, pw, session) {
|
|||
});
|
||||
}
|
||||
else {
|
||||
if(this.channel != null) {
|
||||
for(var i = 0; i < this.channel.users.length; i++) {
|
||||
if(this.channel.users[i].name == name) {
|
||||
this.socket.emit("login", {
|
||||
success: false,
|
||||
error: "That name is already taken on this channel"
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
lastguestlogin[this.ip] = Date.now();
|
||||
this.rank = Rank.Guest;
|
||||
Logger.syslog.log(this.ip + " signed in as " + name);
|
||||
|
|
Loading…
Reference in New Issue