diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-01-31 01:00:25 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-01-31 01:00:25 +0800 |
commit | b980cfa8c8f27bf5b014bdc948b225fa24c509e3 (patch) | |
tree | dfb1400d432a2db1efa93fa2fc08cf57bf3539ae /mbbsd/register.c | |
parent | 94532885c8a36425666519d233c310146a291ce4 (diff) | |
download | pttbbs-b980cfa8c8f27bf5b014bdc948b225fa24c509e3.tar pttbbs-b980cfa8c8f27bf5b014bdc948b225fa24c509e3.tar.gz pttbbs-b980cfa8c8f27bf5b014bdc948b225fa24c509e3.tar.bz2 pttbbs-b980cfa8c8f27bf5b014bdc948b225fa24c509e3.tar.lz pttbbs-b980cfa8c8f27bf5b014bdc948b225fa24c509e3.tar.xz pttbbs-b980cfa8c8f27bf5b014bdc948b225fa24c509e3.tar.zst pttbbs-b980cfa8c8f27bf5b014bdc948b225fa24c509e3.zip |
- register: make birthday registration earlier, also helps over18 work correctly.
- register: change '1st register' check to email instead of birthday:year.
- emaildb: fix offset-by-one (because the 'self' is not counted now)
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3890 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/register.c')
-rw-r--r-- | mbbsd/register.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/mbbsd/register.c b/mbbsd/register.c index 0a41a2e5..1df379bf 100644 --- a/mbbsd/register.c +++ b/mbbsd/register.c @@ -1,6 +1,9 @@ /* $Id$ */ #include "bbs.h" +// prototype of crypt() +char *crypt(const char *key, const char *salt); + char * genpasswd(char *pw) { @@ -337,6 +340,31 @@ new_register(void) sizeof(newuser.address), DOECHO); } + try = 0; + while (newuser.year < 40) // magic number 40: see user.c + { + char birthday[sizeof("mmmm/yy/dd ")]; + int y, m, d; + + if (++try > 20) { + vmsg("您嘗試錯誤的輸入太多,請下次再來吧"); + exit(1); + } + getdata(22, 0, "生日 (西元年/月/日, 如 1984/02/29):", birthday, + sizeof(birthday), DOECHO); + + if (ParseDate(birthday, &y, &m, &d)) { + vmsg("日期格式不正確"); + continue; + } else if (y < 1940) { + vmsg("你真的有那麼老嗎?"); + continue; + } + newuser.year = (unsigned char)(y-1900); + newuser.month = (unsigned char)m; + newuser.day = (unsigned char)d; + } + setupnewuser(&newuser); if( (uid = initcuser(newuser.userid)) < 0) { |