]>
jfr.im git - irc/quakenet/newserv.git/blob - chanserv/usercmds/cleanupdb.c
1 /* Automatically generated by refactor.pl.
8 * CMDFUNC: csu_docleanupdb
9 * CMDPROTO: int csu_docleanupdb(void *source, int cargc, char **cargv);
12 #include "../chanserv.h"
13 #include "../../lib/irc_string.h"
17 int csu_docleanupdb(void *source
, int cargc
, char **cargv
) {
26 to_age
= time(NULL
) - (80 * 3600 * 24);
28 for (i
=0;i
<REGUSERHASHSIZE
;i
++) {
29 for (vrup
=regusernicktable
[i
]; vrup
; vrup
=srup
) {
30 srup
=vrup
->nextbyname
;
31 if (!(anp
=findauthname(vrup
->ID
)))
32 continue; /* should maybe raise hell instead */
34 if(!anp
->nicks
&& vrup
->lastauth
< to_age
&& !UHasHelperPriv(vrup
) && !UIsCleanupExempt(vrup
)) {
35 tmp
=gmtime(&(vrup
->lastauth
));
36 strftime(buf
,15,"%d/%m/%y %H:%M",tmp
);
44 chanservsendmessage(sender
, "Removed %d Accounts (not used for 80 days)", j
);