summaryrefslogtreecommitdiffstats
path: root/mbbsd/voteboard.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-09-14 01:13:33 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-09-14 01:13:33 +0800
commit9bb2b461450f6b953032aac4e57238cdff4e296a (patch)
treed102bbf927737bf989f5916c7c26f3d178734a1c /mbbsd/voteboard.c
parent05dd93de8f37b2fcb2c7ed26c0cb18e550678494 (diff)
downloadpttbbs-9bb2b461450f6b953032aac4e57238cdff4e296a.tar
pttbbs-9bb2b461450f6b953032aac4e57238cdff4e296a.tar.gz
pttbbs-9bb2b461450f6b953032aac4e57238cdff4e296a.tar.bz2
pttbbs-9bb2b461450f6b953032aac4e57238cdff4e296a.tar.lz
pttbbs-9bb2b461450f6b953032aac4e57238cdff4e296a.tar.xz
pttbbs-9bb2b461450f6b953032aac4e57238cdff4e296a.tar.zst
pttbbs-9bb2b461450f6b953032aac4e57238cdff4e296a.zip
* put-back the code to handle numlogin (changed to numlogindays)
* we can enable this after current code base becomes stable git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4838 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/voteboard.c')
-rw-r--r--mbbsd/voteboard.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/mbbsd/voteboard.c b/mbbsd/voteboard.c
index 50c6053d..796fa31b 100644
--- a/mbbsd/voteboard.c
+++ b/mbbsd/voteboard.c
@@ -12,6 +12,10 @@ 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))
@@ -29,6 +33,10 @@ 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))
@@ -392,6 +400,9 @@ 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);