summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-08-30 18:15:42 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-08-30 18:15:42 +0800
commitbe508920d9516539c9423d351fa2ba7fe2b910e1 (patch)
tree180a8bf165a226e4132876699276c899adb3d21b
parent5f589c904a3be5b6eaa5abd57052b481d6a24c18 (diff)
downloadpttbbs-be508920d9516539c9423d351fa2ba7fe2b910e1.tar
pttbbs-be508920d9516539c9423d351fa2ba7fe2b910e1.tar.gz
pttbbs-be508920d9516539c9423d351fa2ba7fe2b910e1.tar.bz2
pttbbs-be508920d9516539c9423d351fa2ba7fe2b910e1.tar.lz
pttbbs-be508920d9516539c9423d351fa2ba7fe2b910e1.tar.xz
pttbbs-be508920d9516539c9423d351fa2ba7fe2b910e1.tar.zst
pttbbs-be508920d9516539c9423d351fa2ba7fe2b910e1.zip
* allow numlogindays to be upgraded on-the-fly.
git-svn-id: http://opensvn.csie.org/pttbbs/branches/pttbbs.pwcu@4800 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/passwd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mbbsd/passwd.c b/mbbsd/passwd.c
index 83fb45a5..514959c5 100644
--- a/mbbsd/passwd.c
+++ b/mbbsd/passwd.c
@@ -453,6 +453,9 @@ int pwcuLoginSave ()
prev_regdays = (u.lastlogin - u.firstlogin) / DAY_SECONDS;
// assert(regdays >= prev_regdays);
+ if (u.numlogindays > prev_regdays)
+ u.numlogindays = prev_regdays;
+
// calculate numlogindays (only increase one per each key)
if (regdays > prev_regdays)
++u.numlogindays;