From 57dadd6252931a315c54ab7f452521dd1927afaa Mon Sep 17 00:00:00 2001 From: wens Date: Sun, 1 Oct 2006 14:10:36 +0000 Subject: request reason for police actions git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3436 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/bbs.c | 10 +++++++--- mbbsd/syspost.c | 6 +++--- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'mbbsd') 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-1brdname, 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, "[系統]"); } -- cgit v1.2.3