diff options
-rw-r--r-- | mbbsd/emaildb.c | 3 | ||||
-rw-r--r-- | mbbsd/name.c | 2 | ||||
-rw-r--r-- | mbbsd/register.c | 28 | ||||
-rw-r--r-- | mbbsd/user.c | 7 |
4 files changed, 36 insertions, 4 deletions
diff --git a/mbbsd/emaildb.c b/mbbsd/emaildb.c index d8f0ae05..90cd567e 100644 --- a/mbbsd/emaildb.c +++ b/mbbsd/emaildb.c @@ -47,6 +47,9 @@ int emaildb_check_email(char * email, int email_len) // use mail. if (strcasecmp(result, cuser.userid) == 0) continue; + + // force update + u.email[0] = 0; if (getuser(result, &u)) if (strcasecmp(email, u.email) == 0) diff --git a/mbbsd/name.c b/mbbsd/name.c index 0f2b1ef4..1ccab86a 100644 --- a/mbbsd/name.c +++ b/mbbsd/name.c @@ -1025,7 +1025,7 @@ completeboard_permission(int where) return (!(bptr->brdattr & BRD_SYMBOLIC) && (GROUPOP() || HasBoardPerm(bptr)) && !(bptr->brdattr & BRD_GROUPBOARD) && - !(bptr->brdattr & BRD_OVER18 && !over18)); + !((bptr->brdattr & BRD_OVER18) && !over18)); } int 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) { diff --git a/mbbsd/user.c b/mbbsd/user.c index d8bc901d..83402dfe 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -1465,7 +1465,7 @@ toregister(char *email, char *phone, char *career, outs("暫時不允許\ email 認證註冊, 請稍後再試\n"); pressanykey(); return; - } else if (email_count > EMAILDB_LIMIT) { + } else if (email_count >= EMAILDB_LIMIT) { move(15, 0); clrtobot(); move(17, 0); outs("指定的 E-Mail 已註冊過多帳號, 請使用其他 E-Mail, 或輸入 x 採手動認證\n"); @@ -1736,8 +1736,9 @@ u_register(void) goto REGFORM; } - // XXX why check by year? - if (cuser.year != 0 && /* 已經第一次填過了~ ^^" */ + // XXX why check by year? + // birthday is moved to earlier, so let's check email instead. + if (cuser.email[0] && // cuser.year != 0 && /* 已經第一次填過了~ ^^" */ strcmp(cuser.email, "x") != 0 && /* 上次手動認證失敗 */ strcmp(cuser.email, "X") != 0) { clear(); |