diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-01-28 15:54:24 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-01-28 15:54:24 +0800 |
commit | 4b2facc1a39a7816040f581843d39e442f887669 (patch) | |
tree | a0cbfb171492509ea124a5a0fc7871980eb03926 /mbbsd/register.c | |
parent | 586b0b226ad5c5582fec6fae4ea42960d581ddb3 (diff) | |
download | pttbbs-4b2facc1a39a7816040f581843d39e442f887669.tar pttbbs-4b2facc1a39a7816040f581843d39e442f887669.tar.gz pttbbs-4b2facc1a39a7816040f581843d39e442f887669.tar.bz2 pttbbs-4b2facc1a39a7816040f581843d39e442f887669.tar.lz pttbbs-4b2facc1a39a7816040f581843d39e442f887669.tar.xz pttbbs-4b2facc1a39a7816040f581843d39e442f887669.tar.zst pttbbs-4b2facc1a39a7816040f581843d39e442f887669.zip |
- user: hinting on SYSOP permission update of setting email
- register: improve new-account process
- bbs: hints on hotkey change(H)
- board/fav: make TAG bits more meaningful.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3876 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/register.c')
-rw-r--r-- | mbbsd/register.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/mbbsd/register.c b/mbbsd/register.c index 9d0b6852..1eb745a7 100644 --- a/mbbsd/register.c +++ b/mbbsd/register.c @@ -86,8 +86,10 @@ compute_user_value(const userec_t * urec, time4_t clock) value = (clock - urec->lastlogin) / 60; /* minutes */ /* new user should register in 30 mins */ + // XXX 目前 new acccount 並不會在 utmp 裡放 str_new... if (strcmp(urec->userid, str_new) == 0) return 30 - value; + #if 0 if (!urec->numlogins) /* 未 login 成功者,不保留 */ return -1; @@ -132,6 +134,13 @@ setupnewuser(const userec_t *user) clock = now; + // XXX race condition... + if (dosearchuser(user->userid, NULL)) + { + vmsg("手腳不夠快,別人已經搶走了!"); + exit(1); + } + /* Lazy method : 先找尋已經清除的過期帳號 */ if ((uid = dosearchuser("", NULL)) == 0) { /* 每 1 個小時,清理 user 帳號一次 */ @@ -206,6 +215,7 @@ new_register(void) vmsg("請輸入 y表示接受, n表示不接受"); } #endif + memset(&newuser, 0, sizeof(newuser)); more("etc/register", NA); try = 0; @@ -235,6 +245,8 @@ new_register(void) break; } + // XXX 記得最後 create account 前還要再檢查一次 acc + try = 0; while (1) { if (++try >= 6) { @@ -266,6 +278,7 @@ new_register(void) newuser.firstlogin = newuser.lastlogin = now; newuser.money = 0; newuser.pager = PAGER_ON; + strlcpy(newuser.lasthost, fromhost, sizeof(newuser.lasthost)); #ifdef DBCSAWARE if(u_detectDBCSAwareEvilClient()) |