summaryrefslogtreecommitdiffstats
path: root/mbbsd/user.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-03-19 01:40:50 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-03-19 01:40:50 +0800
commit8f95d356b5377113375a7efc55d2f177103db5f4 (patch)
treee48f8efb12c3141696f07e02f74422550f868014 /mbbsd/user.c
parent8be710863b3870e8c096058e6a17f2338acff52d (diff)
downloadpttbbs-8f95d356b5377113375a7efc55d2f177103db5f4.tar
pttbbs-8f95d356b5377113375a7efc55d2f177103db5f4.tar.gz
pttbbs-8f95d356b5377113375a7efc55d2f177103db5f4.tar.bz2
pttbbs-8f95d356b5377113375a7efc55d2f177103db5f4.tar.lz
pttbbs-8f95d356b5377113375a7efc55d2f177103db5f4.tar.xz
pttbbs-8f95d356b5377113375a7efc55d2f177103db5f4.tar.zst
pttbbs-8f95d356b5377113375a7efc55d2f177103db5f4.zip
- cancelbadpost: prevent update request masked by potential new badposts.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4008 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/user.c')
-rw-r--r--mbbsd/user.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/mbbsd/user.c b/mbbsd/user.c
index 6d4b25cd..d235d01f 100644
--- a/mbbsd/user.c
+++ b/mbbsd/user.c
@@ -79,6 +79,9 @@ int u_cancelbadpost(void)
{vmsg("請登出其他視窗, 否則不受理."); return 0;}
passwd_query(usernum, &cuser);
+ if (currutmp && (currutmp->alerts & ALERT_PWD))
+ currutmp->alerts &= ~ALERT_PWD;
+
day = 180 - (now - cuser.timeremovebadpost ) / 86400;
if(day>0 && day<=180)
{
@@ -98,12 +101,12 @@ int u_cancelbadpost(void)
{vmsg("請登出其他視窗, 否則不受理."); return 0;}
if(cuser.badpost)
{
- cuser.badpost--;
+ int prev = cuser.badpost--;
cuser.timeremovebadpost = now;
passwd_update(usernum, &cuser);
log_filef("log/cancelbadpost.log", LOG_CREAT,
- "%s %s 刪除一篇劣文 (現 %d 篇)\n",
- Cdate(&now), cuser.userid, cuser.badpost);
+ "%s %s 刪除一篇劣文 (%d -> %d 篇)\n",
+ Cdate(&now), cuser.userid, prev, cuser.badpost);
}
vmsg("恭喜您已經成功\刪除一篇劣文.");
return 0;