]>
jfr.im git - irc/quakenet/newserv.git/blob - chanserv/usercmds/spewpass.c
1 /* Automatically generated by refactor.pl.
7 * CMDDESC: Search for a password in the database.
8 * CMDFUNC: csu_dospewpass
9 * CMDPROTO: int csu_dospewpass(void *source, int cargc, char **cargv);
10 * CMDHELP: Usage: spewpass <pattern>
11 * CMDHELP: Displays all users with a password that matches the specified pattern.
14 #include "../chanserv.h"
15 #include "../../lib/irc_string.h"
19 int csu_dospewpass(void *source
, int cargc
, char **cargv
) {
21 reguser
*rup
=getreguserfromnick(sender
);
30 chanservstdmessage(sender
, QM_NOTENOUGHPARAMS
, "spewpass");
34 chanservstdmessage(sender
, QM_SPEWHEADER
);
35 for (i
=0;i
<REGUSERHASHSIZE
;i
++) {
36 for (dbrup
=regusernicktable
[i
]; dbrup
; dbrup
=dbrup
->nextbyname
) {
37 if (!UHasHelperPriv(dbrup
) && !match(cargv
[0], dbrup
->password
)) {
38 chanservsendmessage(sender
, "%-15s %-10s %-30s %s", dbrup
->username
, UHasSuspension(dbrup
)?"yes":"no", dbrup
->email
?dbrup
->email
->content
:"none set", dbrup
->lastuserhost
?dbrup
->lastuserhost
->content
:"none");
41 chanservstdmessage(sender
, QM_TOOMANYRESULTS
, 2000, "users");
47 chanservstdmessage(sender
, QM_RESULTCOUNT
, count
, "user", (count
==1)?"":"s");