summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/proto.h3
-rw-r--r--mbbsd/admin.c3
-rw-r--r--mbbsd/syspost.c27
3 files changed, 30 insertions, 3 deletions
diff --git a/include/proto.h b/include/proto.h
index 30585329..df355e4a 100644
--- a/include/proto.h
+++ b/include/proto.h
@@ -1,4 +1,4 @@
-/* $Id: proto.h,v 1.9 2002/05/02 06:20:31 lwms Exp $ */
+/* $Id: proto.h,v 1.10 2002/05/08 12:06:06 lwms Exp $ */
#ifndef INCLUDE_PROTO_H
#define INCLUDE_PROTO_H
@@ -412,6 +412,7 @@ int is_uBM(char *list, char *id);
void post_newboard(char *bgroup, char *bname, char *bms);
void post_violatelaw(char *crime, char *police, char *reason, char *result);
void post_change_perm(int oldperm, int newperm, char *sysopid, char *userid);
+void post_give_money(char *sysopid, char *userid, int money);
/* talk */
int cmpwatermtime(const void *a, const void *b);
diff --git a/mbbsd/admin.c b/mbbsd/admin.c
index 2d66bfe4..df1256a4 100644
--- a/mbbsd/admin.c
+++ b/mbbsd/admin.c
@@ -1,4 +1,4 @@
-/* $Id: admin.c,v 1.7 2002/04/28 19:35:28 in2 Exp $ */
+/* $Id: admin.c,v 1.8 2002/05/08 12:04:49 lwms Exp $ */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -1092,6 +1092,7 @@ int give_money() {
continue;
id = uhash->userid[i];
give_id_money(id, money, fp2, tt, t);
+ post_give_money(cuser.userid , id, money);
}
} else {
if(!(fp = fopen("etc/givemoney.txt", "r+"))) {
diff --git a/mbbsd/syspost.c b/mbbsd/syspost.c
index 474e8b65..a2cdcea8 100644
--- a/mbbsd/syspost.c
+++ b/mbbsd/syspost.c
@@ -1,4 +1,4 @@
-/* $Id: syspost.c,v 1.3 2002/04/28 19:35:29 in2 Exp $ */
+/* $Id: syspost.c,v 1.4 2002/05/08 12:04:49 lwms Exp $ */
#include <stdio.h>
#include <string.h>
#include <time.h>
@@ -100,3 +100,28 @@ void post_newboard(char* bgroup, char* bname, char* bms){
cuser.userid, bname, bgroup, bms);
post_msg("Record", title, genbuf, "[系統]");
}
+
+void post_give_money(char *sysopid, char *userid, int money) {
+ FILE *fp;
+ fileheader_t fhdr;
+ time_t now = time(0);
+ char genbuf[200];
+
+ strcpy(genbuf, "boards/S/Security");
+ stampfile(genbuf, &fhdr);
+ if(!(fp = fopen(genbuf,"w")))
+ return;
+
+ fprintf(fp, "作者: [系統安全局] 看板: Security\n"
+ "標題: [公安報告] 紅包機使用報告\n"
+ "時間: %s\n", ctime(&now));
+ fprintf (fp, " 站長\033[1;32m%s給%s\033[m%d元\n",
+ sysopid, userid, money);
+
+ sprintf(fhdr.title, "[公安報告] 站長%s使用紅包機報告",
+ cuser.userid);
+ strcpy(fhdr.owner, "[系統安全局]");
+ append_record("boards/S/Security/.DIR", &fhdr, sizeof(fhdr));
+}
+
+