From bc5173a637161e4751e759779ac6d1a708ed2b5e Mon Sep 17 00:00:00 2001 From: piaip Date: Sun, 30 Dec 2007 15:40:21 +0000 Subject: - modify file size limitation control git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3765 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/bbs.c | 42 +++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-) (limited to 'mbbsd/bbs.c') 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; -- cgit v1.2.3