summaryrefslogtreecommitdiffstats
path: root/mbbsd/bbs.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-01-03 20:54:30 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-01-03 20:54:30 +0800
commit74ceac39794d1f3744a4c14e0e48d787d538b5d0 (patch)
tree8f59926ff410f1efd6476df852e3f2492014cced /mbbsd/bbs.c
parentc910fdb835478291442032bf6523d41949aa68d9 (diff)
downloadpttbbs-74ceac39794d1f3744a4c14e0e48d787d538b5d0.tar
pttbbs-74ceac39794d1f3744a4c14e0e48d787d538b5d0.tar.gz
pttbbs-74ceac39794d1f3744a4c14e0e48d787d538b5d0.tar.bz2
pttbbs-74ceac39794d1f3744a4c14e0e48d787d538b5d0.tar.lz
pttbbs-74ceac39794d1f3744a4c14e0e48d787d538b5d0.tar.xz
pttbbs-74ceac39794d1f3744a4c14e0e48d787d538b5d0.tar.zst
pttbbs-74ceac39794d1f3744a4c14e0e48d787d538b5d0.zip
- re-enable sysop-edit in article list mode
- move sysop-edit log to more instead of pmore body git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3778 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/bbs.c')
-rw-r--r--mbbsd/bbs.c60
1 files changed, 39 insertions, 21 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 66fc4316..f8b500dc 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -1347,31 +1347,19 @@ edit_post(int ent, fileheader_t * fhdr, const char *direct)
edflags |= EXP_EDITPOST_TEXTONLY;
#endif
- assert(0<=currbid-1 && currbid-1<MAX_BOARD);
- 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
+ assert(0<=currbid-1 && currbid-1<MAX_BOARD && bp);
- // XXX 不知何時起, edit_post 已經不會有 + 號了...
- // 全部都是 Sysop Edit 的原地形式。
- // 哪天有空找個人寫個 mode 是改名 edit 吧
+ // special modes (plus MODE_DIGEST?)
+ if( currmode & MODE_SELECT )
+ return DONOTHING;
- if ((bp->brdattr & BRD_VOTEBOARD) ||
- (fhdr->filemode & FILE_VOTE) ||
- !CheckPostPerm() ||
- strcmp(fhdr->owner, cuser.userid) != EQUSTR ||
- strcmp(cuser.userid, STR_GUEST) == EQUSTR)
+ // board check
+ if (strcmp(bp->brdname, GLOBAL_SECURITY) == EQUSTR ||
+ (bp->brdattr & BRD_VOTEBOARD))
return DONOTHING;
- // special modes (plus MODE_DIGEST?)
- if( currmode & MODE_SELECT )
+ // file check
+ if (fhdr->filemode & FILE_VOTE)
return DONOTHING;
#ifdef SAFE_ARTICLE_DELETE
@@ -1379,8 +1367,38 @@ edit_post(int ent, fileheader_t * fhdr, const char *direct)
return DONOTHING;
#endif
+ // user check
+ if (!HasUserPerm(PERM_BASIC) || // includeing guests
+ !CheckPostPerm() )
+ return DONOTHING;
+
+ if (strcmp(fhdr->owner, cuser.userid) != EQUSTR)
+ {
+ time4_t t = time4(NULL);
+ if (!HasUserPerm(PERM_SYSOP))
+ return DONOTHING;
+
+ // admin edit!
+ log_filef("log/security", LOG_CREAT,
+ "%d %24.24s %d %s admin edit (board) file=%s\n",
+ t, ctime4(&t), getpid(), cuser.userid, fpath);
+ }
+
+# ifdef GLOBAL_BBSMOVIE
+ if (strcmp(bp->brdname, GLOBAL_BBSMOVIE) == 0)
+ {
+ edflags |= EDITFLAG_UPLOAD;
+ edflags |= EDITFLAG_ALLOWLARGE;
+ }
+# endif // GLOBAL_BBSMOVIE
+
setutmpmode(REEDIT);
+
+ // XXX 不知何時起, edit_post 已經不會有 + 號了...
+ // 全部都是 Sysop Edit 的原地形式。
+ // 哪天有空找個人寫個 mode 是改名 edit 吧
+ //
// TODO 由於現在檔案都是直接蓋回原檔,
// 在原看板目錄開已沒有很大意義。 (效率稍高一點)
// 可以考慮改開在 user home dir