summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pttbbs/include/config.h4
-rw-r--r--pttbbs/mbbsd/bbs.c16
-rw-r--r--pttbbs/mbbsd/gamble.c5
-rw-r--r--pttbbs/mbbsd/mbbsd.c11
-rw-r--r--pttbbs/mbbsd/register.c7
5 files changed, 20 insertions, 23 deletions
diff --git a/pttbbs/include/config.h b/pttbbs/include/config.h
index 159fd26a..af447ee9 100644
--- a/pttbbs/include/config.h
+++ b/pttbbs/include/config.h
@@ -240,6 +240,10 @@
#define HOTBOARDCACHE (0) /* 熱門看板快取 */
#endif
+#ifndef TARQUEUE_TIME_STR
+#define TARQUEUE_TIME_STR "深夜" // 看板備份時間訊息 (應與 contab 一致)
+#endif
+
/////////////////////////////////////////////////////////////////////////////
// More system messages 系統訊息
diff --git a/pttbbs/mbbsd/bbs.c b/pttbbs/mbbsd/bbs.c
index 9409896a..e97ba92e 100644
--- a/pttbbs/mbbsd/bbs.c
+++ b/pttbbs/mbbsd/bbs.c
@@ -858,15 +858,11 @@ do_select(void)
/* 改良 innbbsd 轉出信件、連線砍信之處理程序 */
/* ----------------------------------------------------- */
void
-outgo_post(const fileheader_t *fh, const char *board, const char *userid, const char *nickname)
+outgo_post(const fileheader_t *fh, const char *board, const char *userid,
+ const char *nickname)
{
- FILE *foo;
-
- if ((foo = fopen("innd/out.bntp", "a"))) {
- fprintf(foo, "%s\t%s\t%s\t%s\t%s\n",
- board, fh->filename, userid, nickname, fh->title);
- fclose(foo);
- }
+ log_filef("innd/out.bntp", LOG_CREAT, "%s\t%s\t%s\t%s\t%s\n",
+ board, fh->filename, userid, nickname, fh->title);
}
static void
@@ -3818,9 +3814,10 @@ tar_addqueue(void)
snprintf(qfn, sizeof(qfn), BBSHOME "/jobspool/tarqueue.%s", currboard);
if (access(qfn, 0) == 0) {
- vmsg("已經排定行程, 稍後會進行備份");
+ vmsg("已經排定行程, 會於每日" TARQUEUE_TIME_STR "依序進行備份");
return FULLUPDATE;
}
+
if (vansf("確定要對看板 %s 進行備份嗎?[y/N] ", currboard) != 'y')
return FULLUPDATE;
@@ -3838,6 +3835,7 @@ tar_addqueue(void)
move(4,0); clrtoeol();
outs(email);
#else
+ outs("\n注意看板備份可能超過數百 MB,若您的信箱無法接受巨大附檔可能會直接退信\n");
if (!getdata(4, 0, "請輸入目的信箱: ", email, sizeof(email), DOECHO))
return FULLUPDATE;
diff --git a/pttbbs/mbbsd/gamble.c b/pttbbs/mbbsd/gamble.c
index c91b4f78..c0c1a5ab 100644
--- a/pttbbs/mbbsd/gamble.c
+++ b/pttbbs/mbbsd/gamble.c
@@ -132,10 +132,7 @@ append_ticket_record(const char *direct, int ch, int n, int count)
return -1;
snprintf(genbuf, sizeof(genbuf), "%s/" FN_TICKET_USER, direct);
- if ((fp = fopen(genbuf, "a"))) {
- fprintf(fp, "%s %d %d\n", cuser.userid, ch, n);
- fclose(fp);
- }
+ log_filef(genbuf, LOG_CREAT, "%s %d %d\n", cuser.userid, ch, n);
snprintf(genbuf, sizeof(genbuf), "%s/" FN_TICKET_RECORD, direct);
diff --git a/pttbbs/mbbsd/mbbsd.c b/pttbbs/mbbsd/mbbsd.c
index 9b3a7baa..0ab19279 100644
--- a/pttbbs/mbbsd/mbbsd.c
+++ b/pttbbs/mbbsd/mbbsd.c
@@ -406,12 +406,15 @@ show_call_in(int save, int which)
char buf[200];
#ifdef PLAY_ANGEL
if (currutmp->msgs[which].msgmode == MSGMODE_TOANGEL)
- snprintf(buf, sizeof(buf), ANSI_COLOR(1;37;46) "★%s" ANSI_COLOR(37;45) " %s " ANSI_RESET,
- currutmp->msgs[which].userid, currutmp->msgs[which].last_call_in);
+ snprintf(buf, sizeof(buf), ANSI_COLOR(1;37;46) "★%s" ANSI_COLOR(37;45)
+ " %s " ANSI_RESET,
+ currutmp->msgs[which].userid,
+ currutmp->msgs[which].last_call_in);
else
#endif
- snprintf(buf, sizeof(buf), ANSI_COLOR(1;33;46) "★%s" ANSI_COLOR(37;45) " %s " ANSI_RESET,
- currutmp->msgs[which].userid, currutmp->msgs[which].last_call_in);
+ snprintf(buf, sizeof(buf), ANSI_COLOR(1;33;46) "★%s" ANSI_COLOR(37;45)
+ " %s " ANSI_RESET, currutmp->msgs[which].userid,
+ currutmp->msgs[which].last_call_in);
outmsg(buf);
if (save) {
diff --git a/pttbbs/mbbsd/register.c b/pttbbs/mbbsd/register.c
index c891d893..54153fb3 100644
--- a/pttbbs/mbbsd/register.c
+++ b/pttbbs/mbbsd/register.c
@@ -1575,7 +1575,6 @@ regform_log2file(const RegformEntry *pre, char accepted,
#ifdef FN_ID_RECORD
// The message may contain ANSI escape sequences (regform_concat_reasons)
char msg[ANSILINELEN * REJECT_REASONS + REGFORM_LOCALIZED_ENTRIES_BUFSIZE];
- FILE *fp;
snprintf(msg, sizeof(msg),
"%s\n%s: %s (%s: %s)\n",
@@ -1590,11 +1589,7 @@ regform_log2file(const RegformEntry *pre, char accepted,
}
strlcat(msg, "\n", sizeof(msg));
concat_regform_entry_localized(pre, msg, sizeof(msg));
-
- fp = fopen(FN_ID_RECORD, "at");
- if (!fp) return;
- fputs(msg, fp);
- fclose(fp);
+ log_file(FN_ID_RECORD, LOG_CREAT, msg);
#endif // FN_ID_RECORD
}