diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-04-17 23:44:28 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-04-17 23:44:28 +0800 |
commit | de354f73c4a69c9349102cbc8dd507a0d616bc9d (patch) | |
tree | b7162cbedfc357e54e31674c9cf4dffcb0c08794 /mbbsd | |
parent | 5085764644bc8d6540481eb6a08c8c1baaa66291 (diff) | |
download | pttbbs-de354f73c4a69c9349102cbc8dd507a0d616bc9d.tar pttbbs-de354f73c4a69c9349102cbc8dd507a0d616bc9d.tar.gz pttbbs-de354f73c4a69c9349102cbc8dd507a0d616bc9d.tar.bz2 pttbbs-de354f73c4a69c9349102cbc8dd507a0d616bc9d.tar.lz pttbbs-de354f73c4a69c9349102cbc8dd507a0d616bc9d.tar.xz pttbbs-de354f73c4a69c9349102cbc8dd507a0d616bc9d.tar.zst pttbbs-de354f73c4a69c9349102cbc8dd507a0d616bc9d.zip |
- register: add log for "assigning specific user to validate".
- visio: better check to prevent input half big5 characters
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4181 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/register.c | 28 | ||||
-rw-r--r-- | mbbsd/visio.c | 15 |
2 files changed, 23 insertions, 20 deletions
diff --git a/mbbsd/register.c b/mbbsd/register.c index 48bc9534..899e78c8 100644 --- a/mbbsd/register.c +++ b/mbbsd/register.c @@ -1354,7 +1354,8 @@ append_regform(const RegformEntry *pre, const char *logfn, static void regform_print_reasons(const char *reason, FILE *fp); void -regform_log2board(const RegformEntry *pre, char accept, const char *reason) +regform_log2board(const RegformEntry *pre, char accept, + const char *reason, int priority) { #ifdef BN_ID_RECORD char fn[PATHLEN]; @@ -1363,8 +1364,10 @@ regform_log2board(const RegformEntry *pre, char accept, const char *reason) char *title2 = NULL; snprintf(title, sizeof(title), - "[審核結果] %s: %s (審核者: %s)", - accept ? "通過":"退回", pre->userid, cuser.userid); + "[審核] %s: %s (%s: %s)", + accept ? "○通過":"╳退回", pre->userid, + priority ? "指定審核" : "審核者", + cuser.userid); // reduce mail header title title2 = strchr(title, ' '); @@ -1682,7 +1685,7 @@ regfrm_unlock(int lockfd) // regform processors int -regfrm_accept(RegformEntry *pre) +regfrm_accept(RegformEntry *pre, int priority) { char justify[REGLEN+1], buf[STRLEN*2]; char fn[PATHLEN], fnlog[PATHLEN]; @@ -1714,7 +1717,7 @@ regfrm_accept(RegformEntry *pre) cuser.userid, pre->userid, Cdate(&now)); file_append_line(FN_REGISTER_LOG, buf); AppendTail(fn, FN_REGISTER_LOG, 0); - regform_log2board(pre, 1, NULL); + regform_log2board(pre, 1, NULL, priority); // remove from queue unlink(fn); @@ -1723,7 +1726,7 @@ regfrm_accept(RegformEntry *pre) } int -regfrm_reject(RegformEntry *pre, const char *reason) +regfrm_reject(RegformEntry *pre, const char *reason, int priority) { char buf[STRLEN*2]; char fn[PATHLEN]; @@ -1744,7 +1747,7 @@ regfrm_reject(RegformEntry *pre, const char *reason) cuser.userid, pre->userid, reason, Cdate(&now)); file_append_line(FN_REGISTER_LOG, buf); AppendTail(fn, FN_REGISTER_LOG, 0); - regform_log2board(pre, 0, reason); + regform_log2board(pre, 0, reason, priority); // remove from queue unlink(fn); @@ -1888,6 +1891,9 @@ regform2_validate_single(const char *xuid) FILE *fpregq = regq_init_pull(); RegformEntry re; + if (xuid && !*xuid) + xuid = NULL; + if (!fpregq) return; @@ -1947,7 +1953,7 @@ regform2_validate_single(const char *xuid) switch(ui_display_regform_single(&muser, &re, tid, rsn)) { case 'y': // accept - regfrm_accept(&re); + regfrm_accept(&re, xuid ? 1 : 0); break; case 'd': // delete @@ -1959,7 +1965,7 @@ regform2_validate_single(const char *xuid) break; case 'n': // reject - regfrm_reject(&re, rsn); + regfrm_reject(&re, rsn, xuid ? 1 : 0); break; case 's': // skip @@ -2325,7 +2331,7 @@ regform2_validate_page(int dryrun) switch(ans[i]) { case 'y': // accept - regfrm_accept(&forms[i]); + regfrm_accept(&forms[i], 0); break; case 'd': // delete @@ -2333,7 +2339,7 @@ regform2_validate_page(int dryrun) break; case 'n': // reject - regfrm_reject(&forms[i], rejects[i]); + regfrm_reject(&forms[i], rejects[i], 0); break; case 's': // skip diff --git a/mbbsd/visio.c b/mbbsd/visio.c index b0949d01..5a72b698 100644 --- a/mbbsd/visio.c +++ b/mbbsd/visio.c @@ -1013,18 +1013,15 @@ vgetstring(char *_buf, int len, int flags, const char *defstr, const VGET_CALLBA { bell(); continue; } + // prevent incomplete DBCS - // this check only works if DBCS-aware is active. - // Otherwise, non-DBCS-aware users will fail to - // input the final DBCS-TRAIL character. -#ifdef DBCSAWARE - if (ISDBCSAWARE() && - c > 0x80 && iend+2 >= len && - !CHKDBCSTRAIL(buf, icurr) ) + if (c > 0x80 && num_in_buf() && + len - iend < 3) // we need 3 for DBCS+NUL. { - bell(); continue; + drop_input(); + bell(); + continue; } -#endif // DBCSAWARE // callback 2: data if (_vgetcbhandler(cb.data, &abort, |