summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pttbbs/include/proto.h5
-rw-r--r--pttbbs/include/pttstruct.h4
-rw-r--r--pttbbs/mbbsd/bbs.c31
-rw-r--r--pttbbs/mbbsd/board.c18
-rw-r--r--pttbbs/mbbsd/cal.c10
-rw-r--r--pttbbs/mbbsd/voteboard.c11
-rw-r--r--pttbbs/util/shmctl.c1
-rw-r--r--pttbbs/util/showboard.c1
8 files changed, 18 insertions, 63 deletions
diff --git a/pttbbs/include/proto.h b/pttbbs/include/proto.h
index 449cfece..a1b55e3f 100644
--- a/pttbbs/include/proto.h
+++ b/pttbbs/include/proto.h
@@ -153,8 +153,9 @@ int resolve_over18_user(const userec_t *u);
char *get_restriction_reason(
time4_t firstlogin, unsigned int numlogindays,
unsigned int numposts, unsigned int badpost,
- time4_t limits_regtime, unsigned int limits_logins,
- unsigned int limits_posts, unsigned int limits_badpost,
+ unsigned int limits_logins,
+ unsigned int limits_posts,
+ unsigned int limits_badpost,
size_t sz_msg, char *msg);
/* ccw (common chat window) */
diff --git a/pttbbs/include/pttstruct.h b/pttbbs/include/pttstruct.h
index e987f0c6..597a8b83 100644
--- a/pttbbs/include/pttstruct.h
+++ b/pttbbs/include/pttstruct.h
@@ -176,11 +176,11 @@ typedef struct boardheader_t { /* 256 bytes */
char chesscountry; /* 棋國 */
uint8_t vote_limit_posts; /* 連署 : 文章篇數下限 */
uint8_t vote_limit_logins; /* 連署 : 登入次數下限 */
- uint8_t vote_limit_regtime; /* 連署 : 註冊時間限制 */
+ uint8_t pad2_1[1]; /* (已停用) 連署 : 註冊時間限制 */
time4_t bupdate; /* note update time */
uint8_t post_limit_posts; /* 發表文章 : 文章篇數下限 */
uint8_t post_limit_logins; /* 發表文章 : 登入次數下限 */
- uint8_t post_limit_regtime; /* 發表文章 : 註冊時間限制 */
+ uint8_t pad2_2[1]; /* (已停用) 發表文章 : 註冊時間限制 */
uint8_t bvote; /* 正舉辦 Vote 數 */
time4_t vtime; /* Vote close time */
uint32_t level; /* 可以看此板的權限 */
diff --git a/pttbbs/mbbsd/bbs.c b/pttbbs/mbbsd/bbs.c
index 94ce9d0a..ee1f26d9 100644
--- a/pttbbs/mbbsd/bbs.c
+++ b/pttbbs/mbbsd/bbs.c
@@ -507,8 +507,7 @@ char* get_board_restriction_reason(int bid, size_t sz_msg, char *msg)
return get_restriction_reason(
cuser.firstlogin, cuser.numlogindays, cuser.numposts, cuser.badpost,
- bp->post_limit_regtime, bp->post_limit_logins,
- bp->post_limit_posts, bp->post_limit_badpost,
+ bp->post_limit_logins, bp->post_limit_posts, bp->post_limit_badpost,
sz_msg, msg);
}
@@ -2348,15 +2347,15 @@ read_post(int ent, fileheader_t * fhdr, const char *direct)
}
void
-editLimits(unsigned char *pregtime, unsigned char *plogins,
- unsigned char *pposts, unsigned char *pbadpost)
+editLimits(unsigned char *plogins,
+ unsigned char *pposts,
+ unsigned char *pbadpost)
{
char genbuf[STRLEN];
int temp, y;
// load var
unsigned char
- regtime = *pregtime,
logins = *plogins,
posts = *pposts,
badpost = *pbadpost;
@@ -2374,30 +2373,12 @@ editLimits(unsigned char *pregtime, unsigned char *plogins,
"但板主又以為沒改過。 設定前請跟板主確認過這不是舊的設定數值。\n"
ANSI_RESET);
- // migrate old data
- if (regtime) {
- prints(ANSI_COLOR(1;31) "\n請注意原註冊時間限制(%d個月)已", regtime);
- if (logins == 0) {
- logins = (unsigned char)regtime * 30 / 10;
- prints("轉換為" STR_LOGINDAYS "(%d次)", logins * 10);
- } else {
- prints("被" STR_LOGINDAYS "(%d次)取代。", logins * 10);
- }
- outs(ANSI_RESET "\n");
- regtime = 0;
- }
-
sprintf(genbuf, "%u", logins*10);
do {
getdata_buf(y, 0,
STR_LOGINDAYS "下限 (0~2550,以10為單位,個位數字將自動捨去):",
genbuf, 5, NUMECHO);
temp = atoi(genbuf);
- if (regtime && temp > regtime * 30) {
- strcpy(genbuf, "0");
- bell();
- continue;
- }
} while (temp < 0 || temp > 2550);
logins = (unsigned char)(temp / 10);
move(y+1, 0); clrtobot();
@@ -2421,7 +2402,6 @@ editLimits(unsigned char *pregtime, unsigned char *plogins,
badpost = (unsigned char)(255 - temp);
// save var
- *pregtime = regtime;
*plogins = logins;
*pposts = posts;
*pbadpost = badpost;
@@ -2450,7 +2430,6 @@ do_limitedit(int ent, fileheader_t * fhdr, const char *direct)
if ((HasUserPerm(PERM_SYSOP) || (HasUserPerm(PERM_SYSSUPERSUBOP) && GROUPOP())) && buf[0] == 'a') {
editLimits(
- &bp->post_limit_regtime,
&bp->post_limit_logins,
&bp->post_limit_posts,
&bp->post_limit_badpost);
@@ -2464,7 +2443,6 @@ do_limitedit(int ent, fileheader_t * fhdr, const char *direct)
else if (buf[0] == 'b') {
editLimits(
- &bp->vote_limit_regtime,
&bp->vote_limit_logins,
&bp->vote_limit_posts,
&bp->vote_limit_badpost);
@@ -2478,7 +2456,6 @@ do_limitedit(int ent, fileheader_t * fhdr, const char *direct)
else if ((fhdr->filemode & FILE_VOTE) && buf[0] == 'c') {
editLimits(
- &fhdr->multi.vote_limits.regtime,
&fhdr->multi.vote_limits.logins,
&fhdr->multi.vote_limits.posts,
&fhdr->multi.vote_limits.badpost);
diff --git a/pttbbs/mbbsd/board.c b/pttbbs/mbbsd/board.c
index d3ed77d9..1d551f05 100644
--- a/pttbbs/mbbsd/board.c
+++ b/pttbbs/mbbsd/board.c
@@ -314,7 +314,6 @@ b_config(void)
// limits
uint8_t llogin = bp->post_limit_logins,
lpost = bp->post_limit_posts,
- lreg = bp->post_limit_regtime,
lbp = bp->post_limit_badpost;
move(ytitle-1, 0);
@@ -450,7 +449,6 @@ b_config(void)
{
llogin = bp->vote_limit_logins;
lpost = bp->vote_limit_posts;
- lreg = bp->vote_limit_regtime;
lbp = bp->vote_limit_badpost;
}
@@ -476,22 +474,6 @@ b_config(void)
hasres = 1;
}
- if (lreg)
- {
- move_ansi(ipostres++, COLPOSTRES);
- i = lreg;
- attr = (cuser.firstlogin >
- (now - (time4_t)lreg * MONTH_SECONDS)) ? 1 : 0;
- if (attr) outs(ANSI_COLOR(1;31) "*");
- outs("註冊時間 ");
- if (i < 5)
- prints("%d 天以上", i*30);
- else
- prints("%d 個月以上",i);
- if (attr) outs(ANSI_RESET);
- hasres = 1;
- }
-
if (lbp)
{
move_ansi(ipostres++, COLPOSTRES);
diff --git a/pttbbs/mbbsd/cal.c b/pttbbs/mbbsd/cal.c
index 2f5070a1..8e8a94ba 100644
--- a/pttbbs/mbbsd/cal.c
+++ b/pttbbs/mbbsd/cal.c
@@ -7,16 +7,12 @@
char *get_restriction_reason(
time4_t firstlogin, unsigned int numlogindays,
unsigned int numposts, unsigned int badpost,
- time4_t limits_regtime, unsigned int limits_logins,
- unsigned int limits_posts, unsigned int limits_badpost,
+ unsigned int limits_logins,
+ unsigned int limits_posts,
+ unsigned int limits_badpost,
size_t sz_msg, char *msg) {
syncnow();
- if (firstlogin > (now - limits_regtime * MONTH_SECONDS)) {
- snprintf(msg, sz_msg, "註冊時間未滿 %d 天(目前%d天)",
- limits_regtime * 30, (now - firstlogin) / DAY_SECONDS);
- return msg;
- }
if (numlogindays / 10 < limits_logins) {
snprintf(msg, sz_msg,
STR_LOGINDAYS "未滿 %d " STR_LOGINDAYS
diff --git a/pttbbs/mbbsd/voteboard.c b/pttbbs/mbbsd/voteboard.c
index 2a625329..1cb3d8a8 100644
--- a/pttbbs/mbbsd/voteboard.c
+++ b/pttbbs/mbbsd/voteboard.c
@@ -11,8 +11,9 @@ char *CheckVoteRestrictionBoard(int bid, size_t sz_msg, char *msg)
return get_restriction_reason(
cuser.firstlogin, cuser.numlogindays, cuser.numposts, cuser.badpost,
- bh->vote_limit_regtime, bh->vote_limit_logins,
- bh->vote_limit_posts, bh->vote_limit_badpost,
+ bh->vote_limit_logins,
+ bh->vote_limit_posts,
+ bh->vote_limit_badpost,
sz_msg, msg);
}
@@ -24,8 +25,9 @@ char *CheckVoteRestrictionFile(
return get_restriction_reason(
cuser.firstlogin, cuser.numlogindays, cuser.numposts, cuser.badpost,
- fhdr->multi.vote_limits.regtime, fhdr->multi.vote_limits.logins,
- fhdr->multi.vote_limits.posts, fhdr->multi.vote_limits.badpost,
+ fhdr->multi.vote_limits.logins,
+ fhdr->multi.vote_limits.posts,
+ fhdr->multi.vote_limits.badpost,
sz_msg, msg);
}
@@ -383,7 +385,6 @@ do_voteboard(int type)
votefile.filemode |= FILE_VOTE;
/* use lower 16 bits of 'money' to store limits */
/* lower 8 bits are posts, higher 8 bits are logins */
- votefile.multi.vote_limits.regtime = bcache[currbid - 1].vote_limit_regtime;
votefile.multi.vote_limits.logins = bcache[currbid - 1].vote_limit_logins;
votefile.multi.vote_limits.posts = bcache[currbid - 1].vote_limit_posts;
votefile.multi.vote_limits.badpost = bcache[currbid - 1].vote_limit_badpost;
diff --git a/pttbbs/util/shmctl.c b/pttbbs/util/shmctl.c
index 3cef256a..eb0c9c86 100644
--- a/pttbbs/util/shmctl.c
+++ b/pttbbs/util/shmctl.c
@@ -665,7 +665,6 @@ int listbrd(int argc, char **argv)
printf("post_limit_posts:\t%d\n", b.post_limit_posts);
printf("post_limit_logins:\t%d\n", b.post_limit_logins);
- printf("post_limit_regtime:\t%d\n", b.post_limit_regtime);
printf("level:\t%d\n", b.level);
printf("gid:\t%d\n", b.gid);
printf("parent:\t%d\n", b.parent);
diff --git a/pttbbs/util/showboard.c b/pttbbs/util/showboard.c
index 41627cfe..aac4fbee 100644
--- a/pttbbs/util/showboard.c
+++ b/pttbbs/util/showboard.c
@@ -69,7 +69,6 @@ int main(int argc, char *argv[])
printf("brdattr:\t%08x\n", b.brdattr);
printf("post_limit_posts:\t%d\n", b.post_limit_posts);
printf("post_limit_logins:\t%d\n", b.post_limit_logins);
- printf("post_limit_regtime:\t%d\n", b.post_limit_regtime);
printf("level:\t%d\n", b.level);
printf("gid:\t%d\n", b.gid);
printf("parent:\t%d\n", b.parent);