X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/blobdiff_plain/3c6cc37d3b954998f046819e8fe62a0d65b985b7..refs/pull/58/head:/chanserv/chanserv.h diff --git a/chanserv/chanserv.h b/chanserv/chanserv.h index 9c60a55e..6b94adb1 100644 --- a/chanserv/chanserv.h +++ b/chanserv/chanserv.h @@ -68,7 +68,7 @@ #define LINGERTIME 300 #define DUMPINTERVAL 300 #define EMAILLEN 60 -#define CHANTYPES 8 +#define CHANTYPES 9 #define CHANOPHISTORY 10 /* Suspension and g-line hit count limits */ @@ -76,7 +76,7 @@ #define MAXSUSPENDHIT 500 /* Maximum number of times a user may attempt to auth */ -#define MAXAUTHATTEMPT 10 +#define MAXAUTHATTEMPT 5 /* Maximum number of hellos in a session */ #define MAXHELLOS 2 @@ -94,11 +94,11 @@ #define CHALLENGEAUTHSITE "http://www.quakenet.org/development/challengeauth/" /* Cleanup options */ -#define CLEANUP_ACCOUNT_INACTIVE 80 +#define CLEANUP_ACCOUNT_INACTIVE 240 /* make sure you update CLEANUP_AUTHHISTORY too... */ #define CLEANUP_ACCOUNT_UNUSED 3 -#define CLEANUP_CHANNEL_INACTIVE 40 +#define CLEANUP_CHANNEL_INACTIVE 120 -#define CLEANUP_AUTHHISTORY 60 +#define CLEANUP_AUTHHISTORY 300 #define CLEANUP_MIN_CHAN_SIZE 2 @@ -113,15 +113,15 @@ #define MAXCHANLEVS 500 #define MAXBANS 50 -/* Maximum number of channels a user may be known on when adding new channels */ -#define MAXCHANNELS 2 +/* Maximum number of channels a user may be known on */ +#define MAXCHANNELS 500 /* Sources of entropy and standard length defines */ #define ENTROPYSOURCE "/dev/urandom" #define ENTROPYLEN 8 /* Minimum acceptable reason length for stuff like deluser */ -#define MIN_REASONLEN 20 +#define MIN_REASONLEN 15 #include "chanserv_messages.h" @@ -144,6 +144,7 @@ #define QPRIV_VIEWCHANSUSPENSION 110 #define QPRIV_VIEWSUSPENDEDBY 111 #define QPRIV_VIEWWALLMESSAGE 112 +#define QPRIV_VIEWREALHOST 113 #define QPRIV_CHANGECHANFLAGS 200 #define QPRIV_CHANGECHANLEV 201 @@ -152,6 +153,7 @@ #define QPRIV_CHANGEBANTIMER 204 #define QPRIV_CHANGEUSERFLAGS 205 #define QPRIV_CHANGEWELCOME 206 +#define QPRIV_RESETCHANSTAT 207 /* List of access checks */ @@ -252,9 +254,9 @@ /* email */ #define MAX_RESEND_TIME 2*3600L /* cooling off period */ -#define VALID_EMAIL "^[-_.+[:alpha:][:digit:]]+(\\.[-_[:digit:][:alpha:]]+)*@([[:digit:][:alpha:]](-?[[:digit:][:alpha:]])*\\.)+[[:alpha:]]{2}([zmuvtgol]|fo|me|seum|op|ro)?$" +#define VALID_EMAIL "\\A[^\\s\\+@]+@([a-z0-9][a-z0-9\\-]*\\.)+[a-z]{2,}\\Z" -#define VALID_ACCOUNT_NAME "^[a-z][-a-z0-9]+$" +#define VALID_ACCOUNT_NAME "\\A[a-z][a-z0-9\\-]+\\Z" #define QMAIL_NEWACCOUNT 1 /* new account */ #define QMAIL_REQPW 2 /* requestpassword */ @@ -753,8 +755,6 @@ extern sstring *cs_quitreason; void chanserv_finalinit(); /* chanservalloc.c */ -void chanservallocinit(); -void csfreeall(); regchan *getregchan(); void freeregchan(regchan *rcp); reguser *getreguser(); @@ -820,6 +820,7 @@ void csdb_updateban(regchan *rcp, regban *rbp); char *csdb_gethelpstr(char *command, int language); void csdb_createmail(reguser *rup, int type); void csdb_dohelp(nick *np, Command *cmd); +void csdb_flushchannelcounters(void *arg); #define q9asyncquery(handler, tag, format, ...) dbasyncqueryi(q9dbid, handler, tag, format , ##__VA_ARGS__) #define q9a_asyncquery(handler, tag, format, ...) dbasyncqueryi(q9adbid, handler, tag, format , ##__VA_ARGS__) @@ -850,6 +851,7 @@ void chanservwallmessage(char *message, ... ) __attribute__ ((format (printf, 1, void chanservcommandinit(); void chanservcommandclose(); void chanservstdmessage(nick *np, int messageid, ... ); +void chanservstdvmessage(nick *np, reguser *rup, int messageid, int max_line_len, void (*callback)(nick *, char *), va_list va); void chanservaddcommand(char *command, int flags, int maxparams, CommandHandler handler, char *description, const char *help); void chanservremovecommand(char *command, CommandHandler handler); void chanservaddctcpcommand(char *command, CommandHandler hander); @@ -877,10 +879,10 @@ void cs_removeuser(reguser *rup); int checkresponse(reguser *rup, const unsigned char *entropy, const char *response, CRAlgorithm algorithm); int checkhashpass(reguser *rup, const char *junk, const char *hash); flag_t cs_sanitisechanlev(flag_t flags); -typedef int (*UnbanFN)(void *arg, struct chanban *ban); -int cs_unbanfn(nick *sender, chanindex *cip, UnbanFN fn, void *arg, int removepermbans, int abortonfailure); +int cs_unbanfn(nick *sender, chanindex *cip, int (*fn)(void *arg, struct chanban *ban), void *arg, int removepermbans, int abortonfailure); void cs_logchanop(regchan *rcp, char *nick, reguser *rup); int checkreason(nick *np, char *reason); +regchan *cs_addchan(chanindex *cip, nick *sender, reguser *addedby, reguser *founder, flag_t flags, flag_t forcemodes, flag_t denymodes, short type); /* chanservstdcmds.c */ int cs_doshowcommands(void *source, int cargc, char **cargv); @@ -929,11 +931,6 @@ int readlastjoindata(const char *filename); /* chanservschedule.c */ void chanservdgline(void *arg); -/* authlib.c */ -int csa_checkeboy(nick *sender, char *eboy); -void csa_createrandompw(char *pw, int n); -int csa_checkthrottled(nick *sender, reguser *rup, char *s); - /* chanservdb_updates.c */ void csdb_updateauthinfo(reguser *rup); void csdb_updatelastjoin(regchanuser *rcup);