diff options
author | wens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-01-02 23:16:23 +0800 |
---|---|---|
committer | wens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-01-02 23:16:23 +0800 |
commit | 4ef59339ce51c6378e04a7b716241bdbdd2b4e6a (patch) | |
tree | f53f4d01df9150516a849fb2a906156db93f042d /mbbsd/user.c | |
parent | 157b1d72211ffacf8614d6a5e96e8cf536f93e78 (diff) | |
download | pttbbs-4ef59339ce51c6378e04a7b716241bdbdd2b4e6a.tar pttbbs-4ef59339ce51c6378e04a7b716241bdbdd2b4e6a.tar.gz pttbbs-4ef59339ce51c6378e04a7b716241bdbdd2b4e6a.tar.bz2 pttbbs-4ef59339ce51c6378e04a7b716241bdbdd2b4e6a.tar.lz pttbbs-4ef59339ce51c6378e04a7b716241bdbdd2b4e6a.tar.xz pttbbs-4ef59339ce51c6378e04a7b716241bdbdd2b4e6a.tar.zst pttbbs-4ef59339ce51c6378e04a7b716241bdbdd2b4e6a.zip |
use emaildb interface in user register
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3774 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/user.c')
-rw-r--r-- | mbbsd/user.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/mbbsd/user.c b/mbbsd/user.c index 8645ab62..ce2dedbe 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -698,6 +698,7 @@ uinfo_query(userec_t *u, int adminmode, int unum) if (strcmp(buf, x.email) && strchr(buf, '@')) { strlcpy(x.email, buf, sizeof(x.email)); mail_changed = 1 - adminmode; + delregcodefile(); } break; case '7': @@ -1077,7 +1078,6 @@ uinfo_query(userec_t *u, int adminmode, int unum) snprintf(buf, sizeof(buf), "%d", x.mobile); justify_wait(x.userid, phone, career, x.realname, x.address, buf); - email_justify(&x); } memcpy(u, &x, sizeof(x)); if (i == QUIT) { @@ -1441,10 +1441,29 @@ toregister(char *email, char *genbuf, char *phone, char *career, #endif else if (isvalidemail(email)) { char yn[3]; +#ifdef USE_EMAILDB + int email_count = emaildb_check_email(email, strlen(email)); + + if (email_count < 0) { + move(15, 0); clrtobot(); + move(17, 0); + outs("暫時不允許 email 認證註冊, 請稍後再試\n"); + pressanykey(); + return; + } else if (email_count >= EMAILDB_LIMIT) { + move(15, 0); clrtobot(); + move(17, 0); + outs("指定的 E-Mail 已註冊過多帳號, 請使用其他 E-Mail, 或輸入 x 採手動認證\n"); + outs("但注意手動認證通常會花上數週以上的時間。\n"); + } else { +#endif getdata(16, 0, "請再次確認您輸入的 E-Mail 位置正確嘛? [y/N]", yn, sizeof(yn), LCECHO); if (yn[0] == 'Y' || yn[0] == 'y') break; +#ifdef USE_EMAILDB + } +#endif } else { move(15, 0); clrtobot(); move(17, 0); @@ -1452,6 +1471,16 @@ toregister(char *email, char *genbuf, char *phone, char *career, outs("但注意手動認證通常會花上數週以上的時間。\n"); } } +#ifdef USE_EMAILDB + if (emaildb_update_email(cuser.userid, strlen(cuser.userid), + email, strlen(email)) < 0) { + move(15, 0); clrtobot(); + move(17, 0); + outs("暫時不允許 email 認證註冊, 請稍後再試\n"); + pressanykey(); + return; + } +#endif strlcpy(cuser.email, email, sizeof(cuser.email)); REGFORM2: if (strcasecmp(email, "x") == 0) { /* 手動認證 */ |