Fixed mbuser killing new users
This commit is contained in:
parent
ca54df4fb2
commit
c5f1e966e6
@ -4640,3 +4640,8 @@ v0.33.20 10-Feb-2002
|
||||
On some systems the download taglists contained garbage after
|
||||
the short filename causing wrong filenames at the users side.
|
||||
|
||||
mbuser:
|
||||
If a new user has registered and not yet used the bbs, mbuser
|
||||
would kill that user because the last login date wasn't set.
|
||||
It will use the registration date instead.
|
||||
|
||||
|
@ -169,7 +169,7 @@ int unpack(char *fn)
|
||||
} else {
|
||||
sync();
|
||||
sleep(1);
|
||||
Syslog('!', "Warning: unpack %s failed, trying again after sync()");
|
||||
Syslog('!', "Warning: unpack %s failed, trying again after sync()", fn);
|
||||
if ((rc = execute(cmd,fn,(char *)NULL,(char*)"/dev/null",(char*)"/dev/null",(char*)"/dev/null")) == 0) {
|
||||
unlink(fn);
|
||||
} else {
|
||||
|
@ -175,6 +175,7 @@ void UserPack(int days, int level, int pack)
|
||||
char *fnin, *fnout;
|
||||
long oldsize, curpos;
|
||||
int updated, delete = 0, rc, highest = 0, record = 0, sysop = FALSE;
|
||||
time_t Last;
|
||||
|
||||
fnin = calloc(PATH_MAX, sizeof(char));
|
||||
fnout = calloc(PATH_MAX, sizeof(char));
|
||||
@ -257,11 +258,20 @@ void UserPack(int days, int level, int pack)
|
||||
curpos = sizeof(usrhdr);
|
||||
|
||||
while (fread(&usr, sizeof(usr), 1, fout) == 1) {
|
||||
/*
|
||||
* New users don't have the last login date set yet,
|
||||
* use the registration date instead.
|
||||
*/
|
||||
if (usr.iTotalCalls == 0)
|
||||
Last = usr.tFirstLoginDate;
|
||||
else
|
||||
Last = usr.tLastLoginDate;
|
||||
|
||||
/*
|
||||
* Wow, killing on the second exact!. Don't kill
|
||||
* the guest accounts.
|
||||
*/
|
||||
if ((((t_start - usr.tLastLoginDate) / 86400) > days) &&
|
||||
if ((((t_start - Last) / 86400) > days) &&
|
||||
(usr.Security.level < level) && (!usr.Guest) &&
|
||||
(usr.sUserName[0] != '\0') && (!usr.NeverDelete)) {
|
||||
Syslog('+', "Mark user %s", usr.sUserName);
|
||||
|
Reference in New Issue
Block a user