#include "../../core/nsmalloc.h"
#include "../../lib/strlfunc.h"
#include "../../dbapi/dbapi.h"
+#include "../../lib/version.h"
#include <string.h>
#include <stdio.h>
#include <sys/poll.h>
#include <stdarg.h>
+MODULE_VERSION(QVERSION);
+
int chanservdb_ready;
regchan **allchans;
"suspendreason VARCHAR(250),"
"comment VARCHAR(250),"
"info VARCHAR(100),"
+ "lastpasschng INT NOT NULL,"
"PRIMARY KEY (ID))");
dbcreatequery("CREATE INDEX user_username_index ON chanserv.users (username)");
chanservext=registerchanext("chanserv");
chanservaext=registerauthnameext("chanserv",1);
- /* Set up the allocators and hashes */
- chanservallocinit();
+ /* Set up the hashes */
chanservhashinit();
/* And the messages */
return;
}
- if (dbnumfields(pgres)!=18) {
+ if (dbnumfields(pgres)!=19) {
Error("chanserv",ERR_ERROR,"User DB format error");
return;
}
rup->suspendreason=getsstring(dbgetvalue(pgres,15),250);
rup->comment=getsstring(dbgetvalue(pgres,16),250);
rup->info=getsstring(dbgetvalue(pgres,17),100);
+ rup->lastpasschange=strtoul(dbgetvalue(pgres,18),NULL,10);
rup->knownon=NULL;
rup->checkshd=NULL;
rup->stealcount=0;
regban *rbp;
regchan *rcp;
int uid,cid,bid;
- time_t expiry,now;
+ time_t expiry;
int total=0;
pgres=dbgetresult(dbconn);
return;
}
- now=time(NULL);
-
while(dbfetchrow(pgres)) {
bid=strtoul(dbgetvalue(pgres,0),NULL,10);
cid=strtoul(dbgetvalue(pgres,1),NULL,10);
free(allchans);
Error("chanserv",ERR_INFO,"Channel ban load done, highest ID was %d",lastbanID);
-
- chanservdb_ready=1;
- triggerhook(HOOK_CHANSERV_DBLOADED, NULL);
}
void loadmessages() {
void loadmaillocksdone(DBConn *dbconn, void *arg) {
Error("chanserv",ERR_INFO,"Load Mail Locks done (highest ID was %d)",lastmaillockID);
+
+ chanservdb_ready=1;
+ triggerhook(HOOK_CHANSERV_DBLOADED, NULL);
}