]>
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"
9 /* we allow reauthing for flag changing, as well as testing purposes */
10 int au_auth(void *source
, int cargc
, char **cargv
) {
11 nick
*sender
=(nick
*)source
;
19 if(sscanf(myserver
->content
, "%*s.quakenet.org") == 1) {
20 controlreply(sender
, "Sorry, you can't use this command on QuakeNet.");
25 if(setflags(&flags
, AFLAG_ALL
, cargv
[2], accountflags
, REJECT_UNKNOWN
) != REJECT_NONE
) {
26 controlreply(sender
, "Bad flag(s) supplied.");
34 authid
= atoi(cargv
[1]);
36 controlwall(NO_OPER
, NL_OPERATIONS
, "AUTH'ed at %s:%d:%s", authname
, authid
, printflags(flags
, accountflags
));
38 localusersetaccount(sender
, authname
, authid
, flags
, 0);
39 controlreply(sender
, "Done.");
45 registercontrolhelpcmd("auth", NO_OPERED
, 3, au_auth
, "Usage: auth <authname> <authid> ?accountflags?");
49 deregistercontrolcmd("auth", au_auth
);