diff options
Diffstat (limited to 'mbbsd/mbbsd.c')
-rw-r--r-- | mbbsd/mbbsd.c | 7 |
1 files changed, 7 insertions, 0 deletions
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)) ){ |