escinfo[0]='\0';
pqquery("UPDATE users SET lastauth=%lu, lastemailchng=%lu, flags=%u,"
- "language=%u, suspendby=%u, suspendexp=%lu, suspendtime=%lu, password='%s', email='%s',"
+ "language=%u, suspendby=%u, suspendexp=%lu, suspendtime=%lu, lockuntil=%lu, password='%s', email='%s',"
"lastuserhost='%s', suspendreason='%s', comment='%s', info='%s' WHERE ID=%u",
rup->lastauth, rup->lastemailchange, rup->flags, rup->languageid, rup->suspendby, rup->suspendexp,
- rup->suspendtime, escpassword, escemail, esclastuserhost, escreason, esccomment, escinfo,
+ rup->suspendtime, rup->lockuntil, escpassword, escemail, esclastuserhost, escreason, esccomment, escinfo,
rup->ID);
}
escinfo[0]='\0';
pqquery("INSERT INTO users (ID, username, created, lastauth, lastemailchng, "
- "flags, language, suspendby, suspendexp, suspendtime, password, email, lastuserhost, "
- "suspendreason, comment, info) VALUES (%u,'%s',%lu,%lu,%lu,%u,%u,%u,%lu,%lu,'%s','%s',"
+ "flags, language, suspendby, suspendexp, suspendtime, lockuntil, password, email, lastuserhost, "
+ "suspendreason, comment, info) VALUES (%u,'%s',%lu,%lu,%lu,%u,%u,%u,%lu,%lu,%lu,'%s','%s',"
"'%s','%s','%s','%s')",
rup->ID, escusername, rup->created, rup->lastauth, rup->lastemailchange, rup->flags,
- rup->languageid, rup->suspendby, rup->suspendexp,
+ rup->languageid, rup->suspendby, rup->suspendexp, rup->suspendtime, rup->lockuntil,
escpassword, escemail, esclastuserhost, escreason, esccomment, escinfo);
}
"suspendby INT NOT NULL,"
"suspendexp INT NOT NULL,"
"suspendtime INT NOT NULL,"
+ "lockuntil INT NOT NULL,"
"password VARCHAR(11) NOT NULL,"
"email VARCHAR(100),"
"lastuserhost VARCHAR(75),"
return;
}
- if (PQnfields(pgres)!=16) {
+ if (PQnfields(pgres)!=17) {
Error("chanserv",ERR_ERROR,"User DB format error");
return;
}
rup->suspendby=strtoul(PQgetvalue(pgres,i,7),NULL,10);
rup->suspendexp=strtoul(PQgetvalue(pgres,i,8),NULL,10);
rup->suspendtime=strtoul(PQgetvalue(pgres,i,9),NULL,10);
- strncpy(rup->password,PQgetvalue(pgres,i,10),PASSLEN); rup->password[PASSLEN]='\0';
- rup->email=getsstring(PQgetvalue(pgres,i,11),100);
+ rup->lockuntil=strtoul(PQgetvalue(pgres,i,10),NULL,10);
+ strncpy(rup->password,PQgetvalue(pgres,i,11),PASSLEN); rup->password[PASSLEN]='\0';
+ rup->email=getsstring(PQgetvalue(pgres,i,12),100);
if (rup->email) {
rup->domain=findorcreatemaildomain(rup->email->content);
addregusertomaildomain(rup, rup->domain);
rup->domain=NULL;
rup->localpart=NULL;
}
- rup->lastuserhost=getsstring(PQgetvalue(pgres,i,12),75);
- rup->suspendreason=getsstring(PQgetvalue(pgres,i,13),250);
- rup->comment=getsstring(PQgetvalue(pgres,i,14),250);
- rup->info=getsstring(PQgetvalue(pgres,i,15),100);
+ rup->lastuserhost=getsstring(PQgetvalue(pgres,i,13),75);
+ rup->suspendreason=getsstring(PQgetvalue(pgres,i,14),250);
+ rup->comment=getsstring(PQgetvalue(pgres,i,15),250);
+ rup->info=getsstring(PQgetvalue(pgres,i,16),100);
rup->knownon=NULL;
rup->checkshd=NULL;
rup->stealcount=0;