rem: cmd=cmdline.split(' '); 
add: var cmd=cmdline.split(' '); 
context: function IRCClient_unregistered_commands(command, cmdline) {	if (command.match(/^[0-9]+/))		return 0; // we ignore all numerics from unregistered clients.	cmd=cmdline.split(' ');	switch(command) {		case "CAPAB":			break; // silently ignore for now.		case "NICK":			if (!cmd[1]) {				this.numeric(431, ":No nickname given.");				break;			}			var the_nick = ircstring(cmd[1]).slice(0,max_nicklen);			if (this.check_nickname(the_nick))				this.nick = the_nick;			break;		case "PASS":			if (!cmd[1])				break;			this.password = cmd[1];			break;		case "PING":			if (!cmd[1]) {				this.numeric(409,":No origin specified.");				break;			}			this.ircout("PONG " + servername + " :" + ircstring(cmdline));			break;		case "PONG":			this.pinged = false;			break;		case "SERVER":			if (this.nick != "*") {				this.numeric462();				break;			}			if (!cmd[3]) {				this.numeric461("SERVER");				break;			}			var this_nline = 0;			var qwk_slave = false;			var qwkid = cmd[1].slice(0,cmd[1].indexOf(".")).toUpperCase();			for (nl in NLines) {				if ((NLines[nl].flags&NLINE_CHECK_QWKPASSWD) &&				    match_irc_mask(cmd[1],NLines[nl].servername)) {					if (check_qwk_passwd(qwkid,this.password)) {						this_nline = NLines[nl];						break;					}				} else if ((NLines[nl].flags&NLINE_CHECK_WITH_QWKMASTER) &&				           match_irc_mask(cmd[1],NLines[nl].servername)) {						for (qwkm_nl in NLines) {							if (NLines[qwkm_nl].flags&NLINE_IS_QWKMASTER) {								var qwk_master = searchbyserver(NLines[qwkm_nl].servername);								if (!qwk_master) {									this.quit("No QWK master available for authorization.",true);									return 0;								} else {									qwk_master.rawout(":" + servername + " PASS " + this.password + " :" + qwkid + " QWK");									qwk_slave = true;								}							}						}				} else if ((NLines[nl].password == this.password) &&				           (match_irc_mask(cmd[1],NLines[nl].servername))				          ) {						this_nline = NLines[nl];						break;				}			}			if ( (!this_nline || 			      ( (this_nline.password == "*") && !this.sentps &&			        !(this_nline.flags&NLINE_CHECK_QWKPASSWD) ) 			     ) && !qwk_slave) {				this.quit("ERROR: Server not configured.",true);				return 0;			}			if (searchbyserver(cmd[1])) {				this.quit("ERROR: Server already exists.",true);				return 0;			}			this.nick = cmd[1].toLowerCase();			this.hops = cmd[2];			this.realname = ircstring(cmdline);			this.linkparent = servername;			this.parent = this.id;			this.flags = this_nline.flags;			if (!qwk_slave) { // qwk slaves should never be hubs.				this.server = true;				this.conntype = TYPE_SERVER;				for (hl in HLines) {					if (HLines[hl].servername.toUpperCase()					    == this.nick.toUpperCase()) {						this.hub = true;						break;					}				}			}			break;		case "USER":			if (this.server) {				this.numeric462();				break;			}			if (!cmd[4]) {				this.numeric461("USER");				break;			}			this.realname = ircstring(cmdline).slice(0,50);			var unreg_username = parse_username(cmd[1]);			this.uprefix = "~" + unreg_username;			break;		case "QUIT":			this.quit(ircstring(cmdline),true);			return;		default:			this.numeric451();			break;	}	if (this.uprefix && isklined(this.uprefix + "@" + this.hostname)) {		this.numeric(465, ":You've been K:Lined from this server.");		this.quit("You've been K:Lined from this server.",true);		return 0;	}	if (this.password && (unreg_username || (this.nick != "*")) &&	    !this.server) {		if (unreg_username)			var usernum = system.matchuser(unreg_username);		if (!usernum && (this.nick != "*"))			var usernum = system.matchuser(this.nick);		if (usernum) {			bbsuser = new User(usernum);			if (this.password.toUpperCase() == bbsuser.security.password)				this.uprefix = parse_username(bbsuser.handle).toLowerCase().slice(0,10);		}	}	if ( (count_local_nicks() + count_servers(false)) > hcc_total)		hcc_total = count_local_nicks() + count_servers(false);	if (count_local_nicks() > hcc_users)		hcc_users = count_local_nicks();	if (this.realname && this.uprefix && (this.nick != "*") &&	    !this.server) {		// Check for a valid I:Line.		var tmp_iline = this.searchbyiline();		if (!tmp_iline) {			this.numeric(463, ":Your host isn't among the privileged.");			this.quit("You are not authorized to use this server.",true);			return 0;		}		if (tmp_iline.password) {			if (tmp_iline.password != this.password) {				this.numeric(464, ":Password Incorrect.");				this.quit("Denied.",true);				return 0;			}		}		// We meet registration criteria. Continue.		this.ircclass = tmp_iline.ircclass;		hcc_counter++;		this.conntype = TYPE_USER;		this.numeric("001", ":Welcome to the Synchronet IRC Service, " + this.ircnuh);		this.numeric("002", ":Your host is " + servername + ", running " + VERSION);		this.numeric("003", ":This server was created " + strftime("%a %b %e %Y at %H:%M:%S %Z",server_uptime));		this.numeric("004", servername + " " + VERSION + " oi biklmnopstv");		this.numeric("005", "MODES=" + max_modes + " MAXCHANNELS=" + max_user_chans + " CHANNELLEN=" + max_chanlen + " MAXBANS=" + max_bans + " NICKLEN=" + max_nicklen + " TOPICLEN=" + max_topiclen + " KICKLEN=" + max_kicklen + " CHANTYPES=#& PREFIX=(ov)@+ NETWORK=Synchronet CASEMAPPING=ascii CHANMODES=b,k,l,imnpst STATUSMSG=@+ :are available on this server.");		this.lusers();		this.motd();		umode_notice(USERMODE_CLIENT,"Client","Client connecting: " +			this.nick + " (" + this.uprefix + "@" + this.hostname +			") [" + this.socket.remote_ip_address + "] {1}");		if (server.client_update != undefined)			server.client_update(this.socket, this.nick, this.hostname);		server_bcast_to_servers("NICK " + this.nick + " 1 " + this.created + " " + this.get_usermode() + " " + this.uprefix + " " + this.hostname + " " + servername + " 0 " + ip_to_int(this.ip) + " :" + this.realname);	/// Otherwise, it's a server trying to connect.	} else if (this.nick.match("[.]") && this.hops && this.realname &&		   this.server && (this.conntype == TYPE_SERVER)) {			this.finalize_server_connect("TS");	}}
meta: 9592	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9592/602751b924140f2f131ade2fe4bd7d9263e66c52/ircd.js/buggy/ircd.js