summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
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 */
"沒想到",
"沒想到",
"沒想到",