summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-10-23 21:52:28 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-10-23 21:52:28 +0800
commit9c16cd4b96fc3ef39e970a522622441b2c04224a (patch)
tree22783a70858906b544be885568aea34076b89eff
parenteab5ae4ac89ab2aba21ba1471475719b21acaf85 (diff)
downloadpttbbs-9c16cd4b96fc3ef39e970a522622441b2c04224a.tar
pttbbs-9c16cd4b96fc3ef39e970a522622441b2c04224a.tar.gz
pttbbs-9c16cd4b96fc3ef39e970a522622441b2c04224a.tar.bz2
pttbbs-9c16cd4b96fc3ef39e970a522622441b2c04224a.tar.lz
pttbbs-9c16cd4b96fc3ef39e970a522622441b2c04224a.tar.xz
pttbbs-9c16cd4b96fc3ef39e970a522622441b2c04224a.tar.zst
pttbbs-9c16cd4b96fc3ef39e970a522622441b2c04224a.zip
* login_limits look stable now, let's enable it as standard configuration.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@4971 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/mbbsd/bbs.c5
-rw-r--r--pttbbs/mbbsd/board.c2
-rw-r--r--pttbbs/mbbsd/vote.c2
-rw-r--r--pttbbs/mbbsd/voteboard.c6
4 files changed, 0 insertions, 15 deletions
diff --git a/pttbbs/mbbsd/bbs.c b/pttbbs/mbbsd/bbs.c
index c44701f1..99f91acd 100644
--- a/pttbbs/mbbsd/bbs.c
+++ b/pttbbs/mbbsd/bbs.c
@@ -416,13 +416,10 @@ int CheckPostRestriction(int bid)
return 1;
bp = getbcache(bid);
- // check first-login
if (cuser.firstlogin > (now - (time4_t)bp->post_limit_regtime * MONTH_SECONDS))
return 0;
-#ifdef USE_LOGIN_LIMITS
if (cuser.numlogindays / 10 < (unsigned int)bp->post_limit_logins)
return 0;
-#endif
// XXX numposts itself is an integer, but some records (by del post!?) may
// create invalid records as -1... so we'd better make it signed for real
// comparison.
@@ -2012,7 +2009,6 @@ editLimits(unsigned char *pregtime, unsigned char *plogins,
} while (temp < 0 || temp > 255);
regtime = (unsigned char)temp;
-#ifdef USE_LOGIN_LIMITS
sprintf(genbuf, "%u", logins*10);
do {
move(b_lines-1, 0); clrtoeol(); // because previous prompt has same BIG5 prefix here
@@ -2021,7 +2017,6 @@ editLimits(unsigned char *pregtime, unsigned char *plogins,
temp = atoi(genbuf);
} while (temp < 0 || temp > 2550);
logins = (unsigned char)(temp / 10);
-#endif
sprintf(genbuf, "%u", posts*10);
do {
diff --git a/pttbbs/mbbsd/board.c b/pttbbs/mbbsd/board.c
index f878e0ca..c5074e58 100644
--- a/pttbbs/mbbsd/board.c
+++ b/pttbbs/mbbsd/board.c
@@ -446,7 +446,6 @@ b_config(void)
lbp = bp->vote_limit_badpost;
}
-#ifdef USE_LOGIN_LIMITS
if (llogin)
{
move_ansi(ipostres++, COLPOSTRES);
@@ -457,7 +456,6 @@ b_config(void)
if (attr) outs(ANSI_RESET);
hasres = 1;
}
-#endif
if (lpost)
{
diff --git a/pttbbs/mbbsd/vote.c b/pttbbs/mbbsd/vote.c
index 2c6b9d01..09564e79 100644
--- a/pttbbs/mbbsd/vote.c
+++ b/pttbbs/mbbsd/vote.c
@@ -647,12 +647,10 @@ vote_maintain(const char *bname)
} while (closetime < 0 || closetime > 120);
fprintf(fp, "%d\n", now - (MONTH_SECONDS * closetime));
closetime = 0;
-#ifdef USE_LOGIN_LIMITS
do {
getdata(6, 0, STR_LOGINDAYS "¤U­­", inbuf, 6, DOECHO);
closetime = atoi(inbuf); // borrow variable
} while (closetime < 0);
-#endif
fprintf(fp, "%d\n", closetime);
do {
getdata(6, 0, "¤å³¹½g¼Æ¤U­­", inbuf, 6, DOECHO);
diff --git a/pttbbs/mbbsd/voteboard.c b/pttbbs/mbbsd/voteboard.c
index 796fa31b..e278a554 100644
--- a/pttbbs/mbbsd/voteboard.c
+++ b/pttbbs/mbbsd/voteboard.c
@@ -12,10 +12,8 @@ int CheckVoteRestriction(int bid)
// check first-login
if (cuser.firstlogin > (now - (time4_t)bcache[bid - 1].vote_limit_regtime * MONTH_SECONDS))
return 0;
-#ifdef USE_LOGIN_LIMITS
if (cuser.numlogindays / 10 < (unsigned int)bcache[bid - 1].vote_limit_logins)
return 0;
-#endif
if (cuser.numposts / 10 < (unsigned int)bcache[bid - 1].vote_limit_posts)
return 0;
if (cuser.badpost > (255 - (unsigned int)bcache[bid - 1].vote_limit_badpost))
@@ -33,10 +31,8 @@ int CheckVoteRestrictionFile(const fileheader_t * fhdr)
// check first-login
if (cuser.firstlogin > (now - (time4_t)fhdr->multi.vote_limits.regtime * MONTH_SECONDS))
return 0;
-#ifdef USE_LOGIN_LIMITS
if (cuser.numlogindays / 10 < (unsigned int)fhdr->multi.vote_limits.logins)
return 0;
-#endif
if (cuser.numposts / 10 < (unsigned int)fhdr->multi.vote_limits.posts)
return 0;
if (cuser.badpost > (255 - (unsigned int)fhdr->multi.vote_limits.badpost))
@@ -400,9 +396,7 @@ do_voteboard(int type)
/* 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;
-#ifdef USE_LOGIN_LIMITS
votefile.multi.vote_limits.logins = bcache[currbid - 1].vote_limit_logins;
-#endif
votefile.multi.vote_limits.posts = bcache[currbid - 1].vote_limit_posts;
votefile.multi.vote_limits.badpost = bcache[currbid - 1].vote_limit_badpost;
setbdir(genbuf, currboard);