diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-05-23 23:43:40 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-05-23 23:43:40 +0800 |
commit | 2a754ed8d38bfe6b64aa74c11eced827ba97be83 (patch) | |
tree | 72054dd04d306d66a43158df66eafa441aa96e8e | |
parent | a1d31eed1c0c90d5da1f0c34016278f11ccd0733 (diff) | |
download | pttbbs-2a754ed8d38bfe6b64aa74c11eced827ba97be83.tar pttbbs-2a754ed8d38bfe6b64aa74c11eced827ba97be83.tar.gz pttbbs-2a754ed8d38bfe6b64aa74c11eced827ba97be83.tar.bz2 pttbbs-2a754ed8d38bfe6b64aa74c11eced827ba97be83.tar.lz pttbbs-2a754ed8d38bfe6b64aa74c11eced827ba97be83.tar.xz pttbbs-2a754ed8d38bfe6b64aa74c11eced827ba97be83.tar.zst pttbbs-2a754ed8d38bfe6b64aa74c11eced827ba97be83.zip |
refine: reduce the i/o request to check reserved id
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4464 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | include/common.h | 2 | ||||
-rw-r--r-- | mbbsd/register.c | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/include/common.h b/include/common.h index 655c06b9..7ada007b 100644 --- a/include/common.h +++ b/include/common.h @@ -33,7 +33,7 @@ #define FN_TICKET_BRDLIST "boardlist" #define FN_BRDLISTHELP "etc/boardlist.help" #define FN_BOARDHELP "etc/board.help" -#define FN_RESERVED_ID "etc/reserved.id" // 保留系統用無法註冊的 ID +#define FN_RESERVED_ID "etc/reserved.id" // 保留系統用無法註冊的 ID #define FN_USERMEMO "memo.txt" // 使用者個人記事本 diff --git a/mbbsd/register.c b/mbbsd/register.c index b06b8400..427d1b9d 100644 --- a/mbbsd/register.c +++ b/mbbsd/register.c @@ -722,8 +722,6 @@ new_register(void) if (bad_user_id(passbuf)) outs("無法接受這個代號,請使用英文字母,並且不要包含空格\n"); - else if (reserved_user_id(passbuf)) - outs("此代號已由保留,請使用別的代號\n"); else if ((id = getuser(passbuf, &xuser)) && // >=: see check_and_expire_account definition (minute = check_and_expire_account(id, &xuser, 0)) >= 0) @@ -734,7 +732,10 @@ new_register(void) prints("此代號已經有人使用 還有 %d 天才過期 \n", minute / (60 * 24) + 1); } - } else + } + else if (reserved_user_id(passbuf)) + outs("此代號已由保留,請使用別的代號\n"); + else // success break; } |