From 735c0af69f7d5f547d7f714fe47881b513b91fa8 Mon Sep 17 00:00:00 2001 From: piaip Date: Fri, 7 Dec 2007 06:04:47 +0000 Subject: - change hard-coded board names to defines git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3649 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- include/config.h | 8 ++++++++ mbbsd/admin.c | 6 +++--- mbbsd/bbs.c | 6 +++--- mbbsd/gamble.c | 4 ++-- mbbsd/menu.c | 3 +-- mbbsd/merge.c | 2 +- mbbsd/pmore.c | 10 ++++++---- mbbsd/read.c | 2 +- mbbsd/syspost.c | 4 ++-- mbbsd/user.c | 4 ++-- sample/pttbbs.conf | 8 ++++++-- 11 files changed, 35 insertions(+), 22 deletions(-) diff --git a/include/config.h b/include/config.h index 80a3e403..dbbfc722 100644 --- a/include/config.h +++ b/include/config.h @@ -48,6 +48,14 @@ #define GLOBAL_NOTE "Note" #endif +#ifndef GLOBAL_SECURITY +#define GLOBAL_SECURITY "Security" +#endif + +#ifndef GLOBAL_RECORD +#define GLOBAL_RECORD "Record" +#endif + #ifndef GLOBAL_FOREIGN #define GLOBAL_FOREIGN BBSMNAME "Foreign" #endif diff --git a/mbbsd/admin.c b/mbbsd/admin.c index 41b776f7..f1f0b1d5 100644 --- a/mbbsd/admin.c +++ b/mbbsd/admin.c @@ -530,7 +530,7 @@ m_mod_board(char *bname) memset(&bh, 0, sizeof(bh)); snprintf(bh.title, sizeof(bh.title), " %s 看板 %s 刪除", bname, cuser.userid); - post_msg("Security", bh.title, "請注意刪除的合法性", "[系統安全局]"); + post_msg(GLOBAL_SECURITY, bh.title, "請注意刪除的合法性", "[系統安全局]"); assert(0<=bid-1 && bid-1 %s\n" "板主: %s => %s\n", bh.brdname, newbh.brdname, bh.BM, newbh.BM); - post_msg("Security", buf, genbuf, "[系統安全局]"); + post_msg(GLOBAL_SECURITY, buf, genbuf, "[系統安全局]"); } } return 0; @@ -1531,7 +1531,7 @@ give_money(void) fclose(fp2); sprintf(buf, "%s 紅包機: %s", cuser.userid, reason); - post_file("Security", buf, "etc/givemoney.log", "[紅包機報告]"); + post_file(GLOBAL_SECURITY, buf, "etc/givemoney.log", "[紅包機報告]"); pressanykey(); return FULLUPDATE; } diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 4a051f35..af034a42 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -1306,7 +1306,7 @@ edit_post(int ent, fileheader_t * fhdr, const char *direct) int recordTouched = 0; assert(0<=currbid-1 && currbid-1brdname, "Security") == 0) + if (strcmp(bp->brdname, GLOBAL_SECURITY) == 0) return DONOTHING; // XXX 不知何時起, edit_post 已經不會有 + 號了... @@ -2682,7 +2682,7 @@ del_range(int ent, const fileheader_t *fhdr, const char *direct) /* 有三種情況會進這裡, 信件, 看板, 精華區 */ if( !(direct[0] == 'h') ){ /* 信件不用 check */ bp = getbcache(currbid); - if (strcmp(bp->brdname, "Security") == 0) + if (strcmp(bp->brdname, GLOBAL_SECURITY) == 0) return DONOTHING; } @@ -2754,7 +2754,7 @@ del_post(int ent, fileheader_t * fhdr, char *direct) else tusernum = searchuser(fhdr->owner, NULL); - if (strcmp(bp->brdname, "Security") == 0) + if (strcmp(bp->brdname, GLOBAL_SECURITY) == 0) return DONOTHING; if ((fhdr->filemode & FILE_BOTTOM) || (fhdr->filemode & FILE_MARKED) || (fhdr->filemode & FILE_DIGEST) || diff --git a/mbbsd/gamble.c b/mbbsd/gamble.c index 9896333d..6fd3ca68 100644 --- a/mbbsd/gamble.c +++ b/mbbsd/gamble.c @@ -365,13 +365,13 @@ openticket(int bid) snprintf(buf, sizeof(buf), "[公告] %s 賭盤取消", bh->brdname); post_file(bh->brdname, buf, outcome, "[賭神]"); post_file("Record", buf + 7, outcome, "[馬路探子]"); - post_file("Security", buf + 7, outcome, "[馬路探子]"); + post_file(GLOBAL_SECURITY, buf + 7, outcome, "[馬路探子]"); setbfile(buf, bh->brdname, FN_TICKET_RECORD); unlink(buf); setbfile(buf, bh->brdname, FN_TICKET_USER); - post_file("Security", bh->brdname, buf, "[下注紀錄]"); + post_file(GLOBAL_SECURITY, bh->brdname, buf, "[下注紀錄]"); unlink(buf); setbfile(buf, bh->brdname, FN_TICKET_LOCK); diff --git a/mbbsd/menu.c b/mbbsd/menu.c index 852c707b..4a1cdd20 100644 --- a/mbbsd/menu.c +++ b/mbbsd/menu.c @@ -11,9 +11,8 @@ extern char board_hidden_status; static const char *title_tail_msgs[] = { "看板", - "選擇", + "系列", "文摘", - // "系列", // deprecated? }; static const char *title_tail_attrs[] = { ANSI_COLOR(37), diff --git a/mbbsd/merge.c b/mbbsd/merge.c index b3b61b84..a3c4d20b 100644 --- a/mbbsd/merge.c +++ b/mbbsd/merge.c @@ -191,7 +191,7 @@ m_sob(void) strcat(msg, "匯入好友名單\n"); } sprintf(buf, "帳號匯入報告 %s -> %s ", userid, cuser.userid); - post_msg("Security", buf, msg, "[系統安全局]"); + post_msg(GLOBAL_SECURITY, buf, msg, "[系統安全局]"); vmsg("恭喜您完成帳號變身.."); return 0; diff --git a/mbbsd/pmore.c b/mbbsd/pmore.c index 2efe2afb..81d47104 100644 --- a/mbbsd/pmore.c +++ b/mbbsd/pmore.c @@ -80,7 +80,7 @@ "[搜尋]關鍵字:" #define PMORE_MSG_MOVIE_DETECTED \ - " ☆ 這份文件是可播放的文字動畫,要開始播放嗎? [Y/n]" + " ★ 這份文件是可播放的文字動畫,要開始播放嗎? [Y/n]" #define PMORE_MSG_MOVIE_PLAYOLD_GETTIME \ "這可能是傳統動畫檔, 若要直接播放請輸入速度(秒): " #define PMORE_MSG_MOVIE_PLAYOLD_AS24L \ @@ -2281,9 +2281,11 @@ pmore(char *fpath, int promptend) // admin edit any files other than ve help file // and posts in Security board if ( HasUserPerm(PERM_SYSOP) && - (strcmp(fpath, "etc/ve.hlp") != 0) && - (strcmp(currboard, "Security") != 0) - ) +#ifdef GLOBAL_SECURITY + strcmp(currboard, GLOBAL_SECURITY) != 0 && +#endif // GLOBAL_SECURITY + strcmp(fpath, "etc/ve.hlp") != 0 && + 1) { #ifdef PMORE_LOG_SYSOP_EDIT time4_t t = time4(NULL); diff --git a/mbbsd/read.c b/mbbsd/read.c index 784db7c2..e30c60c2 100644 --- a/mbbsd/read.c +++ b/mbbsd/read.c @@ -174,7 +174,7 @@ TagPruner(int bid) assert(bid >= 0); /* bid == 0 means in mailbox */ if (bid){ bp = getbcache(bid); - if (strcmp(bp->brdname, "Security") == 0) + if (strcmp(bp->brdname, GLOBAL_SECURITY) == 0) return DONOTHING; } if (TagNum && ((currstat != READING) || (currmode & MODE_BOARD))) { diff --git a/mbbsd/syspost.c b/mbbsd/syspost.c index 029c23a7..92aec28a 100644 --- a/mbbsd/syspost.c +++ b/mbbsd/syspost.c @@ -62,12 +62,12 @@ post_change_perm(int oldperm, int newperm, const char *sysopid, const char *user char genbuf[200], reason[30]; int i, flag = 0; - setbpath(genbuf, "Security"); + setbpath(genbuf, GLOBAL_SECURITY); stampfile(genbuf, &fhdr); if (!(fp = fopen(genbuf, "w"))) return; - fprintf(fp, "作者: [系統安全局] 看板: Security\n" + fprintf(fp, "作者: [系統安全局] 看板: " GLOBAL_SECURITY "\n" "標題: [公安報告] 站長修改權限報告\n" "時間: %s\n", ctime4(&now)); for (i = 0; i < NUMPERMS; i++) { diff --git a/mbbsd/user.c b/mbbsd/user.c index bb911fc6..0e87d17e 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -965,7 +965,7 @@ uinfo_query(userec_t *u, int adminmode, int unum) u->userid, witness[0], witness[1], witness[2] ); fclose(fp); - post_file("Security", title, "etc/updatepwd.log", "[系統安全局]"); + post_file(GLOBAL_SECURITY, title, "etc/updatepwd.log", "[系統安全局]"); mail_id(u->userid, title, "etc/updatepwd.log", cuser.userid); for(i=0; i<3; i++) { @@ -1088,7 +1088,7 @@ uinfo_query(userec_t *u, int adminmode, int unum) snprintf(title, sizeof(title), "[公安報告] 站長%s修改%s錢報告", cuser.userid, x.userid); - post_msg("Security", title, msg, "[系統安全局]"); + post_msg(GLOBAL_SECURITY, title, msg, "[系統安全局]"); setumoney(unum, x.money); } passwd_update(unum, &x); diff --git a/sample/pttbbs.conf b/sample/pttbbs.conf index 2e6031d4..d7890203 100644 --- a/sample/pttbbs.conf +++ b/sample/pttbbs.conf @@ -32,6 +32,12 @@ #define BBSGID 99 /* *** 以下為預設板名 *** */ +/* 安全紀錄 */ +#define GLOBAL_SECURITY "Security" +/* 動態看板的家 */ +#define GLOBAL_NOTE "Note" +/* 紀錄 */ +#define GLOBAL_RECORD "Record" /* 發生錯誤時建議的回報板名為此板 */ #define GLOBAL_BUGREPORT BBSMNAME "Bug" @@ -39,8 +45,6 @@ #define GLOBAL_LAW BBSMNAME "Law" /* 新手板 */ #define GLOBAL_NEWBIE BBSMNAME "NewHand" -/* 動態看板的家 */ -#define GLOBAL_NOTE "Note" /* 外國板 */ #define GLOBAL_FOREIGN BBSMNAME "Foreign" -- cgit v1.2.3