summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2012-01-31 14:02:39 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2012-01-31 14:02:39 +0800
commit5869dca0b2d10b922d780f1d8ac425ca1891f7a6 (patch)
treefe864a6299dfae6f25dfaea6ce2cdd77ef1780c1
parent55b6c4edabda3a7d5e7bc94d721b7a82e332f8b8 (diff)
downloadpttbbs-5869dca0b2d10b922d780f1d8ac425ca1891f7a6.tar
pttbbs-5869dca0b2d10b922d780f1d8ac425ca1891f7a6.tar.gz
pttbbs-5869dca0b2d10b922d780f1d8ac425ca1891f7a6.tar.bz2
pttbbs-5869dca0b2d10b922d780f1d8ac425ca1891f7a6.tar.lz
pttbbs-5869dca0b2d10b922d780f1d8ac425ca1891f7a6.tar.xz
pttbbs-5869dca0b2d10b922d780f1d8ac425ca1891f7a6.tar.zst
pttbbs-5869dca0b2d10b922d780f1d8ac425ca1891f7a6.zip
replace more firstlogin logic by numlogindays
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5534 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/include/proto.h5
-rw-r--r--pttbbs/mbbsd/bbs.c2
-rw-r--r--pttbbs/mbbsd/cal.c7
-rw-r--r--pttbbs/mbbsd/register.c6
-rw-r--r--pttbbs/mbbsd/user.c20
-rw-r--r--pttbbs/mbbsd/voteboard.c20
6 files changed, 23 insertions, 37 deletions
diff --git a/pttbbs/include/proto.h b/pttbbs/include/proto.h
index a1b55e3f..e8b97abe 100644
--- a/pttbbs/include/proto.h
+++ b/pttbbs/include/proto.h
@@ -151,8 +151,9 @@ int mail_redenvelop(const char* from, const char* to, int money, char *fpath);
void resolve_over18(void);
int resolve_over18_user(const userec_t *u);
char *get_restriction_reason(
- time4_t firstlogin, unsigned int numlogindays,
- unsigned int numposts, unsigned int badpost,
+ unsigned int numlogindays,
+ unsigned int numposts,
+ unsigned int badpost,
unsigned int limits_logins,
unsigned int limits_posts,
unsigned int limits_badpost,
diff --git a/pttbbs/mbbsd/bbs.c b/pttbbs/mbbsd/bbs.c
index ee1f26d9..ad3b271e 100644
--- a/pttbbs/mbbsd/bbs.c
+++ b/pttbbs/mbbsd/bbs.c
@@ -506,7 +506,7 @@ char* get_board_restriction_reason(int bid, size_t sz_msg, char *msg)
bp = getbcache(bid);
return get_restriction_reason(
- cuser.firstlogin, cuser.numlogindays, cuser.numposts, cuser.badpost,
+ cuser.numlogindays, cuser.numposts, cuser.badpost,
bp->post_limit_logins, bp->post_limit_posts, bp->post_limit_badpost,
sz_msg, msg);
}
diff --git a/pttbbs/mbbsd/cal.c b/pttbbs/mbbsd/cal.c
index 8e8a94ba..6be82c4c 100644
--- a/pttbbs/mbbsd/cal.c
+++ b/pttbbs/mbbsd/cal.c
@@ -5,11 +5,14 @@
// create invalid records as -1... so we'd better make it signed for real
// comparison.
char *get_restriction_reason(
- time4_t firstlogin, unsigned int numlogindays,
- unsigned int numposts, unsigned int badpost,
+ unsigned int numlogindays,
+ unsigned int numposts,
+ unsigned int badpost,
+
unsigned int limits_logins,
unsigned int limits_posts,
unsigned int limits_badpost,
+
size_t sz_msg, char *msg) {
syncnow();
diff --git a/pttbbs/mbbsd/register.c b/pttbbs/mbbsd/register.c
index 2b0942b4..8f183603 100644
--- a/pttbbs/mbbsd/register.c
+++ b/pttbbs/mbbsd/register.c
@@ -974,12 +974,6 @@ check_register(void)
" 代表您的認證由於資料不完整已被取消 (常見於申請開新看板的板主)。\n");
u_register();
-
-#ifdef NEWUSER_LIMIT
- if (cuser.lastlogin - cuser->firstlogin < 3 * DAY_SECONDS)
- cuser.userlevel &= ~PERM_POST;
- more("etc/newuser", YEA);
-#endif
}
static int
diff --git a/pttbbs/mbbsd/user.c b/pttbbs/mbbsd/user.c
index ea834d97..3400030a 100644
--- a/pttbbs/mbbsd/user.c
+++ b/pttbbs/mbbsd/user.c
@@ -303,11 +303,6 @@ user_display(const userec_t * u, int adminmode)
}
prints("\n");
}
-
-#ifdef NEWUSER_LIMIT
- if ((u->lastlogin - u->firstlogin < 3 * DAY_SECONDS) && !HasUserPerm(PERM_POST))
- outs("\n新手上路,三天後開放權限");
-#endif
}
void
@@ -391,16 +386,9 @@ violate_law(userec_t * u, int unum)
if (*ans2 != 'y')
return;
if (ans[0] == '9') {
- // 20080417, according to the request of admins, the numpost>100
- // if very easy to achive for such bad users (of course, because
- // usually they violate law by massive posting).
- // Also if he wants to prevent system auto cp check, he will
- // post -> logout -> login -> post. So both numlogin and numpost
- // are not good.
- // We changed the rule to registration date [2 month].
- if (HasUserPerm(PERM_POLICE) && ((now - u->firstlogin) >= 2*30*DAY_SECONDS))
+ if (HasUserPerm(PERM_POLICE) && u->numlogindays > 60)
{
- vmsg("使用者註冊已超過 60 天,無法砍除。");
+ vmsg("使用者" STR_LOGINDAYS "超過 60,無法砍除。");
return;
}
@@ -1060,8 +1048,8 @@ uinfo_query(const char *orig_uid, int adminmode, int unum)
} else {
userec_t atuser;
passwd_sync_query(uid, &atuser);
- if (now - atuser.firstlogin < 6 * 30 * 24 * 60 * 60) {
- outs("\n註冊未超過半年,請重新輸入\n");
+ if (atuser.numlogindays < 6*30) {
+ outs("\n" STR_LOGINDAYS "未超過 180,請重新輸入\n");
i--;
}
// Adjust upper or lower case
diff --git a/pttbbs/mbbsd/voteboard.c b/pttbbs/mbbsd/voteboard.c
index 1cb3d8a8..57d6936c 100644
--- a/pttbbs/mbbsd/voteboard.c
+++ b/pttbbs/mbbsd/voteboard.c
@@ -10,11 +10,11 @@ char *CheckVoteRestrictionBoard(int bid, size_t sz_msg, char *msg)
return NULL;
return get_restriction_reason(
- cuser.firstlogin, cuser.numlogindays, cuser.numposts, cuser.badpost,
- bh->vote_limit_logins,
- bh->vote_limit_posts,
- bh->vote_limit_badpost,
- sz_msg, msg);
+ cuser.numlogindays, cuser.numposts, cuser.badpost,
+ bh->vote_limit_logins,
+ bh->vote_limit_posts,
+ bh->vote_limit_badpost,
+ sz_msg, msg);
}
char *CheckVoteRestrictionFile(
@@ -24,11 +24,11 @@ char *CheckVoteRestrictionFile(
return NULL;
return get_restriction_reason(
- cuser.firstlogin, cuser.numlogindays, cuser.numposts, cuser.badpost,
- fhdr->multi.vote_limits.logins,
- fhdr->multi.vote_limits.posts,
- fhdr->multi.vote_limits.badpost,
- sz_msg, msg);
+ cuser.numlogindays, cuser.numposts, cuser.badpost,
+ fhdr->multi.vote_limits.logins,
+ fhdr->multi.vote_limits.posts,
+ fhdr->multi.vote_limits.badpost,
+ sz_msg, msg);
}
void