summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/modes.h9
-rw-r--r--mbbsd/bbs.c3
-rw-r--r--mbbsd/more.c31
-rw-r--r--mbbsd/pmore.c12
4 files changed, 35 insertions, 20 deletions
diff --git a/include/modes.h b/include/modes.h
index 6984468c..c56e6548 100644
--- a/include/modes.h
+++ b/include/modes.h
@@ -18,10 +18,11 @@
#define HEADERS_RELOAD 13
// values returned by pager
-#define RET_DOREPLY (999)
-#define RET_DORECOMMEND (998)
-#define RET_DOQUERYINFO (997)
-#define RET_DOSYSOPEDIT (996)
+#define RET_DOREPLY (999)
+#define RET_DORECOMMEND (998)
+#define RET_DOQUERYINFO (997)
+#define RET_DOSYSOPEDIT (996)
+#define RET_DOCHESSREPLAY (995)
/* user 操作狀態與模式 */
#define IDLE 0
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index f8b500dc..90cd07c6 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -1374,14 +1374,13 @@ edit_post(int ent, fileheader_t * fhdr, const char *direct)
if (strcmp(fhdr->owner, cuser.userid) != EQUSTR)
{
- time4_t t = time4(NULL);
if (!HasUserPerm(PERM_SYSOP))
return DONOTHING;
// admin edit!
log_filef("log/security", LOG_CREAT,
"%d %24.24s %d %s admin edit (board) file=%s\n",
- t, ctime4(&t), getpid(), cuser.userid, fpath);
+ (int)now, ctime4(&now), getpid(), cuser.userid, fpath);
}
# ifdef GLOBAL_BBSMOVIE
diff --git a/mbbsd/more.c b/mbbsd/more.c
index 40333264..252e9d02 100644
--- a/mbbsd/more.c
+++ b/mbbsd/more.c
@@ -6,22 +6,31 @@ int more(char *fpath, int promptend)
{
int r = pmore(fpath, promptend);
- if (r == RET_DOSYSOPEDIT)
+ switch(r)
{
- if (HasUserPerm(PERM_SYSOP) &&
+
+ case RET_DOSYSOPEDIT:
+ r = FULLUPDATE;
+
+ if (!HasUserPerm(PERM_SYSOP) ||
+ strcmp(fpath, "etc/ve.hlp") == 0)
+ break;
+
#ifdef GLOBAL_SECURITY
- strcmp(currboard, GLOBAL_SECURITY) != 0 &&
+ if (strcmp(currboard, GLOBAL_SECURITY) == 0)
+ break;
#endif // GLOBAL_SECURITY
- strcmp(fpath, "etc/ve.hlp") != 0 &&
- 1)
- {
- time4_t t = time4(NULL);
+
log_filef("log/security", LOG_CREAT,
- "%d %24.24s %d %s admin edit file=%s\n",
- t, ctime4(&t), getpid(), cuser.userid, fpath);
+ "%u %24.24s %d %s admin edit file=%s\n",
+ (int)now, ctime4(&now), getpid(), cuser.userid, fpath);
vedit(fpath, NA, NULL);
- }
- r = FULLUPDATE;
+ break;
+
+ case RET_DOCHESSREPLAY:
+ r = FULLUPDATE;
+ ChessReplayGame(fpath);
+ break;
}
return r;
diff --git a/mbbsd/pmore.c b/mbbsd/pmore.c
index 7cab8cd0..d82c721f 100644
--- a/mbbsd/pmore.c
+++ b/mbbsd/pmore.c
@@ -1675,7 +1675,11 @@ static const char * const pmore_help[] = {
// the line below is already aligned, because of the backslash.
"(o)/(\\) 選項設定/色彩顯示模式",
+
+#if defined (PMORE_USE_ASCII_MOVIE) || defined(RET_DOCHESSREPLAY)
"(p)/(z) 播放動畫/棋局打譜",
+#endif // defined(PMORE_USE_ASCII_MOVIE) || defined(RET_DOCHESSREPLAY)
+
"(Ctrl-T) 存入暫存檔",
"(q/←) (h/H/?/F1) 結束/本說明畫面",
#ifdef DEBUG
@@ -2097,6 +2101,11 @@ pmore(char *fpath, int promptend)
flExit = 1, retval = RET_DOSYSOPEDIT;
break;
#endif
+#ifdef RET_DOCHESSREPLAY
+ case 'z':
+ flExit = 1, retval = RET_DOCHESSREPLAY;
+ break;
+#endif
/* ------------------ EXITING KEYS ------------------ */
case 'A':
@@ -2422,9 +2431,6 @@ pmore(char *fpath, int promptend)
break;
#endif
- case 'z':
- ChessReplayGame(fpath);
- break;
}
/* DO NOT DO ANYTHING HERE. NOT SAFE RIGHT NOW. */
}