diff options
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/bbs.c | 2 | ||||
-rw-r--r-- | mbbsd/board.c | 2 | ||||
-rw-r--r-- | mbbsd/fav.c | 8 | ||||
-rw-r--r-- | mbbsd/register.c | 13 | ||||
-rw-r--r-- | mbbsd/user.c | 3 |
5 files changed, 21 insertions, 7 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 34aa40cf..27b623e0 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -3727,7 +3727,7 @@ const onekey_t read_comms[] = { { 1, edit_post }, // 'E' { 0, NULL }, // 'F' { 0, NULL }, // 'G' - { 0, NULL }, // 'H' + { 0, b_moved_to_config }, // 'H' { 0, b_config }, // 'I' #ifdef USE_COOLDOWN { 0, change_cooldown }, // 'J' diff --git a/mbbsd/board.c b/mbbsd/board.c index 046e8761..178bd212 100644 --- a/mbbsd/board.c +++ b/mbbsd/board.c @@ -1429,7 +1429,7 @@ choose_board(int newflag) if (IS_LISTING_FAV()){ assert(nbrdsize>0); if(get_fav_type(&nbrd[0]) != 0) - fav_tag(ptr->bid, get_fav_type(ptr), 2); + fav_tag(ptr->bid, get_fav_type(ptr), EXCH); } else if (HasUserPerm(PERM_SYSOP) || HasUserPerm(PERM_SYSSUPERSUBOP) || diff --git a/mbbsd/fav.c b/mbbsd/fav.c index b3cbc411..5f782599 100644 --- a/mbbsd/fav.c +++ b/mbbsd/fav.c @@ -183,14 +183,14 @@ inline static int get_line_num(fav_t *fp) { /** * 設定某個 flag。 * @bit: 目前所有 flags 有: FAVH_FAV, FAVH_TAG, FAVH_UNREAD, FAVH_ADM_TAG - * @param bool: FALSE: unset, TRUE: set, EXCH: opposite + * @param cmd: FALSE: unset, TRUE: set, EXCH: opposite */ -void set_attr(fav_type_t *ft, int bit, char bool){ +void set_attr(fav_type_t *ft, int bit, char cmd){ if (ft == NULL) return; - if (bool == EXCH) + if (cmd == EXCH) ft->attr ^= bit; - else if (bool == TRUE) + else if (cmd == TRUE) ft->attr |= bit; else ft->attr &= ~bit; 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()) diff --git a/mbbsd/user.c b/mbbsd/user.c index 192131c8..c58e2472 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -698,7 +698,8 @@ uinfo_query(userec_t *u, int adminmode, int unum) case 'm': do { - getdata_str(y, 0, "電子信箱[變動要重新認證]:", buf, + getdata_str(y, 0, adminmode ? "電子信箱 (站長可設為 x ): " + : "電子信箱 [變動要重新認證]:", buf, sizeof(x.email), DOECHO, x.email); } while (!isvalidemail(buf) && vmsg("認證信箱不能用使用免費信箱")); y++; |