summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2010-10-10 15:19:11 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2010-10-10 15:19:11 +0800
commitbd60f1b3de49e7a65eb0ec7442d0f0a04adbe97a (patch)
tree6d5d37658d458fd7137972662683424525ef30c9
parentfc5988bbcf45e4c12ec20e714df0b0886ec802db (diff)
downloadpttbbs-bd60f1b3de49e7a65eb0ec7442d0f0a04adbe97a.tar
pttbbs-bd60f1b3de49e7a65eb0ec7442d0f0a04adbe97a.tar.gz
pttbbs-bd60f1b3de49e7a65eb0ec7442d0f0a04adbe97a.tar.bz2
pttbbs-bd60f1b3de49e7a65eb0ec7442d0f0a04adbe97a.tar.lz
pttbbs-bd60f1b3de49e7a65eb0ec7442d0f0a04adbe97a.tar.xz
pttbbs-bd60f1b3de49e7a65eb0ec7442d0f0a04adbe97a.tar.zst
pttbbs-bd60f1b3de49e7a65eb0ec7442d0f0a04adbe97a.zip
SA: Checking of MODE_POST was not synchronized for BM and Adm.
MODE_POST_CHECKED should be invalidated when currboard changed. Effects: SYSOP could post in readonly boards before this fix. git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5113 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/mbbsd/bbs.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/pttbbs/mbbsd/bbs.c b/pttbbs/mbbsd/bbs.c
index a64be57a..3daed26e 100644
--- a/pttbbs/mbbsd/bbs.c
+++ b/pttbbs/mbbsd/bbs.c
@@ -308,9 +308,10 @@ set_board(void)
/* init basic perm, but post perm is checked on demand */
currmode = (currmode & (MODE_DIRTY | MODE_GROUPOP)) | MODE_STARTED;
if (!HasUserPerm(PERM_NOCITIZEN) &&
- (HasUserPerm(PERM_ALLBOARD) || is_BM_cache(currbid) ||
- (bp->BM[0] <= ' ' && GROUPOP()))) {
- currmode = currmode | MODE_BOARD | MODE_POST | MODE_POSTCHECKED;
+ (HasUserPerm(PERM_ALLBOARD) ||
+ is_BM_cache(currbid) ||
+ (bp->BM[0] <= ' ' && GROUPOP()))) {
+ currmode |= MODE_BOARD;
}
}
@@ -363,7 +364,18 @@ CheckModifyPerm(void)
if (currmode & MODE_POSTCHECKED)
{
- /* checked? let's check if perm reloaded */
+ // if board is different, rebuild cache
+ if (currbid != last_board_index) {
+#ifdef DEBUG
+ log_filef("log/reload_board_perm.log", LOG_CREAT,
+ "%-13s: reload board perm (curr=%d, last=%d)\n",
+ cuser.userid, currbid, last_board_index);
+#endif
+ currmode &= ~MODE_POSTCHECKED;
+ last_board_index = 0;
+ }
+
+ /* checked? let's check if perm reloaded or board changed*/
if (last_board_index < 1 || last_board_index > SHM->Bnumber)
{
/* invalid board index, refetch. */
@@ -544,7 +556,7 @@ readdoent(int num, fileheader_t * ent)
{
type = (type == ' ') ? '*' : '#';
}
- else if (ent->filemode & FILE_MARKED) // marks should be visible to everyone.
+ else if (ent->filemode & FILE_MARKED) // marks should be visible to everyone.
{
if(ent->filemode & FILE_SOLVED)
type = '!';