rem: this.sentps = true; 
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;			}			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;			for (nl in NLines) {				if ((NLines[nl].flags&NLINE_CHECK_QWKPASSWD) &&				    match_irc_mask(cmd[1],NLines[nl].servername)) {					var qwkid = cmd[1].slice(0,cmd[1].indexOf(".")).toUpperCase();					var usernum = system.matchuser(qwkid);					var bbsuser = new User(usernum);					if ((this.password.toUpperCase() ==					    bbsuser.security.password) &&					    (bbsuser.security.restrictions&UFLAG_Q)					   ) {						this_nline = NLines[nl];						break;					}				} 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.quit("ERROR: Server not configured.");				return 0;			}			if (searchbyserver(cmd[1])) {				this.quit("ERROR: Server already exists.");				return 0;			}			this.nick = cmd[1].toLowerCase();			this.hops = cmd[2];			this.realname = ircstring(cmdline);			this.server = true;			this.conntype = TYPE_SERVER;			this.linkparent = servername;			this.parent = this.id;			this.flags = this_nline.flags;			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.");		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;		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.");			return 0;		}		if (tmp_iline.password) {			if (tmp_iline.password != this.password) {				this.numeric(464, ":Password Incorrect.");				this.quit("Denied.");				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();		oper_notice("Notice","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)) {		hcc_counter++;		oper_notice("Routing","Link with " + this.nick + "[unknown@" + this.hostname + "] established, states: TS");		if (server.client_update != undefined)			server.client_update(this.socket, this.nick, this.hostname);		if (!this.sentps) {			for (cl in CLines) {				if(match_irc_mask(this.nick,CLines[cl].servername)) {					this.rawout("PASS " + CLines[cl].password + " :TS");					break;				}			}			this.rawout("CAPAB " + server_capab);			this.rawout("SERVER " + servername + " 1 :" + serverdesc);			this.sentps = true;		}		this.bcast_to_servers_raw(":" + servername + " SERVER " + this.nick + " 2 :" + this.realname);		this.synchronize();	}}
meta: 9592	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9592/6a1d64dab0dafd69383abe8125cd32da661b3033/ircd.js/buggy/ircd.js