summaryrefslogtreecommitdiffstats
path: root/mbbsd/bbs.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-12-30 23:40:21 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-12-30 23:40:21 +0800
commitbc5173a637161e4751e759779ac6d1a708ed2b5e (patch)
tree37d8f73bfdf28a1ad6d3f975fe5854236bed3438 /mbbsd/bbs.c
parent411661c4660d61b365224c5263e5ae93ef04c194 (diff)
downloadpttbbs-bc5173a637161e4751e759779ac6d1a708ed2b5e.tar
pttbbs-bc5173a637161e4751e759779ac6d1a708ed2b5e.tar.gz
pttbbs-bc5173a637161e4751e759779ac6d1a708ed2b5e.tar.bz2
pttbbs-bc5173a637161e4751e759779ac6d1a708ed2b5e.tar.lz
pttbbs-bc5173a637161e4751e759779ac6d1a708ed2b5e.tar.xz
pttbbs-bc5173a637161e4751e759779ac6d1a708ed2b5e.tar.zst
pttbbs-bc5173a637161e4751e759779ac6d1a708ed2b5e.zip
- modify file size limitation control
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3765 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/bbs.c')
-rw-r--r--mbbsd/bbs.c42
1 files changed, 33 insertions, 9 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 6702c021..5958e6c0 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -972,12 +972,13 @@ do_general(int isbid)
Copy(genbuf, fpath);
}
-#ifdef EXP_EDIT_UPLOAD
# ifdef GLOBAL_BBSMOVIE
if (strcmp(currboard, GLOBAL_BBSMOVIE) == 0)
+ {
edflags |= EDITFLAG_UPLOAD;
+ edflags |= EDITFLAG_ALLOWLARGE;
+ }
# endif // GLOBAL_BBSMOVIE
-#endif // EXP_EDIT_UPLOAD
aborted = vedit2(fpath, YEA, &islocal, edflags);
if (aborted == -1) {
@@ -1350,6 +1351,14 @@ edit_post(int ent, fileheader_t * fhdr, const char *direct)
if (strcmp(bp->brdname, GLOBAL_SECURITY) == 0)
return DONOTHING;
+# ifdef GLOBAL_BBSMOVIE
+ if (strcmp(bp->brdname, GLOBAL_BBSMOVIE) == 0)
+ {
+ edflags |= EDITFLAG_UPLOAD;
+ edflags |= EDITFLAG_ALLOWLARGE;
+ }
+# endif // GLOBAL_BBSMOVIE
+
// XXX 不知何時起, edit_post 已經不會有 + 號了...
// 全部都是 Sysop Edit 的原地形式。
// 哪天有空找個人寫個 mode 是改名 edit 吧
@@ -2212,14 +2221,27 @@ edit_title(int ent, fileheader_t * fhdr, const char *direct)
char genbuf[200];
fileheader_t tmpfhdr = *fhdr;
int dirty = 0;
+ int allow = 0;
- if (currmode & MODE_BOARD || !strcmp(cuser.userid, fhdr->owner)) {
- if (getdata(b_lines - 1, 0, "標題:", genbuf, TTLEN, DOECHO)) {
- strlcpy(tmpfhdr.title, genbuf, sizeof(tmpfhdr.title));
- dirty++;
- }
+ // should we allow edit-title here?
+ if (currstat == RMAIL)
+ allow = 0;
+ else if (HasUserPerm(PERM_SYSOP))
+ allow = 2;
+ else if (currmode & MODE_BOARD ||
+ strcmp(cuser.userid, fhdr->owner) == 0)
+ allow = 1;
+
+ if (!allow)
+ return DONOTHING;
+
+ if (getdata(b_lines - 1, 0, "標題:", genbuf, TTLEN, DOECHO)) {
+ strlcpy(tmpfhdr.title, genbuf, sizeof(tmpfhdr.title));
+ dirty++;
}
- if (HasUserPerm(PERM_SYSOP)) {
+
+ if (allow >= 2)
+ {
if (getdata(b_lines - 1, 0, "作者:", genbuf, IDLEN + 2, DOECHO)) {
strlcpy(tmpfhdr.owner, genbuf, sizeof(tmpfhdr.owner));
dirty++;
@@ -2229,7 +2251,9 @@ edit_title(int ent, fileheader_t * fhdr, const char *direct)
dirty++;
}
}
- if (currmode & MODE_BOARD || !strcmp(cuser.userid, fhdr->owner)) {
+
+ if (dirty)
+ {
getdata(b_lines - 1, 0, "確定(Y/N)?[n] ", genbuf, 3, DOECHO);
if ((genbuf[0] == 'y' || genbuf[0] == 'Y') && dirty) {
*fhdr = tmpfhdr;