Skip to content
Snippets Groups Projects
Commit 13e8c94f authored by mcmlxxix's avatar mcmlxxix
Browse files

moved SEVAL to admin module, moved IDENT from admin module

parent fb9ab563
No related branches found
No related tags found
No related merge requests found
......@@ -145,15 +145,46 @@ Bot_Commands["HELP"].command = function (target,onick,ouh,srv,lvl,cmd) {
}
Bot_Commands["?"] = Bot_Commands["HELP"];
Bot_Commands["SEVAL"] = new Bot_Command(99,true,true);
Bot_Commands["SEVAL"].command = function (target,onick,ouh,srv,lvl,cmd) {
cmd.shift();
var query = cmd.join(" ");
try {
srv.o(target,eval(query));
} catch(e) {
srv.o(target,"ERROR: "+e);
Bot_Commands["IDENT"] = new Bot_Command(0,true,false);
Bot_Commands["IDENT"].usage =
"/MSG %s IDENT <nick> <pass>";
Bot_Commands["IDENT"].help =
"Identifies a user by alias and password. Use via private message only.";
Bot_Commands["IDENT"].command = function (target,onick,ouh,srv,lvl,cmd) {
var usr = new User(system.matchuser(onick));
if (cmd[2]) { /* Username passed */
usr = new User(system.matchuser(cmd[1]));
cmd[1] = cmd[2];
}
if (!usr.number) {
srv.o(target,"No such user.");
return;
}
if ((target[0] == "#") || (target[0] == "&")) {
if (lvl >= 50) {
srv.o(target,"Fool! You've just broadcasted your password to "
+ "a public channel! Because of this, I've reset your "
+ "password. Pick a new password, then /MSG " + srv.nick + " "
+ "PASS <newpass>");
usr.security.password = "";
} else {
srv.o(target,"Is broadcasting a password to a public channel "
+ "really a smart idea?");
}
return;
}
if (usr.security.password == "") {
srv.o(target,"Your password is blank. Please set one with /MSG "
+ srv.nick + " PASS <newpass>, and then use IDENT.");
return;
}
if (cmd[1].toUpperCase() == usr.security.password) {
srv.o(target,"You are now recognized as user '" + usr.alias + "'");
srv.users[onick.toUpperCase()].ident = usr.number;
login_user(usr);
return;
}
srv.o(target,"Incorrect password.");
return;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment