diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-16 01:32:22 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-16 01:32:22 +0800 |
commit | 1d3b8d22376e5e13212aa0099ec6c8eaa4a334f8 (patch) | |
tree | 6b7185a0b27ac0c0c820ea4e07811183ec1526a9 /mbbsd | |
parent | 6be3bb768566fc4aa816378736f6bc10d57f0a52 (diff) | |
download | pttbbs-1d3b8d22376e5e13212aa0099ec6c8eaa4a334f8.tar pttbbs-1d3b8d22376e5e13212aa0099ec6c8eaa4a334f8.tar.gz pttbbs-1d3b8d22376e5e13212aa0099ec6c8eaa4a334f8.tar.bz2 pttbbs-1d3b8d22376e5e13212aa0099ec6c8eaa4a334f8.tar.lz pttbbs-1d3b8d22376e5e13212aa0099ec6c8eaa4a334f8.tar.xz pttbbs-1d3b8d22376e5e13212aa0099ec6c8eaa4a334f8.tar.zst pttbbs-1d3b8d22376e5e13212aa0099ec6c8eaa4a334f8.zip |
* don't increase user's login count if login less than 60 seconds.
* remove some dead code.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4625 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/mbbsd.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index bd2a7944..0a4dfd95 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -36,7 +36,6 @@ static void getremotename(const struct in_addr from, char *rhost); #define XAUTH_GETREMOTENAME(x) x #endif -static unsigned char enter_uflag; static int listen_port; #define MAX_BINDPORT 20 @@ -245,11 +244,10 @@ u_exit(const char *mode) do_aloha("<<下站通知>> -- 我走囉!"); } - if ((cuser.uflag != enter_uflag) || dirty || diff) { - if (!diff && cuser.numlogins) - cuser.numlogins = --cuser.numlogins; - /* Leeym 上站停留時間限制式 */ - } + // 小於 60 秒不計 login 次數 + if (time(0) - login_start_time < 60 && cuser.numlogins > 0) + --cuser.numlogins; + passwd_sync_update(usernum, &cuser); purge_utmp(currutmp); log_usies(mode, NULL); @@ -1075,9 +1073,6 @@ setup_utmp(int mode) cuser.withme = 0; /* unset all if contradict */ uinfo.withme = cuser.withme & ~WITHME_ALLFLAG; - if (enter_uflag & CLOAK_FLAG) - uinfo.invisible = YEA; - getnewutmpent(&uinfo); ////////////////////////////////////////////////////////////////// @@ -1139,7 +1134,7 @@ inline static void welcome_msg(void) ANSI_CLRTOEND "\n" ANSI_CLRTOEND "\n" , - ++cuser.numlogins, cuser.lasthost, Cdate(&(cuser.lastlogin))); + cuser.numlogins, cuser.lasthost, Cdate(&(cuser.lastlogin))); pressanykey(); } @@ -1237,7 +1232,8 @@ user_login(void) /* 初始化 uinfo、flag、mode */ setup_utmp(LOGIN); - enter_uflag = cuser.uflag; + if (cuser.userlevel) + ++cuser.numlogins; /* log usies */ log_usies("ENTER", fromhost); |