summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/announce.c33
-rw-r--r--mbbsd/bbs.c42
-rw-r--r--mbbsd/edit.c16
3 files changed, 72 insertions, 19 deletions
diff --git a/mbbsd/announce.c b/mbbsd/announce.c
index 3d293fb0..780525b8 100644
--- a/mbbsd/announce.c
+++ b/mbbsd/announce.c
@@ -421,10 +421,22 @@ a_newitem(menu_t * pm, int mode)
}
switch (mode) {
case ADDITEM:
- if (vedit(fpath, 0, NULL) == -1) {
- unlink(fpath);
- pressanykey();
- return;
+ {
+ int edflags = 0;
+# ifdef GLOBAL_BBSMOVIE
+ if (pm && pm->bid &&
+ strcmp(getbcache(pm->bid)->brdname,
+ GLOBAL_BBSMOVIE) == 0)
+ {
+ edflags |= EDITFLAG_UPLOAD;
+ edflags |= EDITFLAG_ALLOWLARGE;
+ }
+# endif // GLOBAL_BBSMOVIE
+ if (vedit2(fpath, 0, NULL, edflags) == -1) {
+ unlink(fpath);
+ pressanykey();
+ return;
+ }
}
break;
case ADDGROUP:
@@ -1110,8 +1122,19 @@ a_menu(const char *maintitle, const char *path,
snprintf(fname, sizeof(fname),
"%s/%s", path, me.header[me.now - me.page].filename);
if (dashf(fname) && me.level >= MANAGER) {
+ int edflags = 0;
*quote_file = 0;
- if (vedit(fname, NA, NULL) != -1) {
+
+# ifdef GLOBAL_BBSMOVIE
+ if (me.bid && strcmp(getbcache(me.bid)->brdname,
+ GLOBAL_BBSMOVIE) == 0)
+ {
+ edflags |= EDITFLAG_UPLOAD;
+ edflags |= EDITFLAG_ALLOWLARGE;
+ }
+# endif // GLOBAL_BBSMOVIE
+
+ if (vedit2(fname, NA, NULL, edflags) != -1) {
char fpath[200];
fileheader_t fhdr;
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;
diff --git a/mbbsd/edit.c b/mbbsd/edit.c
index 315cfc65..710406c2 100644
--- a/mbbsd/edit.c
+++ b/mbbsd/edit.c
@@ -44,7 +44,7 @@
#include "bbs.h"
#define EDIT_SIZE_LIMIT (32768*1024)
-#define EDIT_LINE_LIMIT (1048576)
+#define EDIT_LINE_LIMIT (65530) // (1048576)
#if 0
#define register
@@ -1667,6 +1667,10 @@ write_file(char *fpath, int saveheader, int *islocal, char *mytitle, int upload)
stand_title("郎矪瞶");
move(1,0);
+#ifdef EDIT_UPLOAD_ALLOWALL
+ upload = 1;
+#endif // EDIT_UPLOAD_ALLOWALL
+
// common trail
if (currstat == SMAIL)
@@ -1697,7 +1701,8 @@ write_file(char *fpath, int saveheader, int *islocal, char *mytitle, int upload)
return KEEP_EDITING;
#ifdef EXP_EDIT_UPLOAD
case 'u':
- upload_file();
+ if (upload)
+ upload_file();
return KEEP_EDITING;
#endif // EXP_EDIT_UPLOAD
case 'r':
@@ -3210,10 +3215,11 @@ vedit2(char *fpath, int saveheader, int *islocal, int flags)
}
#ifdef MAX_EDIT_LINE
- if(curr_buf->totaln == MAX_EDIT_LINE
- && !(flags & EDITFLAG_UPLOAD))
+ if(curr_buf->totaln ==
+ ((flags & EDITFLAG_ALLOWLARGE) ?
+ MAX_EDIT_LINE_LARGE : MAX_EDIT_LINE))
{
- vmsg("禬筁程︽计");
+ vmsg("笷程︽计");
break;
}
#endif