From 1d3b8d22376e5e13212aa0099ec6c8eaa4a334f8 Mon Sep 17 00:00:00 2001 From: kcwu Date: Mon, 15 Jun 2009 17:32:22 +0000 Subject: * 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 --- mbbsd/mbbsd.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'mbbsd') 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); -- cgit v1.2.3