diff options
-rw-r--r-- | mbbsd/register.c | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/mbbsd/register.c b/mbbsd/register.c index 230c1d9a..092203a0 100644 --- a/mbbsd/register.c +++ b/mbbsd/register.c @@ -856,7 +856,8 @@ toregister(char *email, char *phone, char *career, char *mobile) while (1) { email[0] = 0; getfield(15, "�����{�ҥ�", "E-Mail Address", email, 50); - if (strcmp(email, "x") == 0 || strcmp(email, "X") == 0) + if (strcmp(email, "X") == 0) email[0] = 'x'; + if (strcmp(email, "x") == 0) break; #ifdef HAVEMOBILE else if (strcmp(email, "m") == 0 || strcmp(email, "M") == 0) { @@ -1875,9 +1876,8 @@ ui_display_regform_single( return 's'; } -// sample validator void -regform2_validate_single() +regform2_validate_single(const char *xuid) { int lfd = 0; int tid = 0; @@ -1895,6 +1895,10 @@ regform2_validate_single() int unum = 0; int abort = 0; + // if target assigned, loop until given target. + if (xuid && strcasecmp(uid, xuid) != 0) + continue; + // check if user exists. memset(&muser, 0, sizeof(muser)); unum = getuser(uid, &muser); @@ -1975,7 +1979,10 @@ regform2_validate_single() // finishing clear(); move(5, 0); - prints("�z�f�F %d �����U��C", tid); + if (xuid && tid == 0) + prints("���o�{ %s �����U��C", xuid); + else + prints("�z�f�F %d �����U��C", tid); pressanykey(); } @@ -3114,15 +3121,26 @@ m_register(void) } #endif fclose(fn); + +#ifdef USE_REGFORM2 getdata(b_lines - 1, 0, - "�}�l�f�ֶ�(Auto�۰�/Yes���/No���f/Exp�s�ɭ�)�H[N] ", + "�}�l�f�ֶ� (Y:�浧�Ҧ�/N:���f/E:�㭶�Ҧ�/U:���wID)�H[N] ", ans, sizeof(ans), LCECHO); -#ifdef USE_REGFORM2 + if (ans[0] == 'y') - regform2_validate_single(); + regform2_validate_single(NULL); else if (ans[0] == 'e') regform2_validate_page(1); + else if (ans[0] == 'u') { + stand_title("���w�f��"); + usercomplete(msg_uid, genbuf); + if (genbuf[0]) + regform2_validate_single(genbuf); + } #else + getdata(b_lines - 1, 0, + "�}�l�f�ֶ�(Auto�۰�/Yes���/No���f/Exp�s�ɭ�)�H[N] ", + ans, sizeof(ans), LCECHO); if (ans[0] == 'a') scan_register_form(fn_register, 1, NULL); else if (ans[0] == 'y') @@ -3153,12 +3171,16 @@ m_register(void) int cat_register(void) { +#ifdef USE_REGFORM2 + vmsg("�s�t�Τ��ݭn���\��C�Y�����~�Ъ������i�C"); +#else if (system("cat register.new.tmp >> register.new") == 0 && unlink("register.new.tmp") == 0) vmsg("OK �P~~ �~��h�İ��a!!"); else vmsg("�S��kCAT�L�h�O �h�ˬd�@�U�t�Χa!!"); return 0; +#endif // !USE_REGFORM2 } /* vim:sw=4 |