]>
jfr.im git - irc/quakenet/newserv.git/blob - auth/auth.c
3 #include "../control/control.h"
4 #include "../nick/nick.h"
5 #include "../irc/irc.h"
6 #include "../localuser/localuser.h"
7 #include "../lib/flags.h"
8 #include "../lib/version.h"
12 /* we allow reauthing for flag changing, as well as testing purposes */
13 int au_auth(void *source
, int cargc
, char **cargv
) {
14 nick
*sender
=(nick
*)source
;
23 if(sscanf(myserver
->content
, "%*s.quakenet.org") == 1) {
24 controlreply(sender
, "Sorry, you can't use this command on QuakeNet.");
29 if(setflags(&flags
, AFLAG_ALL
, cargv
[3], accountflags
, REJECT_UNKNOWN
) != REJECT_NONE
) {
30 controlreply(sender
, "Bad flag(s) supplied.");
38 authts
= atoi(cargv
[1]);
39 authid
= atoi(cargv
[2]);
41 controlwall(NO_OPER
, NL_OPERATIONS
, "AUTH'ed at %s:%d:%d:%s", authname
, authts
, authid
, printflags(flags
, accountflags
));
43 localusersetaccount(sender
, authname
, authid
, flags
, authts
);
44 controlreply(sender
, "Done.");
50 registercontrolhelpcmd("auth", NO_OPERED
, 3, au_auth
, "Usage: auth <authname> <authts> <authid> ?accountflags?");
54 deregistercontrolcmd("auth", au_auth
);