summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-10-29 08:56:19 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-10-29 08:56:19 +0800
commit93786f2c209e16cbf70e1bfc067172696ec7ab15 (patch)
tree99ce8a8be20cf2b439c5d08a6bf5326a345702d0 /mbbsd
parentf8af0fe1f0f0b5b07d5cb8124765f78e19ce90d6 (diff)
downloadpttbbs-93786f2c209e16cbf70e1bfc067172696ec7ab15.tar
pttbbs-93786f2c209e16cbf70e1bfc067172696ec7ab15.tar.gz
pttbbs-93786f2c209e16cbf70e1bfc067172696ec7ab15.tar.bz2
pttbbs-93786f2c209e16cbf70e1bfc067172696ec7ab15.tar.lz
pttbbs-93786f2c209e16cbf70e1bfc067172696ec7ab15.tar.xz
pttbbs-93786f2c209e16cbf70e1bfc067172696ec7ab15.tar.zst
pttbbs-93786f2c209e16cbf70e1bfc067172696ec7ab15.zip
fix assess bug
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1273 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/assess.c13
-rw-r--r--mbbsd/bbs.c11
2 files changed, 11 insertions, 13 deletions
diff --git a/mbbsd/assess.c b/mbbsd/assess.c
index 6797f64d..dcae8c4e 100644
--- a/mbbsd/assess.c
+++ b/mbbsd/assess.c
@@ -5,7 +5,7 @@
/* do (*num) + n, n is integer. */
inline static void inc(unsigned char *num, int n)
{
- if (n >= 0 && SALE_MAXVALUE - *num < n)
+ if (n >= 0 && SALE_MAXVALUE - *num <= n)
(*num) = SALE_MAXVALUE;
else if (n < 0 && *num < -n)
(*num) = 0;
@@ -24,12 +24,11 @@ void inc_badpost(int uid, int num)
{
passwd_query(uid, &xuser);
inc(&xuser.badpost, num);
- if(!(xuser.badpost % 10))
- {
- post_violatelaw(xuser.userid, "Ptt 系統警察", "劣文累計十篇", "罰單一張");
- mail_violatelaw(xuser.userid, "Ptt 系統警察", "劣文累計十篇", "罰單一張");
- xuser.userlevel |= PERM_VIOLATELAW;
- }
+ if (!(xuser.badpost % 10)) {
+ post_violatelaw(xuser.userid, "Ptt 系統警察", "劣文累計十篇", "罰單一張");
+ mail_violatelaw(xuser.userid, "Ptt 系統警察", "劣文累計十篇", "罰單一張");
+ xuser.userlevel |= PERM_VIOLATELAW;
+ }
passwd_update(uid, &xuser);
}
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index f599e735..6ebbe75c 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -1613,11 +1613,10 @@ mark_post(int ent, fileheader_t * fhdr, char *direct)
#ifdef ASSESS
if (!(fhdr->filemode & FILE_BID)){
- if (fhdr->filemode & FILE_MARKED)
- {
- if(!(currbrdattr&BRD_BAD))
- inc_goodpost(searchuser(fhdr->owner), fhdr->recommend / 10);
- }
+ if (fhdr->filemode & FILE_MARKED) {
+ if(!(currbrdattr&BRD_BAD))
+ inc_goodpost(searchuser(fhdr->owner), fhdr->recommend / 10);
+ }
else
inc_goodpost(searchuser(fhdr->owner), -1 * (fhdr->recommend / 10));
}
@@ -1750,7 +1749,7 @@ del_post(int ent, fileheader_t * fhdr, char *direct)
cancelpost(fhdr, not_owned, newpath);
#ifdef ASSESS
- if (not_owned)
+ if (not_owned && currmode & MODE_DIGEST && is_BM(cuser.userid))
{
getdata(1, 40, "惡劣文章?(y/N)", genbuf, 3, LCECHO);
if(genbuf[0]=='y')