diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-03-19 21:03:03 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-03-19 21:03:03 +0800 |
commit | d4ca75df642237f81a2958fb395df41083e5c173 (patch) | |
tree | dfb3615f6a08517ee8b547d8cab641b9d4bd234c /mbbsd/mbbsd.c | |
parent | a955ee6b77652aa57f0009f9878aa88d1755ce8d (diff) | |
download | pttbbs-d4ca75df642237f81a2958fb395df41083e5c173.tar pttbbs-d4ca75df642237f81a2958fb395df41083e5c173.tar.gz pttbbs-d4ca75df642237f81a2958fb395df41083e5c173.tar.bz2 pttbbs-d4ca75df642237f81a2958fb395df41083e5c173.tar.lz pttbbs-d4ca75df642237f81a2958fb395df41083e5c173.tar.xz pttbbs-d4ca75df642237f81a2958fb395df41083e5c173.tar.zst pttbbs-d4ca75df642237f81a2958fb395df41083e5c173.zip |
statistic for user's first login today
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2653 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/mbbsd.c')
-rw-r--r-- | mbbsd/mbbsd.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index 9d8bdc1e..78a4c24d 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -906,7 +906,7 @@ inline static void foreign_warning(void){ static void user_login(void) { - struct tm ptime; + struct tm ptime, lasttime; int nowusers, ifbirth = 0, i; /* get local time */ @@ -961,6 +961,7 @@ user_login(void) setup_utmp(LOGIN); currmode = MODE_STARTED; enter_uflag = cuser.uflag; + lasttime = *localtime4(&cuser.lastlogin); if ((nowusers = SHM->UTMPnumber) > SHM->max_user) { SHM->max_user = nowusers; @@ -982,7 +983,7 @@ user_login(void) welcome_msg(); if( ifbirth ){ - birthday_make_a_wish(&ptime, localtime4(&(cuser.lastlogin))); + birthday_make_a_wish(&ptime, &lasttime); if( getans("是否要顯示「壽星」於使用者名單上?(y/N)") == 'y' ) currutmp->birth = 1; } @@ -998,9 +999,14 @@ user_login(void) pressanykey(); check_mailbox_quota(); } + if(ptime.tm_yday!=lasttime.tm_yday) + STATINC(STAT_TODAYLOGIN_MAX); - if (!PERM_HIDE(currutmp)) + if (!PERM_HIDE(currutmp)) { + if(ptime.tm_yday!=lasttime.tm_yday) + STATINC(STAT_TODAYLOGIN_MIN); cuser.lastlogin = login_start_time; + } #if FOREIGN_REG_DAY > 0 foreign_warning(); |