summaryrefslogtreecommitdiffstats
path: root/mbbsd/bbs.c
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd/bbs.c')
-rw-r--r--mbbsd/bbs.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index b1b616e3..beb48a8c 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -360,17 +360,20 @@ CheckPostPerm(void)
int CheckPostRestriction(int bid)
{
+ boardheader_t *bp;
if ((currmode & MODE_BOARD) || HasUserPerm(PERM_SYSOP))
return 1;
+ assert(0<=bid-1 && bid-1<MAX_BOARD);
+ bp = getbcache(bid);
// check first-login
- if (cuser.firstlogin > (now - (time4_t)bcache[bid - 1].post_limit_regtime * 2592000))
+ if (cuser.firstlogin > (now - (time4_t)bp->post_limit_regtime * 2592000))
return 0;
- if (cuser.numlogins / 10 < (unsigned int)bcache[bid - 1].post_limit_logins)
+ if (cuser.numlogins / 10 < (unsigned int)bp->post_limit_logins)
return 0;
- if (cuser.numposts / 10 < (unsigned int)bcache[bid - 1].post_limit_posts)
+ if (cuser.numposts / 10 < (unsigned int)bp->post_limit_posts)
return 0;
- if (cuser.badpost > (255 - (unsigned int)bcache[bid - 1].post_limit_badpost))
+ if (cuser.badpost > (255 - (unsigned int)bp->post_limit_badpost))
return 0;
return 1;