]>
jfr.im git - irc/quakenet/newserv.git/blob - chanserv/authcmds/setpassword.c
1 /* Automatically generated by refactor.pl.
8 * CMDDESC: Set a new password.
10 * CMDPROTO: int csa_dosetpw(void *source, int cargc, char **cargv);
11 * CMDHELP: Usage: @UCOMMAND@ <username> <password>
12 * CMDHELP: Sets the password for the specified username.
15 #include "../chanserv.h"
16 #include "../authlib.h"
17 #include "../../lib/irc_string.h"
21 int csa_dosetpw(void *source
, int cargc
, char **cargv
) {
23 reguser
*rup
, *vrup
=getreguserfromnick(sender
);
26 chanservstdmessage(sender
, QM_NOTENOUGHPARAMS
, "setpassword");
30 if (!(rup
=findreguser(sender
, cargv
[0])))
33 if(UHasHelperPriv(rup
)) {
34 cs_log(sender
,"GETPASSWORD FAILED username %s",rup
->username
);
35 chanservwallmessage("%s (%s) just FAILED using SETPASSWORD on %s", sender
->nick
, vrup
->username
, rup
->username
);
36 chanservsendmessage(sender
, "Sorry, that user is privileged.");
40 cs_log(sender
,"SETPASSWORD OK username %s",rup
->username
);
41 chanservwallmessage("%s (%s) just used SETPASSWORD on %s", sender
->nick
, vrup
->username
, rup
->username
);
44 freesstring(rup
->lastemail
);
49 csdb_accounthistory_insert(sender
, rup
->password
, cargv
[1], NULL
, NULL
);
50 setpassword(rup
, cargv
[1]);
53 chanservstdmessage(sender
, QM_PWCHANGED
);