summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-01-07 23:00:17 +0800
committerscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-01-07 23:00:17 +0800
commita9e9d8e71053bf943eff2084b21c18a62d94f89c (patch)
treef0c8562b44ad6c6d78384a01501c6b06bfb85f4e /mbbsd
parent2409b9e7fc94c497502e83ff07de7142888a3009 (diff)
downloadpttbbs-a9e9d8e71053bf943eff2084b21c18a62d94f89c.tar
pttbbs-a9e9d8e71053bf943eff2084b21c18a62d94f89c.tar.gz
pttbbs-a9e9d8e71053bf943eff2084b21c18a62d94f89c.tar.bz2
pttbbs-a9e9d8e71053bf943eff2084b21c18a62d94f89c.tar.lz
pttbbs-a9e9d8e71053bf943eff2084b21c18a62d94f89c.tar.xz
pttbbs-a9e9d8e71053bf943eff2084b21c18a62d94f89c.tar.zst
pttbbs-a9e9d8e71053bf943eff2084b21c18a62d94f89c.zip
Make BM be able to set whether everyone can post
or only board friend can. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2389 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/bbs.c28
-rw-r--r--mbbsd/cache.c3
-rw-r--r--mbbsd/var.c4
3 files changed, 32 insertions, 3 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 5892505c..d197b1b1 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -2480,6 +2480,32 @@ change_localsave(int ent, fileheader_t * fhdr, char *direct)
return FULLUPDATE;
}
+/**
+ * 設定只有板友可 post 或全部人都可 post
+ */
+static int
+change_restrictedpost(int ent, fileheader_t * fhdr, char *direct){
+ boardheader_t *bp;
+ if (!((currmode & MODE_BOARD) || HAS_PERM(PERM_SYSOP)))
+ return DONOTHING;
+
+ bp = getbcache(currbid);
+ if (bp->brdattr & BRD_RESTRICTEDPOST) {
+ if (getans("目前只有板友可 post, 要開放嗎(y/N)?") != 'y')
+ return FULLUPDATE;
+ bp->brdattr &= ~BRD_RESTRICTEDPOST;
+ outs("大家都可以 post 文章了。\n");
+ } else {
+ if (getans("目前全部人都可 post, 要限制為只有板友可 post 嗎(y/N)?") != 'y')
+ return FULLUPDATE;
+ bp->brdattr |= BRD_RESTRICTEDPOST;
+ outs("只剩板友可以 post 了。\n");
+ }
+ substitute_record(fn_board, bp, sizeof(boardheader_t), currbid);
+ pressanykey();
+ return FULLUPDATE;
+}
+
/* ----------------------------------------------------- */
/* 看板功能表 */
/* ----------------------------------------------------- */
@@ -2489,7 +2515,7 @@ const onekey_t read_comms[] = {
NULL, // Ctrl('B')
NULL, // Ctrl('C')
NULL, // Ctrl('D')
- NULL, // Ctrl('E')
+ change_restrictedpost, // Ctrl('E')
NULL, // Ctrl('F')
#ifdef NO_GAMBLE
NULL, // Ctrl('G')
diff --git a/mbbsd/cache.c b/mbbsd/cache.c
index 5ac60128..1823b370 100644
--- a/mbbsd/cache.c
+++ b/mbbsd/cache.c
@@ -739,6 +739,9 @@ haspostperm(char *bname)
/* 秘密看板特別處理 */
if (bcache[i - 1].brdattr & BRD_HIDE)
return 1;
+ else if (bcache[i - 1].brdattr & BRD_RESTRICTEDPOST &&
+ hbflcheck(i, usernum))
+ return 0;
i = bcache[i - 1].level;
diff --git a/mbbsd/var.c b/mbbsd/var.c
index 6f9079e7..65f38761 100644
--- a/mbbsd/var.c
+++ b/mbbsd/var.c
@@ -59,8 +59,8 @@ char * const str_permboard[] = {
"板主設定列入記錄", /* BRD_BMCOUNT */
"連結看板", /* BRD_SYMBOLIC */
"不可噓", /* BRD_NOBOO */
- "沒想到",
- "沒想到",
+ "預設 Local Save", /* BRD_LOCALSAVE */
+ "限板友發文", /* BRD_RESTRICTEDPOST */
"沒想到",
"沒想到",
"沒想到",