]>
jfr.im git - irc/quakenet/newserv.git/blob - chanserv/authcmds/sendpassword.c
1 /* Automatically generated by refactor.pl.
4 * CMDNAME: sendpassword
5 * CMDLEVEL: QCMD_HELPER
7 * CMDDESC: Sends the users current password by email.
8 * CMDFUNC: csa_dosendpw
9 * CMDPROTO: int csa_dosendpw(void *source, int cargc, char **cargv);
10 * CMDHELP: Usage: SENDPASSWORD <username>
11 * CMDHELP: Sends the password for the specified account to the specified users email address.
14 #include "../chanserv.h"
15 #include "../authlib.h"
16 #include "../../lib/irc_string.h"
20 int csa_dosendpw(void *source
, int cargc
, char **cargv
) {
25 chanservstdmessage(sender
, QM_NOTENOUGHPARAMS
, "sendpassword");
29 if (!(rup
=findreguser(sender
, cargv
[0])))
32 if(UHasHelperPriv(rup
)) {
33 chanservstdmessage(sender
, QM_REQUESTPASSPRIVUSER
);
34 cs_log(sender
,"SENDPASSWORD FAIL privilidged user %s",rup
->username
);
38 /* we don't reset the throttling timer
39 rup->lastemailchange=time(NULL);
44 csdb_createmail(rup
, QMAIL_REQPW
);
46 csdb_createmail(rup
, QMAIL_NEWACCOUNT
); /* user hasn't authed yet and needs to do the captcha */
48 chanservstdmessage(sender
, QM_MAILQUEUED
);
49 cs_log(sender
,"SENDPASSWORD username %s", rup
->username
);