summaryrefslogtreecommitdiffstats
path: root/mbbsd/admin.c
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd/admin.c')
-rw-r--r--mbbsd/admin.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/mbbsd/admin.c b/mbbsd/admin.c
index f6d35a6c..e828e3f3 100644
--- a/mbbsd/admin.c
+++ b/mbbsd/admin.c
@@ -134,7 +134,6 @@ search_key_user(char *passwdfile, int mode)
fclose(fp1);
return 0;
} else {
- move(b_lines - 1, 0);
getdata(0, 0,
"目前的 PASSWD 檔沒有此 ID,新增嗎?[y/N]",
genbuf, 3, LCECHO);
@@ -232,9 +231,10 @@ setperms(unsigned int pbits, char *pstring[])
((pbits >> (i + 16)) & 1 ? "ˇ" : "X"));
}
clrtobot();
- while (getdata(b_lines - 1, 0, "請按 [A-5] 切換設定,按 [Return] 結束:",
- choice, sizeof(choice), LCECHO)) {
- i = choice[0] - 'a';
+ while (
+ (i = getkey("請按 [A-5] 切換設定,按 [Return] 結束:"))!='\r')
+ {
+ i = i - 'a';
if (i < 0)
i = choice[0] - '0' + 26;
if (i >= NUMPERMS)
@@ -263,6 +263,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();
log_usies("DelLink", bh->brdname);
}
@@ -361,6 +362,7 @@ m_mod_board(char *bname)
post_msg("Security", bh.title, "請注意刪除的合法性", "[系統安全局]");
substitute_record(fn_board, &bh, sizeof(bh), bid);
reset_board(bid);
+ sort_bcache();
log_usies("DelBoard", bh.title);
outs("刪板完畢");
}
@@ -448,6 +450,7 @@ m_mod_board(char *bname)
setup_man(&newbh);
substitute_record(fn_board, &newbh, sizeof(newbh), bid);
reset_board(bid);
+ sort_bcache();
log_usies("SetBoard", newbh.brdname);
}
}
@@ -607,6 +610,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();
} else if (append_record(fn_board, (fileheader_t *)board, sizeof(boardheader_t)) == -1) {
return -1;
} else {
@@ -705,6 +709,7 @@ m_newbrd(int recover)
}
add_board_record(&newboard);
+ getbcache(class_bid)->childcount = 0;
pressanykey();
setup_man(&newboard);
@@ -954,15 +959,13 @@ scan_register_form(char *regfile, int automode, int neednum)
prints("%d.%-12s:%s\n", n - 2, finfo[n], fdata[n]);
}
if (muser.userlevel & PERM_LOGINOK) {
- getdata(b_lines - 1, 0, "\033[1;32m此帳號已經完成註冊, "
- "更新(Y/N/Skip)?\033[m[N] ", ans, sizeof(ans), LCECHO);
+ ans[0] = getkey("此帳號已經完成註冊, "
+ "更新(Y/N/Skip)?[N] ");
if (ans[0] != 'y' && ans[0] != 's')
ans[0] = 'd';
} else {
- move(b_lines - 1, 0);
- prints("是否接受此資料(Y/N/Q/Del/Skip)?[S] ");
if (search_ulist(unum) == NULL)
- ans[0] = igetch();
+ ans[0] = vmsg_lines(22, "是否接受此資料(Y/N/Q/Del/Skip)?[S])");
else
ans[0] = 's';
if ('A' <= ans[0] && ans[0] <= 'Z')
@@ -1066,12 +1069,9 @@ scan_register_form(char *regfile, int automode, int neednum)
strlcpy(muser.realname, fdata[2], sizeof(muser.realname));
strlcpy(muser.address, fdata[4], sizeof(muser.address));
strlcpy(muser.email, fdata[6], sizeof(muser.email));
- snprintf(genbuf, sizeof(genbuf),
- "%s:%s:%s", fdata[5], fdata[3], uid);
strncpy(muser.justify, genbuf, REGLEN);
sethomefile(buf, muser.userid, "justify");
- strncat(genbuf, "\n", sizeof(genbuf));
- log_file(buf, genbuf, 1);
+ log_file(buf, 1, "%s:%s:%s\n", fdata[5], fdata[3], uid);
passwd_update(unum, &muser);
if ((fout = fopen(logfile, "a"))) {
@@ -1160,10 +1160,9 @@ cat_register()
{
if (system("cat register.new.tmp >> register.new") == 0 &&
system("rm -f register.new.tmp") == 0)
- mprints(22, 0, "OK 嚕~~ 繼續去奮鬥吧!!");
+ vmsg("OK 嚕~~ 繼續去奮鬥吧!!");
else
- mprints(22, 0, "沒辦法CAT過去呢 去檢查一下系統吧!!");
- pressanykey();
+ vmsg("沒辦法CAT過去呢 去檢查一下系統吧!!");
return 0;
}