diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-08-25 21:22:38 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-08-25 21:22:38 +0800 |
commit | 00f1e5a84015dac18d4b66f51cd0284afb552be5 (patch) | |
tree | ea20f6a42fdec9703c092c67026973a3942f7e78 /mbbsd/voteboard.c | |
parent | 2f63f3e91fd9acfa1fdc0d7aa17d172d7c3f9ed4 (diff) | |
download | pttbbs-00f1e5a84015dac18d4b66f51cd0284afb552be5.tar pttbbs-00f1e5a84015dac18d4b66f51cd0284afb552be5.tar.gz pttbbs-00f1e5a84015dac18d4b66f51cd0284afb552be5.tar.bz2 pttbbs-00f1e5a84015dac18d4b66f51cd0284afb552be5.tar.lz pttbbs-00f1e5a84015dac18d4b66f51cd0284afb552be5.tar.xz pttbbs-00f1e5a84015dac18d4b66f51cd0284afb552be5.tar.zst pttbbs-00f1e5a84015dac18d4b66f51cd0284afb552be5.zip |
* remove numlogin from vote/post restriction (confirmed by SYSOPs)
* reason: this variable can be easily cheated by bots and hard to detect/avoid.
* this can be replaced by regtime (or, count of 'days' that logged in).
* we also plan to remove all references to numlogins in future because it's hard to be kept on web-forum systems.
* also refined code layout in pttstruct.h
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4774 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/voteboard.c')
-rw-r--r-- | mbbsd/voteboard.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/mbbsd/voteboard.c b/mbbsd/voteboard.c index 1cc08bb5..50c6053d 100644 --- a/mbbsd/voteboard.c +++ b/mbbsd/voteboard.c @@ -12,8 +12,6 @@ int CheckVoteRestriction(int bid) // check first-login if (cuser.firstlogin > (now - (time4_t)bcache[bid - 1].vote_limit_regtime * MONTH_SECONDS)) return 0; - if (cuser.numlogins / 10 < (unsigned int)bcache[bid - 1].vote_limit_logins) - return 0; 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)) @@ -31,8 +29,6 @@ int CheckVoteRestrictionFile(const fileheader_t * fhdr) // check first-login if (cuser.firstlogin > (now - (time4_t)fhdr->multi.vote_limits.regtime * MONTH_SECONDS)) return 0; - if (cuser.numlogins / 10 < (unsigned int)fhdr->multi.vote_limits.logins) - return 0; if (cuser.numposts / 10 < (unsigned int)fhdr->multi.vote_limits.posts) return 0; if (cuser.badpost > (255 - (unsigned int)fhdr->multi.vote_limits.badpost)) @@ -396,7 +392,6 @@ 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; - 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; setbdir(genbuf, currboard); |