diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2010-07-14 19:32:29 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2010-07-14 19:32:29 +0800 |
commit | 57ef695f77b2292fd296c5e01be8f6dab73a67db (patch) | |
tree | 8bf2564cbf6073cc2b2b119979286e265d7b0e92 | |
parent | 522f8447e66d63c71a5d81e706e8b7f7d6f8413e (diff) | |
download | pttbbs-57ef695f77b2292fd296c5e01be8f6dab73a67db.tar pttbbs-57ef695f77b2292fd296c5e01be8f6dab73a67db.tar.gz pttbbs-57ef695f77b2292fd296c5e01be8f6dab73a67db.tar.bz2 pttbbs-57ef695f77b2292fd296c5e01be8f6dab73a67db.tar.lz pttbbs-57ef695f77b2292fd296c5e01be8f6dab73a67db.tar.xz pttbbs-57ef695f77b2292fd296c5e01be8f6dab73a67db.tar.zst pttbbs-57ef695f77b2292fd296c5e01be8f6dab73a67db.zip |
* after checking with toplazyBM.c, I found the 'BM_is_expired' design is totally unnecessary.
We should focus on fixing that.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5090 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/include/proto.h | 1 | ||||
-rw-r--r-- | pttbbs/include/pttstruct.h | 3 | ||||
-rw-r--r-- | pttbbs/mbbsd/admin.c | 2 | ||||
-rw-r--r-- | pttbbs/mbbsd/board.c | 7 | ||||
-rw-r--r-- | pttbbs/mbbsd/cache.c | 15 | ||||
-rw-r--r-- | pttbbs/mbbsd/user.c | 3 |
6 files changed, 5 insertions, 26 deletions
diff --git a/pttbbs/include/proto.h b/pttbbs/include/proto.h index f4a4702f..3315a3bc 100644 --- a/pttbbs/include/proto.h +++ b/pttbbs/include/proto.h @@ -118,7 +118,6 @@ char*getuserid(int num); int getuser(const char *userid, userec_t *xuser); int searchnewuser(int mode); int count_logins(int uid, int show); -int is_BM_expired(time4_t BMexpire, time4_t user_firstlogin); int is_BM_cache(int); int apply_boards(int (*func)(boardheader_t *)); int haspostperm(const char *bname); diff --git a/pttbbs/include/pttstruct.h b/pttbbs/include/pttstruct.h index 9a04ea10..77a32abf 100644 --- a/pttbbs/include/pttstruct.h +++ b/pttbbs/include/pttstruct.h @@ -200,8 +200,7 @@ typedef struct boardheader_t { /* 256 bytes */ uint8_t post_limit_badpost; /* 發表文章 : 劣文上限 */ char pad3[3]; time4_t SRexpire; /* SR Records expire time */ - time4_t BMexpire; /* 最後設定板主的時間 */ - char pad4[36]; + char pad4[40]; } PACKSTRUCT boardheader_t; // TODO BRD 快爆了,怎麼辦? 準備從 pad3 偷一個來當 attr2 吧... diff --git a/pttbbs/mbbsd/admin.c b/pttbbs/mbbsd/admin.c index b7d58b4f..854477b6 100644 --- a/pttbbs/mbbsd/admin.c +++ b/pttbbs/mbbsd/admin.c @@ -646,7 +646,6 @@ m_mod_board(char *bname) bh.BM)) { trim(genbuf); strlcpy(newbh.BM, genbuf, sizeof(newbh.BM)); - newbh.BMexpire = now; } #ifdef CHESSCOUNTRY if (HasUserPerm(PERM_SYSOP)) { @@ -995,7 +994,6 @@ m_newbrd(int whatclass, int recover) newboard.level = 0; getdata(11, 0, "板主名單:", newboard.BM, sizeof(newboard.BM), DOECHO); - newboard.BMexpire = now; #ifdef CHESSCOUNTRY if (getdata_str(12, 0, "設定棋國 (0)無 (1)五子棋 (2)象棋 (3)圍棋", ans, sizeof(ans), LCECHO, "0")){ diff --git a/pttbbs/mbbsd/board.c b/pttbbs/mbbsd/board.c index 1eb3b293..eb7828bc 100644 --- a/pttbbs/mbbsd/board.c +++ b/pttbbs/mbbsd/board.c @@ -1382,15 +1382,14 @@ show_brdlist(int head, int clsflag, int newflag) } static void -set_menu_BM(char *BM, time4_t expire) +set_menu_BM(char *BM) { int is_bm = 0; if (HasUserPerm(PERM_NOCITIZEN)) return; if (HasUserPerm(PERM_ALLBOARD)) { is_bm = 1; - } else if (!is_BM_expired(expire, cuser.firstlogin) && is_uBM(BM, cuser.userid)) { - // XXX 小組長是否也該使用 is_BM_expired 呢 + } else if (is_uBM(BM, cuser.userid)) { is_bm = 1; } @@ -1773,7 +1772,7 @@ choose_board(int newflag) class_bid = -1; /* 熱門群組用 */ if (!GROUPOP()) /* 如果還沒有小組長權限 */ - set_menu_BM(B_BH(ptr)->BM, B_BH(ptr)->BMexpire); + set_menu_BM(B_BH(ptr)->BM); if (now < B_BH(ptr)->bupdate) { int mr = 0; diff --git a/pttbbs/mbbsd/cache.c b/pttbbs/mbbsd/cache.c index bee7dee0..f4b80fe4 100644 --- a/pttbbs/mbbsd/cache.c +++ b/pttbbs/mbbsd/cache.c @@ -141,23 +141,10 @@ apply_boards(int (*func) (boardheader_t *)) } int -is_BM_expired(time4_t BMexpire, time4_t user_firstlogin) -{ - // XXX 為了解決有人挑過期的帳號註冊以取得 BM 權 - // 這是很笨很笨而且相關 bug 可能一堆的 workaround, - // 不過在全面改寫前看來也只有這樣改最快 (有比沒有好) - if (BMexpire) - return user_firstlogin > BMexpire; - // for legacy boards, allow BMexpire = 0 as 'skip'. - return 1; -} - -int is_BM_cache(int bid) /* bid starts from 1 */ { assert(0<=bid-1 && bid-1<MAX_BOARD); int *pbm = SHM->BMcache[bid-1]; - boardheader_t *bp = getbcache(bid); // XXX potential issue: (thanks for mtdas@ptt) // buildBMcache use -1 as "none". @@ -170,8 +157,6 @@ is_BM_cache(int bid) /* bid starts from 1 */ // reject user who haven't complete registration. if (!HasUserPerm(PERM_LOGINOK)) return 0; - if (is_BM_expired(bp->BMexpire, cuser.firstlogin)) - return 0; // XXX hard coded MAX_BMs=4 if( currutmp->uid == pbm[0] || currutmp->uid == pbm[1] || diff --git a/pttbbs/mbbsd/user.c b/pttbbs/mbbsd/user.c index 290c3edb..a8f98168 100644 --- a/pttbbs/mbbsd/user.c +++ b/pttbbs/mbbsd/user.c @@ -217,8 +217,7 @@ user_display(const userec_t * u, int adminmode) outs("\t擔任板主: "); for (i = 0, bhdr = bcache; i < numboards; i++, bhdr++) { - if ( is_uBM(bhdr->BM, u->userid) && - !is_BM_expired(bhdr->BMexpire, u->firstlogin)) { + if ( is_uBM(bhdr->BM, u->userid)) { outs(bhdr->brdname); outc(' '); } |