diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-03-15 02:00:32 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-03-15 02:00:32 +0800 |
commit | b26fbc65ed9d7cbca50f8758712a9b9b6b2bf853 (patch) | |
tree | 1a6b92c8e65229c5d3ead5b76aceb1124fc6ebe0 | |
parent | 2947891b02eb3f57581fc1f5f6197ab33df078b3 (diff) | |
download | pttbbs-b26fbc65ed9d7cbca50f8758712a9b9b6b2bf853.tar pttbbs-b26fbc65ed9d7cbca50f8758712a9b9b6b2bf853.tar.gz pttbbs-b26fbc65ed9d7cbca50f8758712a9b9b6b2bf853.tar.bz2 pttbbs-b26fbc65ed9d7cbca50f8758712a9b9b6b2bf853.tar.lz pttbbs-b26fbc65ed9d7cbca50f8758712a9b9b6b2bf853.tar.xz pttbbs-b26fbc65ed9d7cbca50f8758712a9b9b6b2bf853.tar.zst pttbbs-b26fbc65ed9d7cbca50f8758712a9b9b6b2bf853.zip |
user defined show 壽星 or not
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2626 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/mbbsd.c | 52 | ||||
-rw-r--r-- | mbbsd/talk.c | 2 |
2 files changed, 31 insertions, 23 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index ba73ad3a..7e4df1ca 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -779,7 +779,7 @@ setup_utmp(int mode) uinfo.goodsale = cuser.goodsale; uinfo.badsale = cuser.badsale; if(cuser.withme & (cuser.withme<<1) & (WITHME_ALLFLAG<<1)) - cuser.withme=0; + cuser.withme = 0; uinfo.withme = cuser.withme; memcpy(uinfo.mind, cuser.mind, 4); strip_nonebig5(uinfo.mind, 4); @@ -813,7 +813,8 @@ setup_utmp(int mode) #endif } -inline static void welcome_msg(void) { +inline static void welcome_msg(void) +{ prints("\033[m Åwªï±z²Ä \033[1;33m%d\033[0;37m «×«ô³X¥»¯¸¡A" "¤W¦¸±z¬O±q \033[1;33m%s\033[0;37m ³s©¹¥»¯¸¡A\n" " §Ú°O±o¨º¤Ñ¬O \033[1;33m%s\033[0;37m¡C\n", @@ -821,7 +822,8 @@ inline static void welcome_msg(void) { pressanykey(); } -inline static void check_bad_login(void) { +inline static void check_bad_login(void) +{ char genbuf[200]; setuserfile(genbuf, str_badlogin); if (more(genbuf, NA) != -1) { @@ -834,8 +836,9 @@ inline static void check_bad_login(void) { } } -inline static void birthday_make_a_wish(struct tm *ptime, struct tm *tmp){ - if (currutmp->birth && tmp->tm_mday != ptime->tm_mday) { +inline static void birthday_make_a_wish(struct tm *ptime, struct tm *tmp) +{ + if (tmp->tm_mday != ptime->tm_mday) { more("etc/birth.post", YEA); brc_initial_board("WhoAmI"); set_board(); @@ -843,11 +846,13 @@ inline static void birthday_make_a_wish(struct tm *ptime, struct tm *tmp){ } } -inline static void record_lasthost(char *fromhost){ +inline static void record_lasthost(char *fromhost) +{ strlcpy(cuser.lasthost, fromhost, sizeof(cuser.lasthost)); } -inline static void check_mailbox_quota(void){ +inline static void check_mailbox_quota(void) +{ if (chkmailbox()) m_read(); } @@ -899,9 +904,8 @@ inline static void foreign_warning(void){ static void user_login(void) { - char i; - struct tm *ptime, *tmp; - int a, ifbirth; + struct tm *ptime; + int nowusers, ifbirth = 0, i; /* get local time */ ptime = localtime4(&now); @@ -910,10 +914,10 @@ user_login(void) mysrand(); /* show welcome_login */ - ifbirth = (ptime->tm_mday == cuser.day && - ptime->tm_mon + 1 == cuser.month); - if (ifbirth) + if( (ifbirth = (ptime->tm_mday == cuser.day && + ptime->tm_mon + 1 == cuser.month)) ){ more("etc/Welcome_birth", NA); + } else { #ifndef MULTI_WELCOME_LOGIN more("etc/Welcome_login", NA); @@ -955,11 +959,9 @@ user_login(void) setup_utmp(LOGIN); currmode = MODE_STARTED; enter_uflag = cuser.uflag; - currutmp->birth = ifbirth; - tmp = localtime4(&(cuser.lastlogin)); - if ((a = SHM->UTMPnumber) > SHM->max_user) { - SHM->max_user = a; + if ((nowusers = SHM->UTMPnumber) > SHM->max_user) { + SHM->max_user = nowusers; SHM->max_time = now; } @@ -967,18 +969,21 @@ user_login(void) !currutmp->invisible) do_aloha("<<¤W¯¸³qª¾>> -- §Ú¨Ó°Õ¡I"); - if(SHM->loginmsg.pid) - { + if (SHM->loginmsg.pid){ if(search_ulist_pid(SHM->loginmsg.pid)) - getmessage(SHM->loginmsg); + getmessage(SHM->loginmsg); else - SHM->loginmsg.pid=0; - } + SHM->loginmsg.pid=0; + } if (cuser.userlevel) { /* not guest */ move(t_lines - 4, 0); welcome_msg(); - birthday_make_a_wish(ptime, tmp); + if( ifbirth ){ + birthday_make_a_wish(ptime, localtime4(&(cuser.lastlogin))); + if( getans("¬O§_nÅã¥Ü¡u¹Ø¬P¡v©ó¨Ï¥ÎªÌ¦W³æ¤W¡H(y/N)") == 'y' ) + currutmp->birth = 1; + } check_bad_login(); check_mailbox_quota(); check_register(); @@ -998,6 +1003,7 @@ user_login(void) #if FOREIGN_REG_DAY > 0 foreign_warning(); #endif + passwd_update(usernum, &cuser); if(cuser.uflag2 & FAVNEW_FLAG) { diff --git a/mbbsd/talk.c b/mbbsd/talk.c index a67afdac..00ff1c83 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -1986,6 +1986,8 @@ draw_pickup(int drawall, pickup_t * pickup, int pickup_way, if ((uentp->userlevel & PERM_VIOLATELAW)) memcpy(mind, "³q½r", 4); + else if (uentp->birth) + memcpy(mind, "¹Ø¬P", 4); else memcpy(mind, uentp->mind, 4); mind[4] = 0; |