*
*
* CMDNAME: auth
- * CMDALIASES: login
+ * CMDALIASES: login ircdauth
* CMDLEVEL: QCMD_SECURE | QCMD_NOTAUTHED
* CMDARGS: 2
* CMDDESC: Authenticates you on the bot.
aup->authattempts++;
if (aup->authattempts > MAXAUTHATTEMPT) {
+/*
if ((aup->authattempts % 100) == 0)
chanservwallmessage("Warning: User %s!%s@%s attempted to auth %d times. Last attempt: %s %s %s",
sender->nick, sender->ident, sender->host->name->content, aup->authattempts, authtype, cargv[0], cargv[1]);
+*/
+
chanservstdmessage(sender, QM_AUTHFAIL);
cs_log(sender,"%s FAIL too many auth attempts (last attempt: %s %s %s)", authtype, authtype, cargv[0], cargv[1]);
return CMD_ERROR;
int csa_completeauth(nick *sender, reguser *rup, char *authtype) {
int toomanyauths=0;
- time_t now;
+ time_t now, oldlastauth;
char userhost[USERLEN+HOSTLEN+2];
nick *onp;
+ void *args[2];
authname *anp;
/* This should never fail but do something other than crashing if it does. */
chanservstdmessage(sender, QM_EXPIRES, rup->suspendexp);
return CMD_ERROR;
}
+ if (UIsInactive(rup)) {
+ chanservstdmessage(sender, QM_INACTIVEACCOUNT);
+ return CMD_ERROR;
+ }
/* Guarantee a unique auth timestamp for each account */
+ oldlastauth=rup->lastauth;
+
if (rup->lastauth < now)
rup->lastauth=now;
else
chanservstdmessage(sender, QM_AUTHOK, rup->username);
+ args[0]=sender;
+ args[1]=(void *)oldlastauth;
+ triggerhook(HOOK_CHANSERV_AUTH, args);
+
return CMD_OK;
}