diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-02-26 00:35:38 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-02-26 00:35:38 +0800 |
commit | 31077a7c833e60121e843456d52fbbb5bda88ddb (patch) | |
tree | 31d04e86bc068409199810743c221a74636f8302 /mbbsd/board.c | |
parent | 88b4d69ded90aac6895d9619d1a786b3f4c2a8ad (diff) | |
download | pttbbs-31077a7c833e60121e843456d52fbbb5bda88ddb.tar pttbbs-31077a7c833e60121e843456d52fbbb5bda88ddb.tar.gz pttbbs-31077a7c833e60121e843456d52fbbb5bda88ddb.tar.bz2 pttbbs-31077a7c833e60121e843456d52fbbb5bda88ddb.tar.lz pttbbs-31077a7c833e60121e843456d52fbbb5bda88ddb.tar.xz pttbbs-31077a7c833e60121e843456d52fbbb5bda88ddb.tar.zst pttbbs-31077a7c833e60121e843456d52fbbb5bda88ddb.zip |
- b_config: more detail hints on user post permission checking
- bcache code refine
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3948 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/board.c')
-rw-r--r-- | mbbsd/board.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/mbbsd/board.c b/mbbsd/board.c index 18ae88e7..c87a968d 100644 --- a/mbbsd/board.c +++ b/mbbsd/board.c @@ -397,7 +397,12 @@ b_config(void) ipostres = b_lines - LNPOSTRES; move_ansi(ipostres++, COLPOSTRES-2); - outs(ANSI_COLOR(1;32) "發文限制" ANSI_RESET); + + if (CheckPostPerm() && CheckPostRestriction(currbid)) + outs(ANSI_COLOR(1;32)); + else + outs(ANSI_COLOR(1;31)); + outs("發文限制" ANSI_RESET); #define POSTRESTRICTION(msg,utag) \ prints(msg, attr ? ANSI_COLOR(1) : "", i, attr ? ANSI_RESET : "") @@ -431,17 +436,15 @@ b_config(void) prints("劣文篇數 %d 篇以下", i); if (attr) outs(ANSI_RESET); - if (bp->brdattr & BRD_POSTMASK) { - // see haspostperm() - unsigned int permok = bp->level & ~PERM_POST; - permok = permok ? HasUserPerm(permok) : 1; - move_ansi(ipostres++, COLPOSTRES); - prints("使用者等級: %s限定(%s要求)%s\n", - permok ? "" : ANSI_COLOR(31), - permok ? "已達" : "未達", - permok ? "" : ANSI_RESET - ); + const char *msg = postperm_msg(bp->brdname); + if (msg) // some reasons + { + move_ansi(ipostres++, COLPOSTRES); + outs(ANSI_COLOR(1;31)); + outs(msg); + outs(ANSI_RESET); + } } { |