From 6c783cd8609ba2e65267eaa2cda8c46d7fc4ac8c Mon Sep 17 00:00:00 2001 From: ptt Date: Thu, 29 Apr 2004 18:13:39 +0000 Subject: change log_file() log_user() git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1889 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/bbs.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'mbbsd/bbs.c') diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index c78f270b..194bb972 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -30,12 +30,9 @@ mail_by_link(char *owner, char *title, char *path) void anticrosspost() { - char buf[200]; - - snprintf(buf, sizeof(buf), - "\033[1;33;46m%s \033[37;45mcross post 文章 \033[37m %s\033[m\n", - cuser.userid, ctime(&now)); - log_file("etc/illegal_money", buf, 1); + log_file("etc/illegal_money", 1, + "\033[1;33;46m%s \033[37;45mcross post 文章 \033[37m %s\033[m\n", + cuser.userid, ctime(&now)); post_violatelaw(cuser.userid, "Ptt系統警察", "Cross-post", "罰單處份"); cuser.userlevel |= PERM_VIOLATELAW; @@ -1409,7 +1406,7 @@ do_add_recommend(char *direct, fileheader_t *fhdr, int ent, char *buf) 3.若推的時候前文被刪, 將加到後文的推文數 */ setdirpath(path, direct, fhdr->filename); - if( log_file(path, buf, 0) == -1 ){ // 不 CREATE + if( log_file(path, 0, buf) == -1 ){ // 不 CREATE vmsg("推薦/競標失敗"); return -1; } @@ -2620,12 +2617,9 @@ ReadSelect() static void log_board(char *mode, time_t usetime) { - char buf[256]; - if (usetime > 30) { - snprintf(buf, sizeof(buf), "USE %-20.20s Stay: %5ld (%s) %s\n", - mode, usetime, cuser.userid, ctime(&now)); - log_file(FN_USEBOARD, buf, 1); + log_file(FN_USEBOARD, 1, "USE %-20.20s Stay: %5ld (%s) %s\n", + mode, usetime, cuser.userid, ctime(&now)); } } #endif -- cgit v1.2.3