summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mbbsd/admin.c30
-rw-r--r--mbbsd/user.c10
2 files changed, 22 insertions, 18 deletions
diff --git a/mbbsd/admin.c b/mbbsd/admin.c
index 6251d239..7d024957 100644
--- a/mbbsd/admin.c
+++ b/mbbsd/admin.c
@@ -1087,18 +1087,24 @@ scan_register_form(char *regfile, int automode, int neednum)
outs("也就是大概二十分之一的數量,當然,您也可以多審\n沒審完之前,系統不會讓你跳出喲!謝謝");
pressanykey();
}
- memset(fdata, 0, sizeof(fdata));
- while (fgets(genbuf, STRLEN, fn)) {
- if ((ptr = (char *)strstr(genbuf, ": "))) {
- *ptr = '\0';
- for (n = 0; field[n]; n++) {
- if (strcmp(genbuf, field[n]) == 0) {
- strlcpy(fdata[n], ptr + 2, sizeof(fdata[n]));
- if ((ptr = (char *)strchr(fdata[n], '\n')))
- *ptr = '\0';
+ while( fgets(genbuf, STRLEN, fn) ){
+ memset(fdata, 0, sizeof(fdata));
+ do {
+ if( genbuf[0] == '-' )
+ break;
+ if ((ptr = (char *)strstr(genbuf, ": "))) {
+ *ptr = '\0';
+ for (n = 0; field[n]; n++) {
+ if (strcmp(genbuf, field[n]) == 0) {
+ strlcpy(fdata[n], ptr + 2, sizeof(fdata[n]));
+ if ((ptr = (char *)strchr(fdata[n], '\n')))
+ *ptr = '\0';
+ }
}
}
- } else if ((unum = getuser(fdata[0], &muser)) == 0) {
+ } while( fgets(genbuf, STRLEN, fn) );
+
+ if ((unum = getuser(fdata[0], &muser)) == 0) {
move(2, 0);
clrtobot();
outs("系統錯誤,查無此人\n\n");
@@ -1120,9 +1126,9 @@ scan_register_form(char *regfile, int automode, int neednum)
move(14, 0);
prints("\033[1;32m------------- 請站長嚴格審核使用者資料,您還有 %d 份---------------\033[m\n", neednum);
prints(" %-12s:%s\n", finfo[0], fdata[0]);
- prints(" %-12s:%s\n", finfo[1], fdata[1]);
#ifdef FOREIGN_REG
- prints("0.%-12s:%s%s\n", finfo[2], fdata[2], muser.uflag2 & FOREIGN ? " (外籍)" : "");
+ prints("0.%-12s:%s%s\n", finfo[2], fdata[2],
+ muser.uflag2 & FOREIGN ? " (外籍)" : "");
#else
prints("0.%-12s:%s\n", finfo[2], fdata[2]);
#endif
diff --git a/mbbsd/user.c b/mbbsd/user.c
index 2559bdc3..9327dd59 100644
--- a/mbbsd/user.c
+++ b/mbbsd/user.c
@@ -1029,8 +1029,8 @@ toregister(char *email, char *genbuf, char *phone, char *career,
if (phone[0] != 0) {
fn = fopen(buf, "w");
assert(fn);
- fprintf(fn, "%s\n%s\n%s\n%s\n%s\n%s\n",
- phone, career, ident, rname, addr, mobile);
+ fprintf(fn, "%s\n%s\ndummy\n%s\n%s\n%s\n",
+ phone, career, rname, addr, mobile);
fclose(fn);
}
clear();
@@ -1098,7 +1098,7 @@ toregister(char *email, char *genbuf, char *phone, char *career,
if ((fn = fopen(fn_register, "a"))) {
fprintf(fn, "num: %d, %s", usernum, ctime4(&now));
fprintf(fn, "uid: %s\n", cuser.userid);
- fprintf(fn, "ident: %s\n", ident);
+ fprintf(fn, "ident: \n");
fprintf(fn, "name: %s\n", rname);
fprintf(fn, "career: %s\n", career);
fprintf(fn, "addr: %s\n", addr);
@@ -1304,9 +1304,7 @@ u_register(void)
chomp(genbuf);
strlcpy(career, genbuf, sizeof(career));
- fgets(genbuf, sizeof(genbuf), fn);
- chomp(genbuf);
- strlcpy(ident, genbuf, sizeof(ident));
+ fgets(genbuf, sizeof(genbuf), fn); // old version compatible
fgets(genbuf, sizeof(genbuf), fn);
chomp(genbuf);