diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-01-05 10:27:34 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-01-05 10:27:34 +0800 |
commit | 17c4b2bd5db1169e22c9adca2d86559a1ed03f5c (patch) | |
tree | a7e01e7171bbafecb01f17aac15571a49716c210 | |
parent | 7f932124a262a697c7fb05797e00581425f5fd45 (diff) | |
download | pttbbs-17c4b2bd5db1169e22c9adca2d86559a1ed03f5c.tar pttbbs-17c4b2bd5db1169e22c9adca2d86559a1ed03f5c.tar.gz pttbbs-17c4b2bd5db1169e22c9adca2d86559a1ed03f5c.tar.bz2 pttbbs-17c4b2bd5db1169e22c9adca2d86559a1ed03f5c.tar.lz pttbbs-17c4b2bd5db1169e22c9adca2d86559a1ed03f5c.tar.xz pttbbs-17c4b2bd5db1169e22c9adca2d86559a1ed03f5c.tar.zst pttbbs-17c4b2bd5db1169e22c9adca2d86559a1ed03f5c.zip |
- admin/reg: fix offset by one on rejection
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3787 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/admin.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/mbbsd/admin.c b/mbbsd/admin.c index 7509f235..d659b4fa 100644 --- a/mbbsd/admin.c +++ b/mbbsd/admin.c @@ -1229,10 +1229,10 @@ scan_register_form(const char *regfile, int automode, int neednum) } else ans[0] = 's'; - if ('A' <= ans[0] && ans[0] <= 'Z') - ans[0] += 32; - if (ans[0] != 'y' && ans[0] != 'n' && ans[0] != 'q' && - ans[0] != 'd' && !('0' <= ans[0] && ans[0] <= '4')) + ans[0] = tolower(ans[0]); + if (ans[0] != 'y' && ans[0] != 'n' && + ans[0] != 'q' && ans[0] != 'd' && + !('0' <= ans[0] && ans[0] < ('0' + REJECT_REASONS))) ans[0] = 's'; ans[1] = 0; } @@ -1258,8 +1258,9 @@ scan_register_form(const char *regfile, int automode, int neednum) } case 'd': break; + case '0': case '1': case '2': - case '3': case '4': + case '3': case '4': case '5': /* please confirm match REJECT_REASONS here */ case 'n': if (ans[0] == 'n') { @@ -1267,13 +1268,14 @@ scan_register_form(const char *regfile, int automode, int neednum) move(8, 0); clrtobot(); outs("請提出退回申請表原因,按 <enter> 取消\n"); - for (n = 0; reason[n]; n++) + for (n = 0; n < REJECT_REASONS; n++) prints("%d) 請%s\n", n, reason[n]); outs("\n"); // preserved for prompt for (nf = 0; field[nf]; nf++) prints("%s: %s\n", finfo[nf], fdata[nf]); } else buf[0] = ans[0]; + if (ans[0] != 'n' || getdata(9 + n, 0, "退回原因:", buf, 60, DOECHO)) if ((buf[0] - '0') >= 0 && (buf[0] - '0') < n) { @@ -1341,6 +1343,8 @@ scan_register_form(const char *regfile, int automode, int neednum) snprintf(genbuf, sizeof(genbuf), "%s:%s:%s", fdata[4], fdata[2], uid); strlcpy(muser.justify, genbuf, sizeof(muser.justify)); + + // XXX TODO notify users? passwd_update(unum, &muser); sethomefile(buf, muser.userid, "justify"); |