diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2013-08-31 15:36:28 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2013-08-31 15:36:28 +0800 |
commit | 445220e44c4b584961644a24149ac3c124bf91f6 (patch) | |
tree | bd1a7baf5530f24cf1d39cd174b6c8b192609842 | |
parent | 2ef3f1c65e1d21d12cc1932e78c85bc97e7b10db (diff) | |
download | pttbbs-445220e44c4b584961644a24149ac3c124bf91f6.tar pttbbs-445220e44c4b584961644a24149ac3c124bf91f6.tar.gz pttbbs-445220e44c4b584961644a24149ac3c124bf91f6.tar.bz2 pttbbs-445220e44c4b584961644a24149ac3c124bf91f6.tar.lz pttbbs-445220e44c4b584961644a24149ac3c124bf91f6.tar.xz pttbbs-445220e44c4b584961644a24149ac3c124bf91f6.tar.zst pttbbs-445220e44c4b584961644a24149ac3c124bf91f6.zip |
Log delete reason and bad post readon.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5861 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/mbbsd/assess.c | 22 | ||||
-rw-r--r-- | pttbbs/mbbsd/bbs.c | 3 |
2 files changed, 15 insertions, 10 deletions
diff --git a/pttbbs/mbbsd/assess.c b/pttbbs/mbbsd/assess.c index caa84b3d..36cdc167 100644 --- a/pttbbs/mbbsd/assess.c +++ b/pttbbs/mbbsd/assess.c @@ -45,6 +45,7 @@ int assign_badpost(const char *userid, fileheader_t *fhdr, const char *newpath, const char *comment) { char genbuf[STRLEN]; + char reason[STRLEN]; char rptpath[PATHLEN]; int i, tusernum = searchuser(userid, NULL); @@ -69,14 +70,10 @@ int assign_badpost(const char *userid, fileheader_t *fhdr, break; } while (1); - if (i < (int)DIM(badpost_reason)) - sprintf(genbuf,"劣%s文退回(%s)", comment ? "推" : "", badpost_reason[i]); - else if(i==DIM(badpost_reason)) - { - char *s = genbuf; - strcpy(genbuf, comment ? "劣推文退回(" : "劣文退回("); - s += strlen(genbuf); - while (!getdata_buf(b_lines, 0, "請輸入原因", s, 50, DOECHO)) { + if (i < (int)DIM(badpost_reason)) { + snprintf(reason, sizeof(reason), "%s", badpost_reason[i]); + } else if (i == DIM(badpost_reason)) { + while (!getdata(b_lines, 0, "請輸入原因", reason, 50, DOECHO)) { // 對於 comment 目前可以重來,但非comment 文直接刪掉所以沒法 cancel if (comment) { vmsg("取消設定劣文。"); @@ -85,10 +82,11 @@ int assign_badpost(const char *userid, fileheader_t *fhdr, bell(); continue; } - strcat(genbuf,")"); } - assert(i >= 0 && i <= (int)DIM(badpost_reason)); + + sprintf(genbuf,"劣%s文退回(%s)", comment ? "推" : "", reason); + if (fhdr) strncat(genbuf, fhdr->title, 64-strlen(genbuf)); #ifdef USE_COOLDOWN @@ -111,6 +109,10 @@ int assign_badpost(const char *userid, fileheader_t *fhdr, passwd_sync_update(tusernum, &xuser); } + if (!comment) { + log_filef(newpath, LOG_CREAT, "※ BadPost Reason: %s\n", reason); + } + #ifdef BAD_POST_RECORD // we also change rptpath because such record contains more information { diff --git a/pttbbs/mbbsd/bbs.c b/pttbbs/mbbsd/bbs.c index c03ab0b1..7cea5953 100644 --- a/pttbbs/mbbsd/bbs.c +++ b/pttbbs/mbbsd/bbs.c @@ -3552,6 +3552,9 @@ del_post(int ent, fileheader_t * fhdr, char *direct) } } #endif // ASSESS + if (*newpath && *reason) { + log_filef(newpath, LOG_CREAT, "※ Delete Reason: %s\n", reason); + } if (del_fee <= 0) { |