summaryrefslogtreecommitdiffstats
path: root/console/more.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-03-20 19:33:49 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-03-20 19:33:49 +0800
commit6c7b18b32d87c2a835f7e5c48faac4a8ad44668b (patch)
treee88e1b2b1007f4ddcd348a4a1bf1d13c515c4564 /console/more.c
parentf59699c22c130373cda3cc4cb6fab5bae510bd5a (diff)
downloadpttbbs-piaip.newlayout.tar
pttbbs-piaip.newlayout.tar.gz
pttbbs-piaip.newlayout.tar.bz2
pttbbs-piaip.newlayout.tar.lz
pttbbs-piaip.newlayout.tar.xz
pttbbs-piaip.newlayout.tar.zst
pttbbs-piaip.newlayout.zip
- (internal/exp) first draft of new layoutpiaip.newlayout
git-svn-id: http://opensvn.csie.org/pttbbs/branches/piaip.newlayout@4013 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'console/more.c')
-rw-r--r--console/more.c77
1 files changed, 77 insertions, 0 deletions
diff --git a/console/more.c b/console/more.c
new file mode 100644
index 00000000..d506754a
--- /dev/null
+++ b/console/more.c
@@ -0,0 +1,77 @@
+/* $Id$ */
+#include "bbs.h"
+
+/* use new pager: piaip's more. */
+int more(char *fpath, int promptend)
+{
+ int r = pmore(fpath, promptend);
+
+ switch(r)
+ {
+
+ case RET_DOSYSOPEDIT:
+ r = FULLUPDATE;
+
+ if (!HasUserPerm(PERM_SYSOP) ||
+ strcmp(fpath, "etc/ve.hlp") == 0)
+ break;
+
+#ifdef GLOBAL_SECURITY
+ if (strcmp(currboard, GLOBAL_SECURITY) == 0)
+ break;
+#endif // GLOBAL_SECURITY
+
+ log_filef("log/security", LOG_CREAT,
+ "%u %24.24s %d %s admin edit file=%s\n",
+ (int)now, ctime4(&now), getpid(), cuser.userid, fpath);
+
+ // no need to allow anything...
+ // at least, no need to change title.
+ vedit2(fpath, NA, NULL, 0);
+ break;
+
+ case RET_SELECTBRD:
+ r = FULLUPDATE;
+ if (HasUserPerm(PERM_BASIC))
+ {
+ if (currstat == READING)
+ return Select();
+ }
+ break;
+
+ case RET_COPY2TMP:
+ r = FULLUPDATE;
+ if (HasUserPerm(PERM_BASIC))
+ {
+ char buf[PATHLEN];
+ getdata(b_lines - 1, 0, "把這篇文章收入到暫存檔?[y/N] ",
+ buf, 4, LCECHO);
+ if (buf[0] != 'y')
+ break;
+ setuserfile(buf, ask_tmpbuf(b_lines - 1));
+ Copy(fpath, buf);
+ }
+ break;
+
+ case RET_DOCHESSREPLAY:
+ r = FULLUPDATE;
+ if (HasUserPerm(PERM_BASIC))
+ {
+ ChessReplayGame(fpath);
+ }
+ break;
+
+#if defined(USE_BBSLUA)
+ case RET_DOBBSLUA:
+ r = FULLUPDATE;
+ if (HasUserPerm(PERM_BASIC))
+ {
+ bbslua(fpath);
+ }
+ break;
+#endif
+ }
+
+ return r;
+}
+