From c099482dac7f90462952c17fd69a62ba8b70eac6 Mon Sep 17 00:00:00 2001 From: piaip Date: Sat, 3 Oct 2009 01:03:25 +0000 Subject: * make del/edit in digest work more like before git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4899 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/bbs.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'mbbsd/bbs.c') diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 52975051..5d2e2180 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -334,15 +334,20 @@ int IsFreeBoardName(const char *brdname) * XXX can we replace currboard with currbid ? */ int CheckPostPerm(void) +{ + if (currmode & MODE_DIGEST) + return 0; + return CheckModifyPerm(); +} + +int +CheckModifyPerm(void) { static time4_t last_chk_time = 0x0BAD0BB5; /* any magic number */ static int last_board_index = 0; /* for speed up */ int valid_index = 0; boardheader_t *bp = NULL; - if (currmode & MODE_DIGEST) - return 0; - // check if my own permission is changed. if (ISNEWPERM(currutmp)) { @@ -1431,7 +1436,7 @@ edit_post(int ent, fileheader_t * fhdr, const char *direct) // reason 1: BM may alter post restrictions to this board // reason 2: this account may be occupied by someone else. if (!HasUserPerm(PERM_BASIC) || // including guests - (!CheckPostPerm() && !(currmode & MODE_DIGEST)) || // XXX it's stupid to check digest mode here, but right now CheckPostPerm early returns for digest... NOTE this is buggy but since I don't want to manintain the useless digest... + !CheckPostPerm() || // edit needs post perm (cannot be changed in digest mode) !CheckPostRestriction(currbid) ) return DONOTHING; @@ -2949,7 +2954,7 @@ del_post(int ent, fileheader_t * fhdr, char *direct) // reason 1: BM may alter post restrictions to this board // reason 2: this account may be occupied by someone else. if (!HasUserPerm(PERM_BASIC) || // including guests - (!CheckPostPerm() && !(currmode & MODE_DIGEST)) || // XXX it's stupid to check digest mode here, but right now CheckPostPerm early returns for digest... NOTE this is buggy but since I don't want to manintain the useless digest... + !( (currmode & MODE_DIGEST) ? (currmode & MODE_BOARD) : CheckPostPerm() ) || // allow BM to delete posts in digest mode !CheckPostRestriction(currbid) ) return DONOTHING; -- cgit v1.2.3