summaryrefslogtreecommitdiffstats
path: root/mbbsd/more.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-01-03 21:09:17 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-01-03 21:09:17 +0800
commit8f9dc9a65dc9b09b96c81b86156a067d1e1ea6ba (patch)
tree7ce60f78181831648ececc658165b150c04cf7fb /mbbsd/more.c
parent74ceac39794d1f3744a4c14e0e48d787d538b5d0 (diff)
downloadpttbbs-8f9dc9a65dc9b09b96c81b86156a067d1e1ea6ba.tar
pttbbs-8f9dc9a65dc9b09b96c81b86156a067d1e1ea6ba.tar.gz
pttbbs-8f9dc9a65dc9b09b96c81b86156a067d1e1ea6ba.tar.bz2
pttbbs-8f9dc9a65dc9b09b96c81b86156a067d1e1ea6ba.tar.lz
pttbbs-8f9dc9a65dc9b09b96c81b86156a067d1e1ea6ba.tar.xz
pttbbs-8f9dc9a65dc9b09b96c81b86156a067d1e1ea6ba.tar.zst
pttbbs-8f9dc9a65dc9b09b96c81b86156a067d1e1ea6ba.zip
- pmore: move ChessReplay (z) to outside.
- bbs: use 'now' to prevent time() system call. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3779 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/more.c')
-rw-r--r--mbbsd/more.c31
1 files changed, 20 insertions, 11 deletions
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;