summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/bbs.h1
-rw-r--r--include/config.h4
-rw-r--r--include/proto.h6
-rw-r--r--mbbsd/bbs.c11
-rw-r--r--mbbsd/mail.c5
-rw-r--r--mbbsd/user.c4
-rw-r--r--sample/pttbbs.conf2
7 files changed, 25 insertions, 8 deletions
diff --git a/include/bbs.h b/include/bbs.h
index ead0861e..b004b601 100644
--- a/include/bbs.h
+++ b/include/bbs.h
@@ -31,6 +31,7 @@ extern "C" {
#include <sys/time.h>
#include <sys/resource.h>
#include <netinet/in.h>
+#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <arpa/telnet.h>
#include <sys/types.h>
diff --git a/include/config.h b/include/config.h
index 95452f67..58ad758e 100644
--- a/include/config.h
+++ b/include/config.h
@@ -53,6 +53,10 @@
#define GLOBAL_NEWBIE BBSMNAME "Newhand"
#endif
+#ifndef GLOBAL_TEST
+#define GLOBAL_TEST "Test"
+#endif
+
#ifndef GLOBAL_NOTE
#define GLOBAL_NOTE "Note"
#endif
diff --git a/include/proto.h b/include/proto.h
index d7d353db..2332e7b4 100644
--- a/include/proto.h
+++ b/include/proto.h
@@ -791,6 +791,12 @@ int Goodbye(void);
/* toolkit */
unsigned DBCS_StringHash(const char *s);
+/* recycle */
+// public
+int RcyAddFile(const fileheader_t *fhdr, int bid, const char *fpath);
+int RcyAddDir (const fileheader_t *fhdr, int bid, const char *direct);
+int RcyRecycleBin(void);
+
/* passwd */
int passwd_init(void);
int passwd_update(int num, userec_t *buf);
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 3d381abe..66fc4316 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -668,8 +668,8 @@ do_deleteCrossPost(const fileheader_t *fh, char bname[])
else
#endif
delete_record(bdir, sizeof(fileheader_t), i);
- unlink(file);
setbtotal(bid);
+ unlink(file);
}
}
@@ -1083,7 +1083,7 @@ do_general(int isbid)
if (aborted > MAX_POST_MONEY)
aborted = MAX_POST_MONEY;
#endif
- if (strcmp(currboard, "Test") && !ifuseanony &&
+ if (strcmp(currboard, GLOBAL_TEST) && !ifuseanony &&
!(currbrdattr&BRD_BAD)) {
prints("這是您的第 %d 篇文章。",++cuser.numposts);
if(postfile.filemode&FILE_BID)
@@ -1789,7 +1789,7 @@ cross_post(int ent, fileheader_t * fhdr, const char *direct)
// anti-crosspost spammers: do not add numpost.
#if 0
- if (strcmp(xboard, "Test") == 0)
+ if (strcmp(xboard, GLOBAL_TEST) == 0)
outs("測試信件不列入紀錄,敬請包涵。");
else
cuser.numposts++;
@@ -3076,14 +3076,15 @@ del_post(int ent, fileheader_t * fhdr, char *direct)
if (fhdr->multi.money < 0 || fhdr->filemode & FILE_ANONYMOUS)
fhdr->multi.money = 0;
if (not_owned && tusernum && fhdr->multi.money > 0 &&
- strcmp(currboard, "Test") && strcmp(currboard, ALLPOST)) {
+ strcmp(currboard, GLOBAL_TEST) &&
+ strcmp(currboard, ALLPOST)) {
deumoney(tusernum, -fhdr->multi.money);
#ifdef USE_COOLDOWN
if (bp->brdattr & BRD_COOLDOWN)
add_cooldowntime(tusernum, 15);
#endif
}
- if (!not_owned && strcmp(currboard, "Test") &&
+ if (!not_owned && strcmp(currboard, GLOBAL_TEST) &&
strcmp(currboard, ALLPOST)) {
if (cuser.numposts)
cuser.numposts--;
diff --git a/mbbsd/mail.c b/mbbsd/mail.c
index ac4be139..5e6ead31 100644
--- a/mbbsd/mail.c
+++ b/mbbsd/mail.c
@@ -1059,6 +1059,9 @@ mail_del(int ent, const fileheader_t * fhdr, const char *direct)
if (!delete_record(direct, sizeof(*fhdr), ent)) {
setupmailusage();
setdirpath(genbuf, direct, fhdr->filename);
+#ifdef USE_RECYCLE
+ RcyAddFile(fhdr, 0, genbuf);
+#endif // USE_RECYCLE
unlink(genbuf);
mailsum = mailkeep = 0;
return DIRCHANGED;
@@ -1406,7 +1409,7 @@ mail_cross_post(int ent, fileheader_t * fhdr, const char *direct)
add_posttimes(usernum, 1);
#endif
- if (strcmp(xboard, "Test") == 0)
+ if (strcmp(xboard, GLOBAL_TEST) == 0)
outs("測試信件不列入紀錄,敬請包涵。");
else
cuser.numposts++;
diff --git a/mbbsd/user.c b/mbbsd/user.c
index b7fb4e6a..8645ab62 100644
--- a/mbbsd/user.c
+++ b/mbbsd/user.c
@@ -1403,7 +1403,7 @@ toregister(char *email, char *genbuf, char *phone, char *career,
"\n"
" 2.若您沒有 E-Mail 或是一直無法收到認證信, 請輸入 x \n"
" 會有站長親自人工審核註冊資料," ANSI_COLOR(1;33)
- "但注意這可能會花上數天或更多時間。" ANSI_RESET "\n"
+ "但注意這可能會花上數週或更多時間。" ANSI_RESET "\n"
"**********************************************************\n"
"* 注意! *\n"
"* 通常應該會在輸入完成後十分鐘內收到認證信, 若過久未收到 *\n"
@@ -1449,7 +1449,7 @@ toregister(char *email, char *genbuf, char *phone, char *career,
move(15, 0); clrtobot();
move(17, 0);
outs("指定的 E-Mail 不合法, 若您無 E-Mail 請輸入 x 由站長手動認證\n");
- outs("但注意手動認證通常會花上數天的時間。\n");
+ outs("但注意手動認證通常會花上數週以上的時間。\n");
}
}
strlcpy(cuser.email, email, sizeof(cuser.email));
diff --git a/sample/pttbbs.conf b/sample/pttbbs.conf
index b54c4c5d..a8415603 100644
--- a/sample/pttbbs.conf
+++ b/sample/pttbbs.conf
@@ -43,6 +43,8 @@
/* SYSOP 板 */
#define GLOBAL_SYSOP "SYSOP"
+/* 測試板 */
+#define GLOBAL_TEST "Test"
/* 發生錯誤時建議的回報板名為此板 */
#define GLOBAL_BUGREPORT BBSMNAME "Bug"
/* 法律訴訟的板 */