summaryrefslogtreecommitdiffstats
path: root/mbbsd/mbbsd.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-09-08 08:23:32 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-09-08 08:23:32 +0800
commit8a3a6d8827cf9ba4073dbdff48e0cdfeb7d012c3 (patch)
tree06a88440d5f0e9725ebe7f0e462c1277a434102a /mbbsd/mbbsd.c
parentdfeb1a9e710617bb8b800ec0a11350d1c9f79489 (diff)
downloadpttbbs-8a3a6d8827cf9ba4073dbdff48e0cdfeb7d012c3.tar
pttbbs-8a3a6d8827cf9ba4073dbdff48e0cdfeb7d012c3.tar.gz
pttbbs-8a3a6d8827cf9ba4073dbdff48e0cdfeb7d012c3.tar.bz2
pttbbs-8a3a6d8827cf9ba4073dbdff48e0cdfeb7d012c3.tar.lz
pttbbs-8a3a6d8827cf9ba4073dbdff48e0cdfeb7d012c3.tar.xz
pttbbs-8a3a6d8827cf9ba4073dbdff48e0cdfeb7d012c3.tar.zst
pttbbs-8a3a6d8827cf9ba4073dbdff48e0cdfeb7d012c3.zip
* improve check_BM frequency
* refine messages git-svn-id: http://opensvn.csie.org/pttbbs/branches/pttbbs.pwcu@4819 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/mbbsd.c')
-rw-r--r--mbbsd/mbbsd.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index a99a5145..f10bec3d 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -1049,11 +1049,6 @@ setup_utmp(int mode)
strip_nonebig5((unsigned char *)currutmp->nickname, sizeof(currutmp->nickname));
strip_nonebig5((unsigned char *)currutmp->mind, sizeof(currutmp->mind));
- // XXX 這個 check 花不少時間,有點間隔比較好
- // TODO XXX 使用 numlogindays 有點問題,同一天內多次 login 會狂檢查...
- if ((cuser.userlevel & PERM_BM) && !(cuser.numlogindays % 20))
- check_BM(); /* Ptt 自動取下離職板主權力 */
-
// resolve fromhost
#if defined(WHERE)
@@ -1260,9 +1255,16 @@ user_login(void)
check_bad_login();
check_mailbox_quota();
check_register();
- pwcuLoginSave();
+ pwcuLoginSave(); // is_first_login_of_today is only valid after pwcuLoginSave.
restore_backup();
+ // XXX 這個 check 花不少時間,有點間隔比較好
+ if (HasUserPerm(PERM_BM) &&
+ (cuser.numlogindays % 10 == 0) && // when using numlogindays, check with is_first_login_of_today
+ is_first_login_of_today )
+ check_BM(); /* 自動取下離職板主權力 */
+
+
} else if (strcmp(cuser.userid, STR_GUEST) == 0) { /* guest */
init_guest_info();