From d839e1ec58637953063cc89b73cc0ceab8b3880d Mon Sep 17 00:00:00 2001 From: in2 Date: Wed, 26 Oct 2005 16:42:14 +0000 Subject: BRD_OVER18 patch. see http://www.ticrf.org.tw for details git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3231 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/mbbsd.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mbbsd/mbbsd.c') diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index 38716ad0..9cd20572 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -1005,6 +1005,13 @@ user_login(void) /* 初始化: random number 增加user跟時間的差異 */ mysrand(); + /* check if over18 */ + if( (ptime.tm_year - cuser.year) >= 18 || + (ptime.tm_year - cuser.year == 17 && + ((ptime.tm_mon+1) > cuser.month || + ((ptime.tm_mon+1) == cuser.month && ptime.tm_mday > cuser.day))) ) + over18 = 1; + /* show welcome_login */ if( (ifbirth = (ptime.tm_mday == cuser.day && ptime.tm_mon + 1 == cuser.month)) ){ -- cgit v1.2.3