diff options
author | wens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2006-10-01 12:20:57 +0800 |
---|---|---|
committer | wens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2006-10-01 12:20:57 +0800 |
commit | 37486bf44d579146727c168f7e793c37b6eef84d (patch) | |
tree | 3edc749f0b3dce5dd8ad7c187451013fed6612a5 | |
parent | f29581d209621a138949677a715c9402ca5e5f14 (diff) | |
download | pttbbs-37486bf44d579146727c168f7e793c37b6eef84d.tar pttbbs-37486bf44d579146727c168f7e793c37b6eef84d.tar.gz pttbbs-37486bf44d579146727c168f7e793c37b6eef84d.tar.bz2 pttbbs-37486bf44d579146727c168f7e793c37b6eef84d.tar.lz pttbbs-37486bf44d579146727c168f7e793c37b6eef84d.tar.xz pttbbs-37486bf44d579146727c168f7e793c37b6eef84d.tar.zst pttbbs-37486bf44d579146727c168f7e793c37b6eef84d.zip |
article lock sends copy to BM and PoliceLog board
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3435 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/bbs.c | 15 | ||||
-rw-r--r-- | mbbsd/syspost.c | 4 |
2 files changed, 12 insertions, 7 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 32a8634e..11a40e00 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -2672,7 +2672,8 @@ static int lock_post(int ent, fileheader_t * fhdr, const char *direct) { char fn1[MAXPATHLEN]; - struct tm *ptime = localtime4(&now); + char genbuf[256]; + int i; if (!(currmode & MODE_BOARD) && !HasUserPerm(PERM_SYSOP | PERM_POLICE)) return DONOTHING; @@ -2685,19 +2686,23 @@ lock_post(int ent, fileheader_t * fhdr, const char *direct) return FULLUPDATE; setbfile(fn1, currboard, fhdr->filename); fhdr->filename[0] = 'L'; - log_file(fn1, LOG_CREAT | LOG_VF, "\n※ Locked on: %d/%d", - ptime->tm_mon + 1, ptime->tm_mday); } else if (fhdr->filename[0]=='L') { if (getans("要將文章鎖定解除嗎(y/N)?") != 'y') return FULLUPDATE; fhdr->filename[0] = 'M'; setbfile(fn1, currboard, fhdr->filename); - log_file(fn1, LOG_CREAT | LOG_VF, "\n※ Unlocked by: %d/%d", - ptime->tm_mon + 1, ptime->tm_mday); } substitute_ref_record(direct, fhdr, ent); post_policelog(currboard, fhdr->title, "鎖文", fhdr->filename[0] == 'L' ? 1 : 0); + if (fhdr->filename[0] == 'L') { + fhdr->filename[0] = 'M'; + do_crosspost("PoliceLog", fhdr, fn1, 0); + fhdr->filename[0] = 'L'; + snprintf(genbuf, sizeof(genbuf), "%s 板遭鎖定文章 - %s", currboard, fhdr->title); + for (i = 0; i < MAX_BMs && SHM->BMcache[currbid-1][i] != -1; i++) + mail_id(SHM->userid[SHM->BMcache[currbid-1][i] - 1], genbuf, fn1, "[系統]"); + } return FULLUPDATE; } diff --git a/mbbsd/syspost.c b/mbbsd/syspost.c index 0bd38060..f3dde5de 100644 --- a/mbbsd/syspost.c +++ b/mbbsd/syspost.c @@ -134,11 +134,11 @@ post_policelog(const char *bname, const char *atitle, const char *action, const { char genbuf[256], title[TTLEN+1]; - snprintf(title, sizeof(title), "[%s] %s by %s", action, bname, cuser.userid); + 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", cuser.userid, fromhost, toggle ? "開啟" : "關閉", bname, action, - atitle ? "文章標題" : "", atitle ? atitle : ""); + atitle ? "文章標題 : " : "", atitle ? atitle : ""); post_msg("PoliceLog", title, genbuf, "[系統]"); } |