From 31077a7c833e60121e843456d52fbbb5bda88ddb Mon Sep 17 00:00:00 2001 From: piaip Date: Mon, 25 Feb 2008 16:35:38 +0000 Subject: - 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 --- mbbsd/board.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'mbbsd/board.c') 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); + } } { -- cgit v1.2.3