diff options
Diffstat (limited to 'mbbsd/admin.c')
-rw-r--r-- | mbbsd/admin.c | 320 |
1 files changed, 161 insertions, 159 deletions
diff --git a/mbbsd/admin.c b/mbbsd/admin.c index 30a2fd65..dc0f9cec 100644 --- a/mbbsd/admin.c +++ b/mbbsd/admin.c @@ -10,16 +10,16 @@ m_loginmsg() clrtobot(); if(SHM->loginmsg.pid && SHM->loginmsg.pid != currutmp->pid) { - prints(I18N[0]); + prints(gettext[0]); getmessage(SHM->loginmsg); } getdata(22, 0, - I18N[1], + gettext[1], msg, 3, LCECHO); if(msg[0]=='y' && - getdata_str(23, 0, I18N[2], msg, 56, DOECHO, SHM->loginmsg.last_call_in)) + getdata_str(23, 0, gettext[2], msg, 56, DOECHO, SHM->loginmsg.last_call_in)) { SHM->loginmsg.pid=currutmp->pid; /*站長不多 就不管race condition */ strcpy(SHM->loginmsg.last_call_in, msg); @@ -36,7 +36,7 @@ m_user() int id; char genbuf[200]; - stand_title(I18N[3]); + stand_title(gettext[3]); usercomplete(msg_uid, genbuf); if (*genbuf) { move(2, 0); @@ -66,13 +66,13 @@ search_key_user(char *passwdfile, int mode) assert(fp1); clear(); - getdata(0, 0, mode ? I18N[4] : I18N[5], key, sizeof(key), DOECHO); + getdata(0, 0, mode ? gettext[4] : gettext[5], key, sizeof(key), DOECHO); if(!key[0]) return 0; while ((fread(&user, sizeof(user), 1, fp1)) > 0 && coun < MAX_USERS) { if (!(++coun & 15)) { move(1, 0); - prints(I18N[6], coun); + prints(gettext[6], coun); refresh(); } keymatch = NULL; @@ -98,15 +98,15 @@ search_key_user(char *passwdfile, int mode) } if(keymatch) { move(1, 0); - prints(I18N[7], coun); + prints(gettext[7], coun); refresh(); user_display(&user, 1); uinfo_query(&user, 1, coun); - outs(I18N[8]); + outs(gettext[8]); outs(mode ? " A: add to namelist \033[m " : - I18N[9]); + gettext[9]); while (1) { while ((ch = igetch()) == 0); if (ch == 'a' || ch=='A' ) @@ -132,26 +132,25 @@ search_key_user(char *passwdfile, int mode) fclose(fp1); return 0; } else { - move(b_lines - 1, 0); getdata(0, 0, - I18N[10], + gettext[10], genbuf, 3, LCECHO); if (genbuf[0] != 'y') { - outs(I18N[11]); + outs(gettext[11]); } else { int allocid = getnewuserid(); if (allocid > MAX_USERS || allocid <= 0) { - fprintf(stderr, I18N[12]); + fprintf(stderr, gettext[12]); exit(1); } if (passwd_update(allocid, &user) == -1) { - fprintf(stderr, I18N[13]); + fprintf(stderr, gettext[13]); exit(1); } setuserid(allocid, user.userid); if (!searchuser(user.userid)) { - fprintf(stderr, I18N[14]); + fprintf(stderr, gettext[14]); exit(1); } fclose(fp1); @@ -188,13 +187,13 @@ search_user_bybakpwd() clear(); move(1, 1); - outs(I18N[15]); - outs(I18N[16]); - outs(I18N[17]); - outs(I18N[18]); + outs(gettext[15]); + outs(gettext[16]); + outs(gettext[17]); + outs(gettext[18]); do { move(5, 1); - outs(I18N[19]); + outs(gettext[19]); ch = igetch(); if (ch == 'q' || ch == 'Q') return 0; @@ -207,8 +206,8 @@ search_user_bybakpwd() static void bperm_msg(boardheader_t * board) { - prints(I18N[20], board->brdname, - board->brdattr & BRD_POSTMASK ? I18N[21] : I18N[22]); + prints(gettext[20], board->brdname, + board->brdattr & BRD_POSTMASK ? gettext[21] : gettext[22]); } unsigned int @@ -220,15 +219,15 @@ setperms(unsigned int pbits, int *pstring) move(4, 0); for (i = 0; i < NUMPERMS / 2; i++) { prints("%c. %-20s %-15s %c. %-20s %s\n", - 'A' + i, I18N[pstring[i]], - ((pbits >> i) & 1 ? I18N[23] : I18N[24]), + 'A' + i, gettext[pstring[i]], + ((pbits >> i) & 1 ? gettext[23] : gettext[24]), i < 10 ? 'Q' + i : '0' + i - 10, - I18N[pstring[i + 16]], - ((pbits >> (i + 16)) & 1 ? I18N[25] : I18N[26])); + gettext[pstring[i + 16]], + ((pbits >> (i + 16)) & 1 ? gettext[25] : gettext[26])); } clrtobot(); while( - (i = getkey(I18N[27]))!='\r') + (i = getkey(gettext[27]))!='\r') { i = i - 'a'; if (i < 0) @@ -238,7 +237,7 @@ setperms(unsigned int pbits, int *pstring) else { pbits ^= (1 << i); move(i % 16 + 4, i <= 15 ? 24 : 64); - prints((pbits >> i) & 1 ? I18N[28] : I18N[29]); + prints((pbits >> i) & 1 ? gettext[28] : gettext[29]); } } return pbits; @@ -259,7 +258,7 @@ void delete_symbolic_link(boardheader_t *bh, int bid) memset(bh, 0, sizeof(boardheader_t)); substitute_record(fn_board, bh, sizeof(boardheader_t), bid); reset_board(bid); - sort_bcache(); + sort_bcache(); log_usies("DelLink", bh->brdname); } @@ -276,14 +275,14 @@ m_mod_board(char *bname) pressanykey(); return -1; } - prints(I18N[30], bh.brdname, bh.title, bid, bh.gid, bh.BM); + prints(gettext[30], bh.brdname, bh.title, bid, bh.gid, bh.BM); bperm_msg(&bh); /* Ptt 這邊斷行會檔到下面 */ move(9, 0); - snprintf(genbuf, sizeof(genbuf), I18N[31], - HAS_PERM(PERM_SYSOP) ? I18N[32] : "", - HAS_PERM(PERM_SYSSUBOP) ? I18N[33] : ""); + snprintf(genbuf, sizeof(genbuf), gettext[31], + HAS_PERM(PERM_SYSOP) ? gettext[32] : "", + HAS_PERM(PERM_SYSSUBOP) ? gettext[33] : ""); getdata(10, 0, genbuf, ans, sizeof(ans), LCECHO); switch (*ans) { @@ -310,8 +309,8 @@ m_mod_board(char *bname) memcpy(&newbh, &bh, sizeof(bh)); snprintf(bvotebuf, sizeof(bvotebuf), "%d", newbh.bvote); move(20, 0); - prints(I18N[34], bh.brdname, bh.bvote); - getdata_str(21, 0, I18N[35], genbuf, 5, LCECHO, bvotebuf); + prints(gettext[34], bh.brdname, bh.bvote); + getdata_str(21, 0, gettext[35], genbuf, 5, LCECHO, bvotebuf); newbh.bvote = atoi(genbuf); substitute_record(fn_board, &newbh, sizeof(newbh), bid); reset_board(bid); @@ -321,9 +320,9 @@ m_mod_board(char *bname) break; case 'v': memcpy(&newbh, &bh, sizeof(bh)); - outs(I18N[36]); - outs((bh.brdattr & BRD_BAD) ? I18N[37] : I18N[38]); - getdata(21, 0, I18N[39], genbuf, 5, LCECHO); + outs(gettext[36]); + outs((bh.brdattr & BRD_BAD) ? gettext[37] : gettext[38]); + getdata(21, 0, gettext[39], genbuf, 5, LCECHO); if (genbuf[0] == 'y') { if (newbh.brdattr & BRD_BAD) newbh.brdattr = newbh.brdattr & (!BRD_BAD); @@ -352,24 +351,24 @@ m_mod_board(char *bname) system(genbuf); memset(&bh, 0, sizeof(bh)); snprintf(bh.title, sizeof(bh.title), - I18N[40], bname, cuser.userid); - post_msg("Security", bh.title, I18N[41], I18N[42]); + gettext[40], bname, cuser.userid); + post_msg("Security", bh.title, gettext[41], gettext[42]); substitute_record(fn_board, &bh, sizeof(bh), bid); reset_board(bid); - sort_bcache(); + sort_bcache(); log_usies("DelBoard", bh.title); - outs(I18N[43]); + outs(gettext[43]); } break; case 'e': move(8, 0); - outs(I18N[44]); + outs(gettext[44]); memcpy(&newbh, &bh, sizeof(bh)); - while (getdata(9, 0, I18N[45], genbuf, IDLEN + 1, DOECHO)) { + while (getdata(9, 0, gettext[45], genbuf, IDLEN + 1, DOECHO)) { if (getbnum(genbuf)) { move(3, 0); - outs(I18N[46]); + outs(gettext[46]); } else if ( !invalid_brdname(genbuf) ){ strlcpy(newbh.brdname, genbuf, sizeof(newbh.brdname)); break; @@ -377,7 +376,7 @@ m_mod_board(char *bname) } do { - getdata_str(12, 0, I18N[47], genbuf, 5, DOECHO, bh.title); + getdata_str(12, 0, gettext[47], genbuf, 5, DOECHO, bh.title); if (strlen(genbuf) == 4) break; } while (1); @@ -387,11 +386,11 @@ m_mod_board(char *bname) newbh.title[4] = ' '; - getdata_str(14, 0, I18N[48], genbuf, BTLEN + 1, DOECHO, + getdata_str(14, 0, gettext[48], genbuf, BTLEN + 1, DOECHO, bh.title + 7); if (genbuf[0]) strlcpy(newbh.title + 7, genbuf, sizeof(newbh.title) - 7); - if (getdata_str(15, 0, I18N[49], genbuf, IDLEN * 3 + 3, DOECHO, + if (getdata_str(15, 0, gettext[49], genbuf, IDLEN * 3 + 3, DOECHO, bh.BM)) { trim(genbuf); strlcpy(newbh.BM, genbuf, sizeof(newbh.BM)); @@ -404,16 +403,16 @@ m_mod_board(char *bname) clrtobot(); } if (newbh.brdattr & BRD_GROUPBOARD) - strncpy(newbh.title + 5, I18N[50], 2); + strncpy(newbh.title + 5, gettext[50], 2); else if (newbh.brdattr & BRD_NOTRAN) - strncpy(newbh.title + 5, I18N[51], 2); + strncpy(newbh.title + 5, gettext[51], 2); else - strncpy(newbh.title + 5, I18N[52], 2); + strncpy(newbh.title + 5, gettext[52], 2); if (HAS_PERM(PERM_SYSOP) && !(newbh.brdattr & BRD_HIDE)) { - getdata_str(14, 0, I18N[53], ans, sizeof(ans), LCECHO, "N"); + getdata_str(14, 0, gettext[53], ans, sizeof(ans), LCECHO, "N"); if (*ans == 'y') { - getdata_str(15, 0, I18N[54], ans, sizeof(ans), LCECHO, + getdata_str(15, 0, gettext[54], ans, sizeof(ans), LCECHO, "R"); if (*ans == 'p') newbh.brdattr |= BRD_POSTMASK; @@ -427,7 +426,7 @@ m_mod_board(char *bname) clear(); } } - getdata(b_lines - 1, 0, I18N[55], genbuf, 4, LCECHO); + getdata(b_lines - 1, 0, gettext[55], genbuf, 4, LCECHO); if ((*genbuf != 'n') && memcmp(&newbh, &bh, sizeof(bh))) { if (strcmp(bh.brdname, newbh.brdname)) { @@ -444,7 +443,7 @@ m_mod_board(char *bname) setup_man(&newbh); substitute_record(fn_board, &newbh, sizeof(newbh), bid); reset_board(bid); - sort_bcache(); + sort_bcache(); log_usies("SetBoard", newbh.brdname); } } @@ -457,7 +456,7 @@ m_board() { char bname[32]; - stand_title(I18N[56]); + stand_title(gettext[56]); generalnamecomplete(msg_bid, bname, sizeof(bname), SHM->Bnumber, completeboard_compar, completeboard_permission, @@ -477,16 +476,16 @@ x_file() move(b_lines - 6, 0); /* Ptt */ - outs(I18N[57]); - outs(I18N[58]); - outs(I18N[59]); + outs(gettext[57]); + outs(gettext[58]); + outs(gettext[59]); #ifdef MULTI_WELCOME_LOGIN - outs(I18N[60]); + outs(gettext[60]); #endif outs("\n"); - outs(I18N[61]); - outs(I18N[62]); - getdata(b_lines - 1, 0, I18N[63], ans, sizeof(ans), LCECHO); + outs(gettext[61]); + outs(gettext[62]); + getdata(b_lines - 1, 0, gettext[63], ans, sizeof(ans), LCECHO); switch (ans[0]) { case '1': @@ -527,7 +526,7 @@ x_file() break; case 'g': #ifdef MULTI_WELCOME_LOGIN - getdata(b_lines - 1, 0, I18N[64], ans, sizeof(ans), LCECHO); + getdata(b_lines - 1, 0, gettext[64], ans, sizeof(ans), LCECHO); if (ans[0] == '1') { fpath = "etc/Welcome_login.1"; } else if (ans[0] == '2') { @@ -546,7 +545,7 @@ x_file() #ifdef MULTI_WELCOME_LOGIN case 'x': - getdata(b_lines - 1, 0, I18N[65], ans, sizeof(ans), LCECHO); + getdata(b_lines - 1, 0, gettext[65], ans, sizeof(ans), LCECHO); if (ans[0] == '1') { unlink("etc/Welcome_login.1"); outs("ok"); @@ -560,7 +559,7 @@ x_file() unlink("etc/Welcome_login.4"); outs("ok"); } else { - outs(I18N[66]); + outs(gettext[66]); } pressanykey(); return FULLUPDATE; @@ -592,8 +591,8 @@ x_file() return FULLUPDATE; } aborted = vedit(fpath, NA, NULL); - prints(I18N[67], fpath, - (aborted == -1) ? I18N[68] : I18N[69]); + prints(gettext[67], fpath, + (aborted == -1) ? gettext[68] : gettext[69]); pressanykey(); return FULLUPDATE; } @@ -604,7 +603,7 @@ static int add_board_record(boardheader_t *board) if ((bid = getbnum("")) > 0) { substitute_record(fn_board, board, sizeof(boardheader_t), bid); reset_board(bid); - sort_bcache(); + sort_bcache(); } else if (append_record(fn_board, (fileheader_t *)board, sizeof(boardheader_t)) == -1) { return -1; } else { @@ -620,13 +619,13 @@ m_newbrd(int recover) char ans[4]; char genbuf[200]; - stand_title(I18N[70]); + stand_title(gettext[70]); memset(&newboard, 0, sizeof(newboard)); newboard.gid = class_bid; if (newboard.gid == 0) { move(6, 0); - outs(I18N[71]); + outs(gettext[71]); pressanykey(); return -1; } @@ -637,7 +636,7 @@ m_newbrd(int recover) } while (invalid_brdname(newboard.brdname)); do { - getdata(6, 0, I18N[72], genbuf, 5, DOECHO); + getdata(6, 0, gettext[72], genbuf, 5, DOECHO); if (strlen(genbuf) == 4) break; } while (1); @@ -646,19 +645,19 @@ m_newbrd(int recover) newboard.title[4] = ' '; - getdata(8, 0, I18N[73], genbuf, BTLEN + 1, DOECHO); + getdata(8, 0, gettext[73], genbuf, BTLEN + 1, DOECHO); if (genbuf[0]) strlcpy(newboard.title + 7, genbuf, sizeof(newboard.title) - 7); setbpath(genbuf, newboard.brdname); if (recover) { if (dashd(genbuf)) { - outs(I18N[74]); + outs(gettext[74]); pressanykey(); return -1; } } else if (getbnum(newboard.brdname) > 0 || mkdir(genbuf, 0755) == -1) { - outs(I18N[75]); + outs(gettext[75]); pressanykey(); return -1; } @@ -671,24 +670,24 @@ m_newbrd(int recover) move(1, 0); clrtobot(); } - getdata(9, 0, I18N[76], genbuf, 3, LCECHO); + getdata(9, 0, gettext[76], genbuf, 3, LCECHO); if (genbuf[0] == 'n') newboard.brdattr |= BRD_GROUPBOARD; if (newboard.brdattr & BRD_GROUPBOARD) - strncpy(newboard.title + 5, I18N[77], 2); + strncpy(newboard.title + 5, gettext[77], 2); else if (newboard.brdattr & BRD_NOTRAN) - strncpy(newboard.title + 5, I18N[78], 2); + strncpy(newboard.title + 5, gettext[78], 2); else - strncpy(newboard.title + 5, I18N[79], 2); + strncpy(newboard.title + 5, gettext[79], 2); newboard.level = 0; - getdata(11, 0, I18N[80], newboard.BM, sizeof(newboard.BM), DOECHO); + getdata(11, 0, gettext[80], newboard.BM, sizeof(newboard.BM), DOECHO); if (HAS_PERM(PERM_SYSOP) && !(newboard.brdattr & BRD_HIDE)) { - getdata_str(14, 0, I18N[81], ans, sizeof(ans), LCECHO, "N"); + getdata_str(14, 0, gettext[81], ans, sizeof(ans), LCECHO, "N"); if (*ans == 'y') { - getdata_str(15, 0, I18N[82], ans, sizeof(ans), LCECHO, "R"); + getdata_str(15, 0, gettext[82], ans, sizeof(ans), LCECHO, "R"); if (*ans == 'p') newboard.brdattr |= BRD_POSTMASK; else @@ -707,7 +706,7 @@ m_newbrd(int recover) pressanykey(); setup_man(&newboard); - outs(I18N[83]); + outs(gettext[83]); post_newboard(newboard.title, newboard.brdname, newboard.BM); log_usies("NewBoard", newboard.title); pressanykey(); @@ -738,7 +737,7 @@ int make_symbolic_link(char *bname, int gid) strlcpy(newboard.brdname, bname, sizeof(newboard.brdname)); newboard.brdname[strlen(bname) - 1] = '~'; strlcpy(newboard.title, bcache[bid - 1].title, sizeof(newboard.title)); - strcpy(newboard.title + 5, I18N[84]); + strcpy(newboard.title + 5, gettext[84]); newboard.gid = gid; BRD_LINK_TARGET(&newboard) = bid; @@ -760,10 +759,10 @@ int make_symbolic_link_interactively(int gid) if (!buf[0]) return -1; - stand_title(I18N[85]); + stand_title(gettext[85]); if (make_symbolic_link(buf, gid) < 0) { - vmsg(I18N[86]); + vmsg(gettext[86]); return -1; } log_usies("NewSymbolic", buf); @@ -778,8 +777,8 @@ auto_scan(char fdata[][STRLEN], char ans[]) int i; char temp[10]; - if (!strncmp(fdata[2], I18N[87], 2) || strstr(fdata[2], I18N[88]) - || strstr(fdata[2], I18N[89]) || strstr(fdata[2], I18N[90])) { + if (!strncmp(fdata[2], gettext[87], 2) || strstr(fdata[2], gettext[88]) + || strstr(fdata[2], gettext[89]) || strstr(fdata[2], gettext[90])) { ans[0] = '0'; return 1; } @@ -792,17 +791,17 @@ auto_scan(char fdata[][STRLEN], char ans[]) return 1; } if (strlen(fdata[2]) >= 6) { - if (strstr(fdata[2], I18N[91])) { + if (strstr(fdata[2], gettext[91])) { ans[0] = '0'; return 1; } - if (strstr(I18N[92], temp)) + if (strstr(gettext[92], temp)) good++; - else if (strstr(I18N[93], temp)) + else if (strstr(gettext[93], temp)) good++; - else if (strstr(I18N[94], temp)) + else if (strstr(gettext[94], temp)) good++; - else if (strstr(I18N[95], temp)) + else if (strstr(gettext[95], temp)) good++; } if (!good) @@ -814,25 +813,25 @@ auto_scan(char fdata[][STRLEN], char ans[]) ans[0] = '4'; return 5; } - if (strstr(fdata[3], I18N[96])) { - if (strstr(fdata[3], I18N[97]) || strstr(fdata[3], I18N[98]) || - strstr(fdata[3], I18N[99]) || strstr(fdata[3], I18N[100]) || - strstr(fdata[3], I18N[101]) || strstr(fdata[3], I18N[102]) || - strstr(fdata[3], I18N[103]) || strstr(fdata[3], I18N[104]) || - strstr(fdata[3], I18N[105]) || strstr(fdata[3], I18N[106]) || - strstr(fdata[3], I18N[107]) || strstr(fdata[3], I18N[108])) + if (strstr(fdata[3], gettext[96])) { + if (strstr(fdata[3], gettext[97]) || strstr(fdata[3], gettext[98]) || + strstr(fdata[3], gettext[99]) || strstr(fdata[3], gettext[100]) || + strstr(fdata[3], gettext[101]) || strstr(fdata[3], gettext[102]) || + strstr(fdata[3], gettext[103]) || strstr(fdata[3], gettext[104]) || + strstr(fdata[3], gettext[105]) || strstr(fdata[3], gettext[106]) || + strstr(fdata[3], gettext[107]) || strstr(fdata[3], gettext[108])) good++; - } else if (strstr(fdata[3], I18N[109])) + } else if (strstr(fdata[3], gettext[109])) good++; - if (strstr(fdata[4], I18N[110]) || strstr(fdata[4], I18N[111]) || - strstr(fdata[4], I18N[112])) { + if (strstr(fdata[4], gettext[110]) || strstr(fdata[4], gettext[111]) || + strstr(fdata[4], gettext[112])) { ans[0] = '2'; return 3; } - if (strstr(fdata[4], I18N[113]) || strstr(fdata[4], I18N[114])) { - if (strstr(fdata[4], I18N[115]) || strstr(fdata[4], I18N[116])) { - if (strstr(fdata[4], I18N[117])) + if (strstr(fdata[4], gettext[113]) || strstr(fdata[4], gettext[114])) { + if (strstr(fdata[4], gettext[115]) || strstr(fdata[4], gettext[116])) { + if (strstr(fdata[4], gettext[117])) good++; } } @@ -864,17 +863,17 @@ scan_register_form(char *regfile, int automode, int neednum) "uid", "ident", "name", "career", "addr", "phone", "email", NULL }; char *finfo[] = { - I18N[118], I18N[119], I18N[120], I18N[121], I18N[122], - I18N[123], I18N[124], NULL + gettext[118], gettext[119], gettext[120], gettext[121], gettext[122], + gettext[123], gettext[124], NULL }; char *reason[] = { - I18N[125], - I18N[126], - I18N[127], - I18N[128], - I18N[129], - I18N[130], - I18N[131], + gettext[125], + gettext[126], + gettext[127], + gettext[128], + gettext[129], + gettext[130], + gettext[131], NULL }; char *autoid = "AutoScan"; @@ -891,22 +890,22 @@ scan_register_form(char *regfile, int automode, int neednum) move(2, 0); if (dashf(fname)) { if (neednum == 0) { /* 自己進 Admin 來審的 */ - outs(I18N[132]); + outs(gettext[132]); pressanykey(); } return -1; } Rename(regfile, fname); if ((fn = fopen(fname, "r")) == NULL) { - prints(I18N[133], fname); + prints(gettext[133], fname); pressanykey(); return -1; } if (neednum) { /* 被強迫審的 */ move(1, 0); clrtobot(); - prints(I18N[134], neednum); - prints(I18N[135]); + prints(gettext[134], neednum); + prints(gettext[135]); pressanykey(); } memset(fdata, 0, sizeof(fdata)); @@ -923,7 +922,7 @@ scan_register_form(char *regfile, int automode, int neednum) } else if ((unum = getuser(fdata[0])) == 0) { move(2, 0); clrtobot(); - outs(I18N[136]); + outs(gettext[136]); for (n = 0; field[n]; n++) prints("%s : %s\n", finfo[n], fdata[n]); pressanykey(); @@ -938,27 +937,27 @@ scan_register_form(char *regfile, int automode, int neednum) uid = cuser.userid; move(1, 0); - prints(I18N[137], unum); + prints(gettext[137], unum); user_display(&muser, 1); move(14, 0); - prints(I18N[138], neednum); - prints(I18N[139], finfo[0], fdata[0]); - prints(I18N[140], finfo[1], fdata[1]); + prints(gettext[138], neednum); + prints(gettext[139], finfo[0], fdata[0]); + prints(gettext[140], finfo[1], fdata[1]); #ifdef FOREIGN_REG - prints(I18N[141], finfo[2], fdata[2], muser.uflag2 & FOREIGN ? I18N[142] : ""); + prints(gettext[141], finfo[2], fdata[2], muser.uflag2 & FOREIGN ? gettext[142] : ""); #else - prints(I18N[143], finfo[2], fdata[2]); + prints(gettext[143], finfo[2], fdata[2]); #endif for (n = 3; field[n]; n++) { - prints(I18N[144], n - 2, finfo[n], fdata[n]); + prints(gettext[144], n - 2, finfo[n], fdata[n]); } if (muser.userlevel & PERM_LOGINOK) { - ans[0] = getkey(I18N[145]); + ans[0] = getkey(gettext[145]); if (ans[0] != 'y' && ans[0] != 's') ans[0] = 'd'; } else { if (search_ulist(unum) == NULL) - ans[0] = vmsg_lines(22, I18N[146]); + ans[0] = vmsg_lines(22, gettext[146]); else ans[0] = 's'; if ('A' <= ans[0] && ans[0] <= 'Z') @@ -974,7 +973,7 @@ scan_register_form(char *regfile, int automode, int neednum) if (neednum > 0 && ans[0] == 'q') { move(2, 0); clrtobot(); - prints(I18N[147]); + prints(gettext[147]); pressanykey(); ans[0] = 's'; } @@ -1000,13 +999,13 @@ scan_register_form(char *regfile, int automode, int neednum) for (n = 0; field[n]; n++) prints("%s: %s\n", finfo[n], fdata[n]); move(9, 0); - prints(I18N[148]); + prints(gettext[148]); for (n = 0; reason[n]; n++) - prints(I18N[149], n, reason[n]); + prints(gettext[149], n, reason[n]); } else buf[0] = ans[0]; if (ans[0] != 'n' || - getdata(10 + n, 0, I18N[150], buf, 60, DOECHO)) + getdata(10 + n, 0, gettext[150], buf, 60, DOECHO)) if ((buf[0] - '0') >= 0 && (buf[0] - '0') < n) { int i; fileheader_t mhdr; @@ -1016,7 +1015,7 @@ scan_register_form(char *regfile, int automode, int neednum) sethomepath(buf1, muser.userid); stampfile(buf1, &mhdr); strlcpy(mhdr.owner, cuser.userid, sizeof(mhdr.owner)); - strlcpy(mhdr.title, I18N[151], TTLEN); + strlcpy(mhdr.title, gettext[151], TTLEN); mhdr.filemode = 0; sethomedir(title, muser.userid); if (append_record(title, &mhdr, sizeof(mhdr)) != -1) { @@ -1026,7 +1025,7 @@ scan_register_form(char *regfile, int automode, int neednum) if (!isdigit(buf[i])) continue; snprintf(genbuf, sizeof(genbuf), - I18N[152], reason[buf[i] - '0']); + gettext[152], reason[buf[i] - '0']); fprintf(fp, "%s\n", genbuf); } @@ -1044,7 +1043,7 @@ scan_register_form(char *regfile, int automode, int neednum) } move(10, 0); clrtobot(); - prints(I18N[153]); + prints(gettext[153]); case 's': if ((freg = fopen(regfile, "a"))) { for (n = 0; field[n]; n++) @@ -1054,19 +1053,22 @@ scan_register_form(char *regfile, int automode, int neednum) } break; default: - prints(I18N[154]); - mail_muser(muser, I18N[155], "etc/registered"); + prints(gettext[154]); + mail_muser(muser, gettext[155], "etc/registered"); if(muser.uflag2 & FOREIGN) - mail_muser(muser, I18N[156], "etc/foreign_welcome"); + mail_muser(muser, gettext[156], "etc/foreign_welcome"); muser.userlevel |= (PERM_LOGINOK | PERM_POST); strlcpy(muser.realname, fdata[2], sizeof(muser.realname)); strlcpy(muser.address, fdata[4], sizeof(muser.address)); strlcpy(muser.email, fdata[6], sizeof(muser.email)); - strncpy(muser.justify, genbuf, REGLEN); - sethomefile(buf, muser.userid, "justify"); - log_file(buf, 1, "%s:%s:%s\n", fdata[5], fdata[3], uid); + snprintf(genbuf, sizeof(genbuf), "%s:%s:%s", + fdata[5], fdata[3], uid); + strlcpy(muser.justify, genbuf, sizeof(muser.justify)); passwd_update(unum, &muser); + sethomefile(buf, muser.userid, "justify"); + log_file(buf, LOG_CREAT, genbuf); + if ((fout = fopen(logfile, "a"))) { for (n = 0; field[n]; n++) fprintf(fout, "%s: %s\n", field[n], fdata[n]); @@ -1088,7 +1090,7 @@ scan_register_form(char *regfile, int automode, int neednum) clrtobot(); move(5, 0); - prints(I18N[157], nSelf, nAuto); + prints(gettext[157], nSelf, nAuto); /** DickG: 將審了幾份的相關資料 post 到 Security 板上 ***********/ /* @@ -1118,10 +1120,10 @@ m_register() char genbuf[200]; if ((fn = fopen(fn_register, "r")) == NULL) { - outs(I18N[158]); + outs(gettext[158]); return XEASY; } - stand_title(I18N[159]); + stand_title(gettext[159]); y = 2; x = wid = 0; @@ -1139,7 +1141,7 @@ m_register() } } fclose(fn); - getdata(b_lines - 1, 0, I18N[160], ans, sizeof(ans), LCECHO); + getdata(b_lines - 1, 0, gettext[160], ans, sizeof(ans), LCECHO); if (ans[0] == 'a') scan_register_form(fn_register, 1, 0); else if (ans[0] == 'y') @@ -1153,9 +1155,9 @@ cat_register() { if (system("cat register.new.tmp >> register.new") == 0 && system("rm -f register.new.tmp") == 0) - vmsg(I18N[161]); + vmsg(gettext[161]); else - vmsg(I18N[162]); + vmsg(gettext[162]); return 0; } @@ -1167,12 +1169,12 @@ give_id_money(char *user_id, int money, FILE * log_fp, char *mail_title, time_t if (deumoney(searchuser(user_id), money) < 0) { move(12, 0); clrtoeol(); - prints(I18N[163], user_id, money); + prints(gettext[163], user_id, money); pressanykey(); } else { fprintf(log_fp, "%d %s %d", (int)t, user_id, money); - snprintf(tt, sizeof(tt), I18N[164], mail_title, money); - mail_id(user_id, tt, "etc/givemoney.why", I18N[165]); + snprintf(tt, sizeof(tt), gettext[164], mail_title, money); + mail_id(user_id, tt, "etc/givemoney.why", gettext[165]); } } @@ -1185,16 +1187,16 @@ give_money() struct tm *pt = localtime(&now); int to_all = 0, money = 0; - getdata(0, 0, I18N[166], buf, sizeof(buf), LCECHO); + getdata(0, 0, gettext[166], buf, sizeof(buf), LCECHO); if (buf[0] == 'q') return 1; else if (buf[0] == 'a') { to_all = 1; - getdata(1, 0, I18N[167], buf, 20, DOECHO); + getdata(1, 0, gettext[167], buf, 20, DOECHO); money = atoi(buf); if (money <= 0) { move(2, 0); - prints(I18N[168]); + prints(gettext[168]); pressanykey(); return 1; } @@ -1204,7 +1206,7 @@ give_money() } clear(); - getdata(0, 0, I18N[169], buf, 3, LCECHO); + getdata(0, 0, gettext[169], buf, 3, LCECHO); if (buf[0] != 'y') return 1; @@ -1214,17 +1216,17 @@ give_money() fprintf(fp2, "%s\n", buf); - getdata(1, 0, I18N[170], tt, TTLEN, DOECHO); + getdata(1, 0, gettext[170], tt, TTLEN, DOECHO); move(2, 0); - prints(I18N[171]); + prints(gettext[171]); pressanykey(); if (vedit("etc/givemoney.why", NA, NULL) < 0) { fclose(fp2); return 1; } - stand_title(I18N[172]); + stand_title(gettext[172]); if (to_all) { int i, unum; for (unum = SHM->number, i = 0; i < unum; i++) { @@ -1234,7 +1236,7 @@ give_money() give_id_money(id, money, fp2, tt, now); } //something wrong @ _ @ - //give_money_post(I18N[173], atoi(money)); + //give_money_post(gettext[173], atoi(money)); } else { if (!(fp = fopen("etc/givemoney.txt", "r+"))) { fclose(fp2); |