]> jfr.im git - irc/quakenet/newserv.git/blobdiff - auth/auth.c
CHANSERV: remove accidental sendemail from SETEMAIL command.
[irc/quakenet/newserv.git] / auth / auth.c
index 5a1b4963db53de94e3e9ae22d66be0fc8c541405..4885205a724223c025279ce529fca81693bd0308 100644 (file)
@@ -5,11 +5,15 @@
 #include "../irc/irc.h"
 #include "../localuser/localuser.h"
 #include "../lib/flags.h"
+#include "../lib/version.h"
+
+MODULE_VERSION("");
 
 /* we allow reauthing for flag changing, as well as testing purposes */
 int au_auth(void *source, int cargc, char **cargv) {
   nick *sender=(nick *)source;
   char *authname;
+  int authts;
   int authid;
   flag_t flags;
 
@@ -21,8 +25,8 @@ int au_auth(void *source, int cargc, char **cargv) {
     return CMD_ERROR;
   }
 
-  if(cargc > 2) {
-    if(setflags(&flags, AFLAG_ALL, cargv[2], accountflags, REJECT_UNKNOWN) != REJECT_NONE) {
+  if(cargc > 3) {
+    if(setflags(&flags, AFLAG_ALL, cargv[3], accountflags, REJECT_UNKNOWN) != REJECT_NONE) {
       controlreply(sender, "Bad flag(s) supplied.");
       return CMD_ERROR;
     }
@@ -31,18 +35,19 @@ int au_auth(void *source, int cargc, char **cargv) {
   }
 
   authname = cargv[0];
-  authid = atoi(cargv[1]);
+  authts = atoi(cargv[1]);
+  authid = atoi(cargv[2]);
 
-  controlwall(NO_OPER, NL_OPERATIONS, "AUTH'ed at %s:%d:%s", authname, authid, printflags(flags, accountflags));
+  controlwall(NO_OPER, NL_OPERATIONS, "AUTH'ed at %s:%d:%d:%s", authname, authts, authid, printflags(flags, accountflags));
 
-  localusersetaccount(sender, authname, authid, flags, 0);
+  localusersetaccount(sender, authname, authid, flags, authts);
   controlreply(sender, "Done.");
 
   return CMD_OK;
 }
 
 void _init() {
-  registercontrolhelpcmd("auth", NO_OPERED, 3, au_auth, "Usage: auth <authname> <authid> ?accountflags?");
+  registercontrolhelpcmd("auth", NO_OPERED, 3, au_auth, "Usage: auth <authname> <authts> <authid> ?accountflags?");
 }
 
 void _fini() {