summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-10-16 21:04:11 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-10-16 21:04:11 +0800
commitd87c20433e1a16e5ec3d31b00c1dd491e995b1ea (patch)
treed1d386480b2c2ce571162f00c6b6bc8fbbe6005b
parent383a53ce44b3055ed90cfbd3608308e2ad5b5164 (diff)
downloadpttbbs-d87c20433e1a16e5ec3d31b00c1dd491e995b1ea.tar
pttbbs-d87c20433e1a16e5ec3d31b00c1dd491e995b1ea.tar.gz
pttbbs-d87c20433e1a16e5ec3d31b00c1dd491e995b1ea.tar.bz2
pttbbs-d87c20433e1a16e5ec3d31b00c1dd491e995b1ea.tar.lz
pttbbs-d87c20433e1a16e5ec3d31b00c1dd491e995b1ea.tar.xz
pttbbs-d87c20433e1a16e5ec3d31b00c1dd491e995b1ea.tar.zst
pttbbs-d87c20433e1a16e5ec3d31b00c1dd491e995b1ea.zip
register
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@538 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/user.c52
1 files changed, 33 insertions, 19 deletions
diff --git a/mbbsd/user.c b/mbbsd/user.c
index 3745cd47..d77d6721 100644
--- a/mbbsd/user.c
+++ b/mbbsd/user.c
@@ -1,4 +1,4 @@
-/* $Id: user.c,v 1.38 2002/09/01 18:28:45 in2 Exp $ */
+/* $Id: user.c,v 1.39 2002/10/16 13:04:11 in2 Exp $ */
#include "bbs.h"
static char *sex[8] = {
@@ -761,6 +761,9 @@ ispersonalid(char *inid)
if (!isalpha(id[0]) && (strlen(id) != 10))
return 0;
id[0] = toupper(id[0]);
+
+ if( strcmp(id, "A100000001") == 0 )
+ return 0;
/* A->10, B->11, ..H->17,I->34, J->18... */
while (lst[i] != id[0])
i++;
@@ -1035,33 +1038,39 @@ u_register(void)
move(1, 0);
prints("%s(%s) �z�n�A�оڹ��g�H�U�����:",
cuser.userid, cuser.username);
- do {
- getfield(3, "D120908396", "�����Ҹ�", ident, 11);
+ while( 1 ){
+ getfield(3, "D123456789", "�����Ҹ�", ident, 11);
if ('a' <= ident[0] && ident[0] <= 'z')
ident[0] -= 32;
- } while (!ispersonalid(ident));
+ if( ispersonalid(ident) )
+ break;
+ vmsg("�z����J�����T(�Y�����D�·Ц�SYSOP�O)");
+ }
while (1) {
getfield(5, "�ХΤ���", "�u��m�W", rname, 20);
if (removespace(rname) && rname[0] < 0 &&
!strstr(rname, "��") && !strstr(rname, "�p") &&
!strstr(rname, "��") && strstr(rname, "..") == NULL &&
- !(strlen(rname) == 4 && strncmp(&rname[0], &rname[2], 2) == 0) )
+ !(strlen(rname) == 4 && strncmp(&rname[2], "��", 2) == 0) &&
+ !(strlen(rname) >= 4 && strncmp(&rname[0], &rname[2], 2) == 0))
break;
vmsg("�z����J�����T");
}
+ move(7, 0);
+ prints("�·бz�ɶq�ԲӪ���g�z���A�ȳ��, �j�M�|�սг·�"
+ "�[�t��, ���q���Х[¾��");
while (1) {
- getfield(7, "�Ǯ�(�t\033[1;33m�t�Ҧ~��\033[m)�γ��¾��",
+ getfield(8, "�Ǯ�(�t\033[1;33m�t�Ҧ~��\033[m)�γ��¾��",
"�A�ȳ��", career, 40);
if (!(removespace(career) && career[0] < 0
- && strlen(career) >= 4) ||
- strcmp(career, "�a��") == 0 ) {
+ && strlen(career) >= 6) ||
+ strcmp(career, "�a��") == 0 ||
+ strstr(career, "�Y") != NULL ) {
vmsg("�z����J�����T");
continue;
}
- if (strcmp(career, "�Ǯ�") == 0 ||
- strcmp(career, "�ǥ�") == 0 ||
- strcmp(&career[strlen(career) - 2], "�j") == 0 ||
+ if (strcmp(&career[strlen(career) - 2], "�j") == 0 ||
strcmp(&career[strlen(career) - 4], "�j��") == 0 ) {
vmsg("�·нХ[�Ǯըt��");
continue;
@@ -1069,7 +1078,7 @@ u_register(void)
break;
}
while (1) {
- getfield(9, "�t\033[1;33m����\033[m�Ϊ��츹�X"
+ getfield(10, "�t\033[1;33m����\033[m�Ϊ��츹�X"
"(�x�_�Х[\033[1;33m��F��\033[m)",
"�ثe���}", addr, 50);
if (!removespace(addr) || addr[0] > 0 || strlen(addr) < 15) {
@@ -1084,6 +1093,7 @@ u_register(void)
strstr(addr, "��") == NULL) ||
strstr(addr, "�a�y") != NULL ||
strstr(addr, "�Ȫe") != NULL ||
+ strstr(addr, "���P") != NULL ||
strstr(addr, "�Y") != NULL ||
strstr(addr, "..") != NULL ||
strcmp(&addr[strlen(addr) - 2], "�q") == 0 ||
@@ -1096,7 +1106,7 @@ u_register(void)
break;
}
while (1) {
- getfield(11, "���[-(), �]�A���~�ϸ�", "�s���q��", phone, 11);
+ getfield(12, "���[-(), �]�A���~�ϸ�", "�s���q��", phone, 11);
if (strstr(phone, "(") || strstr(phone, ")") || strstr(phone, "-")){
vmsg("�q�ܽФ��[ ( ) - �Ÿ�");
continue;
@@ -1108,12 +1118,12 @@ u_register(void)
}
break;
}
- getfield(13, "�u��J�Ʀr �p:0912345678 (�i����)",
+ getfield(14, "�u��J�Ʀr �p:0912345678 (�i����)",
"������X", mobile, 20);
while (1) {
int len;
- getfield(15, "���/���/�褸 �p:09/27/76", "�ͤ�", birthday, 9);
+ getfield(16, "���/���/�褸 �p:09/27/76", "�ͤ�", birthday, 9);
len = strlen(birthday);
if (!len) {
snprintf(birthday, sizeof(birthday), "%02i/%02i/%02i",
@@ -1125,15 +1135,19 @@ u_register(void)
mon = (birthday[0] - '0') * 10 + (birthday[1] - '0');
day = (birthday[3] - '0') * 10 + (birthday[4] - '0');
year = (birthday[6] - '0') * 10 + (birthday[7] - '0');
- } else
+ } else{
+ vmsg("�z����J�����T");
continue;
+ }
if (mon > 12 || mon < 1 || day > 31 || day < 1 || year > 90 ||
- year < 40)
+ year < 40){
+ vmsg("�z����J�����T");
continue;
+ }
break;
}
- getfield(17, "1.���� 2.�j�� ", "�ʧO", sex_is, 2);
- getdata(18, 0, "�H�W��ƬO�_���T(Y/N)�H(Q)�������U [N] ",
+ getfield(18, "1.���� 2.�j�� ", "�ʧO", sex_is, 2);
+ getdata(19, 0, "�H�W��ƬO�_���T(Y/N)�H(Q)�������U [N] ",
ans, sizeof(ans), LCECHO);
if (ans[0] == 'q')
return 0;