summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-06-22 23:03:52 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-06-22 23:03:52 +0800
commita1d2b5a7522d4a225309c7c3a0215388e9e26f3b (patch)
tree9aab3257f8c3b75e054fb91ed512fea8d3797ca7 /mbbsd
parent369ac1934a26c796897a370a4669b5d3a922c93c (diff)
downloadpttbbs-a1d2b5a7522d4a225309c7c3a0215388e9e26f3b.tar
pttbbs-a1d2b5a7522d4a225309c7c3a0215388e9e26f3b.tar.gz
pttbbs-a1d2b5a7522d4a225309c7c3a0215388e9e26f3b.tar.bz2
pttbbs-a1d2b5a7522d4a225309c7c3a0215388e9e26f3b.tar.lz
pttbbs-a1d2b5a7522d4a225309c7c3a0215388e9e26f3b.tar.xz
pttbbs-a1d2b5a7522d4a225309c7c3a0215388e9e26f3b.tar.zst
pttbbs-a1d2b5a7522d4a225309c7c3a0215388e9e26f3b.zip
1. patch of defining BBSENAME
2. chage log format for red envelope 3. remove unused function give_money_log 4. add log for deleting a post. (who delete it) 5. add log for changing basic permission. 6. add log for changing user's password and mail to notify user and witnesses. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2855 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/admin.c40
-rw-r--r--mbbsd/bbs.c3
-rw-r--r--mbbsd/syspost.c18
-rw-r--r--mbbsd/user.c23
4 files changed, 53 insertions, 31 deletions
diff --git a/mbbsd/admin.c b/mbbsd/admin.c
index ae543d33..57a35156 100644
--- a/mbbsd/admin.c
+++ b/mbbsd/admin.c
@@ -1364,9 +1364,10 @@ give_money(void)
{
FILE *fp, *fp2;
char *ptr, *id, *mn;
- char buf[200] = "", tt[TTLEN + 1] = "";
+ char buf[200] = "", reason[100], tt[TTLEN + 1] = "";
struct tm *pt = localtime4(&now);
int to_all = 0, money = 0;
+ int total_money=0, count=0;
getdata(0, 0, "«ü©w¨Ï¥ÎªÌ(S) ¥þ¯¸¨Ï¥ÎªÌ(A) ¨ú®ø(Q)¡H[S]", buf, sizeof(buf), LCECHO);
if (buf[0] == 'q')
@@ -1386,17 +1387,23 @@ give_money(void)
}
clear();
- getdata(0, 0, "­nµo¿ú¤F¶Ü(Y/N)[N]", buf, 3, LCECHO);
- if (buf[0] != 'y')
- return 1;
- if (!(fp2 = fopen("etc/givemoney.log", "a")))
+ unlink("etc/givemoney.log");
+ if (!(fp2 = fopen("etc/givemoney.log", "w")))
return 1;
- strftime(buf, sizeof(buf), "%Y/%m/%d/%H:%M", pt);
- fprintf(fp2, "%s\n", buf);
+ getdata(0, 0, "°Ê¥Î°ê®w!½Ð¿é¤J¥¿·í²z¥Ñ(¦p¬¡°Ê¦WºÙ):", reason, 40, LCECHO);
+ fprintf(fp2,"\n¨Ï¥Î²z¥Ñ: %s\n", reason);
+
+ getdata(1, 0, "­nµo¿ú¤F¶Ü(Y/N)[N]", buf, 3, LCECHO);
+ if (buf[0] != 'y')
+ {
+ fclose(fp2);
+ return 1;
+ }
getdata(1, 0, "¬õ¥]³U¼ÐÃD ¡G", tt, TTLEN, DOECHO);
+ fprintf(fp2,"\n¬õ¥]³U¼ÐÃD: %s\n", tt);
move(2, 0);
vmsg("½s¬õ¥]³U¤º®e");
@@ -1413,9 +1420,11 @@ give_money(void)
continue;
id = SHM->userid[i];
give_id_money(id, money, fp2, tt, now);
+ fprintf(fp2,"µ¹ %s : %d\n", id, money);
+ count++;
}
- //something wrong @ _ @
- //give_money_post("¥þ¯¸¨Ï¥ÎªÌ", atoi(money));
+ sprintf(buf, " ( %d ¤H : %d P¹ô )", count, count*money);
+ strcat(reason, buf);
} else {
if (!(fp = fopen("etc/givemoney.txt", "r+"))) {
fclose(fp2);
@@ -1428,13 +1437,22 @@ give_money(void)
*ptr = '\0';
id = buf;
mn = ptr + 1;
- give_id_money(id, atoi(mn), fp2, tt, now);
- give_money_post(id, atoi(mn));
+ money = atoi(mn);
+ give_id_money(id, money, fp2, tt, now);
+ fprintf(fp2,"µ¹ %s : %d\n", id, money);
+ total_money += money;
+ count++;
}
fclose(fp);
+ sprintf(buf, " ( %d ¤H : %d P¹ô )", count, total_money);
+ strcat(reason, buf);
+
}
fclose(fp2);
+
+ sprintf(buf, "%s ¨Ï¥Î¬õ¥]¾÷: %s", cuser.userid, reason);
+ post_file("Security", buf, "etc/givemoney.log", "[¬õ¥]¾÷÷§iø]");
pressanykey();
return FULLUPDATE;
}
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 341ad324..51ac88a2 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -351,6 +351,7 @@ cancelpost(const fileheader_t *fh, int by_BM, char *newpath)
char genbuf[200];
char nick[STRLEN], fn1[STRLEN];
int len = 42-strlen(currboard);
+ struct tm *ptime = localtime4(&now);
if(!fh->filename[0]) return;
setbfile(fn1, currboard, fh->filename);
@@ -382,6 +383,8 @@ cancelpost(const fileheader_t *fh, int by_BM, char *newpath)
fclose(fout);
}
fclose(fin);
+ log_file(fn1, LOG_CREAT | LOG_VF, "\n¡° Deleted by: %s (%s) %d/%d",
+ cuser.userid, fromhost, ptime->tm_mon + 1, ptime->tm_mday);
Rename(fn1, newpath);
setbdir(genbuf, brd);
setbtotal(getbnum(brd));
diff --git a/mbbsd/syspost.c b/mbbsd/syspost.c
index a5780eec..fbed4c7f 100644
--- a/mbbsd/syspost.c
+++ b/mbbsd/syspost.c
@@ -70,7 +70,7 @@ post_change_perm(int oldperm, int newperm, const char *sysopid, const char *user
fprintf(fp, "§@ªÌ: [¨t²Î¦w¥þ§½] ¬ÝªO: Security\n"
"¼ÐÃD: [¤½¦w³ø§i] ¯¸ªø­×§ïÅv­­³ø§i\n"
"®É¶¡: %s\n", ctime4(&now));
- for (i = 5; i < NUMPERMS; i++) {
+ for (i = 1; i < NUMPERMS; i++) {
if (((oldperm >> i) & 1) != ((newperm >> i) & 1)) {
fprintf(fp, " ¯¸ªø" ANSI_COLOR(1;32) "%s%s%s%s" ANSI_RESET "ªºÅv­­\n",
sysopid,
@@ -128,19 +128,3 @@ post_newboard(const char *bgroup, const char *bname, const char *bms)
post_msg("Record", title, genbuf, "[¨t²Î]");
}
-
-void
-give_money_post(const char *userid, int money)
-{
- char title[TTLEN+1];
- char msg[128];
-
- snprintf(title, sizeof(title), "[¤½¦w³ø§i] ¯¸ªø%s¨Ï¥Î¬õ¥]¾÷³ø§i", cuser.userid);
- snprintf(msg, sizeof(msg), "\n ¯¸ªø" ANSI_COLOR(1;32) "%s" ANSI_RESET "µ¹" ANSI_COLOR(1;33) "%s %d ¤¸" ANSI_RESET,
- cuser.userid, userid, money);
-
- post_msg("Security", title, msg, "[¨t²Î¦w¥þ§½]");
-
- clrtobot();
- clear();
-}
diff --git a/mbbsd/user.c b/mbbsd/user.c
index 533a8dee..5c08c167 100644
--- a/mbbsd/user.c
+++ b/mbbsd/user.c
@@ -666,7 +666,8 @@ uinfo_query(userec_t *u, int adminmode, int unum)
break;
}
} else {
- char witness[3][32];
+ FILE *fp;
+ char witness[3][32], title[100];
for (i = 0; i < 3; i++) {
if (!getdata(19 + i, 0, "½Ð¿é¤J¨ó§UÃÒ©ú¤§¨Ï¥ÎªÌ¡G",
witness[i], sizeof(witness[i]), DOECHO)) {
@@ -688,8 +689,24 @@ uinfo_query(userec_t *u, int adminmode, int unum)
}
if (i < 3)
break;
- else
- i = 20;
+
+ i = 20;
+ sprintf(title, "%s ªº±K½X­«³]³qª¾ (by %s)",u->userid, cuser.userid);
+ unlink("etc/updatepwd.log");
+ if(! (fp = fopen("etc/updatepwd.log", "w")))
+ break;
+
+ fprintf(fp, "%s ­n¨D±K½X­«³]:\n"
+ "¨£ÃÒ¤H¬° %s, %s, %s",
+ u->userid, witness[0], witness[1], witness[2] );
+ fclose(fp);
+
+ post_file("Security", title, "etc/updatepwd.log", "[¨t²Î¦w¥þþ§½]");
+ mail_id(u->userid, title, "etc/updatepwd.log", cuser.userid);
+ for(i=0; i<3; i++)
+ {
+ mail_id(witness[i], title, "etc/updatepwd.log", cuser.userid);
+ }
}
if (!getdata(i++, 0, "½Ð³]©w·s±K½X¡G", buf, PASSLEN, NOECHO)) {