1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
7 * <brain@chatspike.net>
8 * <Craig@chatspike.net>
10 * Written by Craig Edwards, Craig McLure, and others.
11 * This program is free but copyrighted software; see
12 * the file COPYING for details.
14 * ---------------------------------------------------
17 #include "inspircd_config.h"
18 #include "configreader.h"
22 #include "helperfuncs.h"
23 #include "commands/cmd_user.h"
25 extern ServerConfig* Config;
27 extern ModuleList modules;
28 extern FactoryList factory;
30 void cmd_user::Handle (char **parameters, int pcnt, userrec *user)
32 if (user->registered < 3)
34 if (!isident(parameters[0])) {
35 // This kinda Sucks, According to the RFC thou, its either this,
36 // or "You have already registered" :p -- Craig
37 WriteServ(user->fd,"461 %s USER :Not enough parameters",user->nick);
40 /* We're not checking ident, but I'm not sure I like the idea of '~' prefixing.. */
41 /* XXX - Should this IDENTMAX + 1 be IDENTMAX - 1? Ok, users.h has it defined as
42 * char ident[IDENTMAX+2]; - WTF?
44 snprintf(user->ident, IDENTMAX+1, "~%s", parameters[0]);
45 strlcpy(user->fullname,parameters[3],MAXGECOS);
46 user->registered = (user->registered | 1);
51 WriteServ(user->fd,"462 %s :You may not reregister",user->nick);
54 /* parameters 2 and 3 are local and remote hosts, ignored when sent by client connection */
55 if (user->registered == 3)
57 /* user is registered now, bit 0 = USER command, bit 1 = sent a NICK command */
58 FOREACH_MOD(I_OnUserRegister,OnUserRegister(user));
59 //ConnectUser(user,NULL);