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