char *authtype = "AUTH";
authname *anp;
int toomanyauths=0;
+ time_t now;
if (alg) {
challenge=1;
if (toomanyauths)
return CMD_ERROR;
- rup->lastauth=time(NULL);
+ /* Guarantee a unique auth timestamp for each account */
+ now=time(NULL);
+ if (rup->lastauth < now)
+ rup->lastauth=now;
+ else
+ rup->lastauth++;
+
sprintf(userhost,"%s@%s",sender->ident,sender->host->name->content);
if (rup->lastuserhost)
freesstring(rup->lastuserhost);
chanservstdmessage(sender, QM_AUTHSUSPENDED);
if(rup->suspendreason)
chanservstdmessage(sender, QM_REASON, rup->suspendreason->content);
- if (rup->suspendexp) {
- struct tm* tmp;
- char buf[200];
-
- tmp=gmtime(&(rup->suspendexp));
- strftime(buf, 15, "%d/%m/%y %H:%M", tmp);
- chanservstdmessage(sender, QM_EXPIRES, buf);
- }
+ if (rup->suspendexp)
+ chanservstdmessage(sender, QM_EXPIRES, rup->suspendexp);
return CMD_ERROR;
}
chanservstdmessage(sender, QM_AUTHOK, rup->username);
cs_log(sender,"%s OK username %s", authtype,rup->username);
- localusersetaccountwithuserid(sender, rup->username, rup->ID);;
+
+ localusersetaccount(sender, rup->username, rup->ID, cs_accountflagmap(rup), rup->lastauth);
return CMD_OK;
}