diff options
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/bbs.c | 10 | ||||
-rw-r--r-- | mbbsd/syspost.c | 6 |
2 files changed, 10 insertions, 6 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 11a40e00..2452e06e 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -2672,7 +2672,7 @@ static int lock_post(int ent, fileheader_t * fhdr, const char *direct) { char fn1[MAXPATHLEN]; - char genbuf[256]; + char genbuf[256] = {'\0'}; int i; if (!(currmode & MODE_BOARD) && !HasUserPerm(PERM_SYSOP | PERM_POLICE)) @@ -2682,6 +2682,8 @@ lock_post(int ent, fileheader_t * fhdr, const char *direct) if (!HasUserPerm(PERM_SYSOP | PERM_POLICE)) return DONOTHING; + getdata(b_lines - 1, 0, "請輸入鎖定理由:", genbuf, 50, DOECHO); + if (getans("要將文章鎖定嗎(y/N)?") != 'y') return FULLUPDATE; setbfile(fn1, currboard, fhdr->filename); @@ -2694,7 +2696,7 @@ lock_post(int ent, fileheader_t * fhdr, const char *direct) setbfile(fn1, currboard, fhdr->filename); } substitute_ref_record(direct, fhdr, ent); - post_policelog(currboard, fhdr->title, "鎖文", fhdr->filename[0] == 'L' ? 1 : 0); + post_policelog(currboard, fhdr->title, "鎖文", genbuf, fhdr->filename[0] == 'L' ? 1 : 0); if (fhdr->filename[0] == 'L') { fhdr->filename[0] = 'M'; do_crosspost("PoliceLog", fhdr, fn1, 0); @@ -3451,6 +3453,7 @@ int check_cooldown(boardheader_t *bp) static int change_cooldown(void) { + char genbuf[256] = {'\0'}; boardheader_t *bp = getbcache(currbid); if (!(HasUserPerm(PERM_SYSOP | PERM_POLICE) || @@ -3463,6 +3466,7 @@ change_cooldown(void) bp->brdattr &= ~BRD_COOLDOWN; outs("大家都可以 post 文章了。\n"); } else { + getdata(b_lines - 1, 0, "請輸入冷靜理由:", genbuf, 50, DOECHO); if (getans("要限制 post 頻率, 降溫嗎(y/N)?") != 'y') return FULLUPDATE; bp->brdattr |= BRD_COOLDOWN; @@ -3470,7 +3474,7 @@ change_cooldown(void) } assert(0<=currbid-1 && currbid-1<MAX_BOARD); substitute_record(fn_board, bp, sizeof(boardheader_t), currbid); - post_policelog(bp->brdname, NULL, "冷靜", bp->brdattr & BRD_COOLDOWN); + post_policelog(bp->brdname, NULL, "冷靜", genbuf, bp->brdattr & BRD_COOLDOWN); pressanykey(); return FULLUPDATE; } diff --git a/mbbsd/syspost.c b/mbbsd/syspost.c index f3dde5de..639d4fda 100644 --- a/mbbsd/syspost.c +++ b/mbbsd/syspost.c @@ -130,15 +130,15 @@ post_newboard(const char *bgroup, const char *bname, const char *bms) } void -post_policelog(const char *bname, const char *atitle, const char *action, const int toggle) +post_policelog(const char *bname, const char *atitle, const char *action, const char *reason, const int toggle) { char genbuf[256], title[TTLEN+1]; snprintf(title, sizeof(title), "[%s][%s] %s by %s", action, toggle ? "開啟" : "關閉", bname, cuser.userid); snprintf(genbuf, sizeof(genbuf), - "%s (%s) %s %s 看板 %s 功\能\n%s%s\n", + "%s (%s) %s %s 看板 %s 功\能\n原因 : %s\n%s%s\n", cuser.userid, fromhost, toggle ? "開啟" : "關閉", bname, action, - atitle ? "文章標題 : " : "", atitle ? atitle : ""); + reason, atitle ? "文章標題 : " : "", atitle ? atitle : ""); post_msg("PoliceLog", title, genbuf, "[系統]"); } |