diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-02-04 21:12:42 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-02-04 21:12:42 +0800 |
commit | c2f38e91d221f96b7877c95becd9c5fbccbde03f (patch) | |
tree | ecd328d9f07ab6d7aeb86a0804c532490a30d957 /mbbsd/user.c | |
parent | 3dd3ec79c7807da0c31411b6981fda8c23d77dab (diff) | |
download | pttbbs-c2f38e91d221f96b7877c95becd9c5fbccbde03f.tar pttbbs-c2f38e91d221f96b7877c95becd9c5fbccbde03f.tar.gz pttbbs-c2f38e91d221f96b7877c95becd9c5fbccbde03f.tar.bz2 pttbbs-c2f38e91d221f96b7877c95becd9c5fbccbde03f.tar.lz pttbbs-c2f38e91d221f96b7877c95becd9c5fbccbde03f.tar.xz pttbbs-c2f38e91d221f96b7877c95becd9c5fbccbde03f.tar.zst pttbbs-c2f38e91d221f96b7877c95becd9c5fbccbde03f.zip |
- emaildb: use fork to reduce memory wasting
- user: add more emaildb check
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3900 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/user.c')
-rw-r--r-- | mbbsd/user.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/mbbsd/user.c b/mbbsd/user.c index 09fa58e3..d57b6ba3 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -700,11 +700,34 @@ uinfo_query(userec_t *u, int adminmode, int unum) do { getdata_str(y, 0, "電子信箱 [變動要重新認證]:", buf, sizeof(x.email), DOECHO, x.email); + // TODO 這裡也要 emaildb_check +#ifdef USE_EMAILDB + if (isvalidemail(buf)) + { + int email_count = emaildb_check_email(buf, strlen(buf)); + if (email_count < 0) + vmsg("暫時不允許\ email 認證, 請稍後再試"); + else if (email_count >= EMAILDB_LIMIT) + vmsg("指定的 E-Mail 已註冊過多帳號, 請使用其他 E-Mail"); + else // valid + break; + } + continue; +#endif } while (!isvalidemail(buf) && vmsg("認證信箱不能用使用免費信箱")); y++; // admins may want to use special names if (strcmp(buf, x.email) && (strchr(buf, '@') || adminmode)) { + + // TODO 這裡也要 emaildb_check +#ifdef USE_EMAILDB + if (emaildb_update_email(cuser.userid, strlen(cuser.userid), + buf, strlen(buf)) < 0) { + vmsg("暫時不允許\ email 認證, 請稍後再試"); + break; + } +#endif strlcpy(x.email, buf, sizeof(x.email)); mail_changed = 1; delregcodefile(); |