diff options
-rw-r--r-- | pttbbs/include/pttstruct.h | 6 | ||||
-rw-r--r-- | pttbbs/include/uflags.h | 9 | ||||
-rw-r--r-- | pttbbs/mbbsd/passwd.c | 6 | ||||
-rw-r--r-- | pttbbs/mbbsd/user.c | 20 |
4 files changed, 18 insertions, 23 deletions
diff --git a/pttbbs/include/pttstruct.h b/pttbbs/include/pttstruct.h index 6b76a965..a1ec4c55 100644 --- a/pttbbs/include/pttstruct.h +++ b/pttbbs/include/pttstruct.h @@ -654,10 +654,4 @@ typedef struct int show_max; /* max covered range in last display */ } SigInfo; -/* type in gomo.c, structure passing through socket */ -typedef struct { - char x; - char y; -} Horder_t; - #endif diff --git a/pttbbs/include/uflags.h b/pttbbs/include/uflags.h index e9037a68..72a21831 100644 --- a/pttbbs/include/uflags.h +++ b/pttbbs/include/uflags.h @@ -70,10 +70,11 @@ #define REJECT_OUTTAMAIL (cuser.uflag2 & REJ_OUTTAMAIL) /* ANGEL [deprecated] */ -// #define UF2_ANGEL_PAUSE 0x00000800 /* deprecated: true if don't want to be angel for a while */ -// #define UF2_ANGEL_OLDMASK 0x00003800 // mask of all deprecated stuff -// #define ANGEL_??? 0x00004000 -// #define ANGEL_??? 0x00008000 +// #define ANGEL_??? 0x00000800 /* deprecated: true if don't want to be angel for a while */ +// #define ANGEL_??? 0x00001000 // deprecated: ??? +// #define ANGEL_??? 0x00002000 // deprecated: ??? +// #define ANGEL_??? 0x00004000 // reserved then deprecated +// #define ANGEL_??? 0x00008000 // reserved then deprecated /* NEW ENTRY HERE */ // #define ???_??? 0x00010000 diff --git a/pttbbs/mbbsd/passwd.c b/pttbbs/mbbsd/passwd.c index 6a6ed455..060f0937 100644 --- a/pttbbs/mbbsd/passwd.c +++ b/pttbbs/mbbsd/passwd.c @@ -143,9 +143,13 @@ pwcuCancelBadpost() int day; PWCU_START(); + // no matter what, reload the timebomb + cuser.badpost = u.badpost; + cuser.timeremovebadpost = u.timeremovebadpost; + // check timebomb again day = (now - u.timeremovebadpost ) / DAY_SECONDS; - if (day <= BADPOST_CLEAR_DURATION) + if (day < BADPOST_CLEAR_DURATION) return -1; if (u.badpost < 1) return -1; diff --git a/pttbbs/mbbsd/user.c b/pttbbs/mbbsd/user.c index 67f5c163..d6897099 100644 --- a/pttbbs/mbbsd/user.c +++ b/pttbbs/mbbsd/user.c @@ -76,24 +76,26 @@ int u_cancelbadpost(void) int day, prev = cuser.badpost; // early check. - if(cuser.badpost==0) { + if(cuser.badpost == 0) { vmsg("你並沒有劣文."); return 0; } // early check for race condition + // XXX 由於帳號API已同步化 (pwcuAPI*) 所以這個 check 可有可無 if(search_ulistn(usernum,2)) { vmsg("請登出其他視窗, 否則不受理."); return 0; } - // XXX reload account here? + // XXX reload account here? (also simply optional) pwcuReload(); // early check for time (must do again later) - day = BADPOST_CLEAR_DURATION - (now - cuser.timeremovebadpost ) / DAY_SECONDS; - if(day>0 && day<=BADPOST_CLEAR_DURATION) { - vmsgf("每 %d 天才能申請一次, 還剩 %d 天.", BADPOST_CLEAR_DURATION, day); + day = (now - cuser.timeremovebadpost ) / DAY_SECONDS; + if (day < BADPOST_CLEAR_DURATION) { + vmsgf("每 %d 天才能申請一次, 還剩 %d 天.", + BADPOST_CLEAR_DURATION, BADPOST_CLEAR_DURATION-day); return 0; } @@ -106,12 +108,6 @@ int u_cancelbadpost(void) return 0; } - // check again for race condition - if(search_ulistn(usernum,2)) { - vmsg("請登出其他視窗, 否則不受理."); - return 0; - } - if (pwcuCancelBadpost() != 0) { vmsg("刪除失敗,請洽站務人員。"); return 0; @@ -857,7 +853,7 @@ uinfo_query(const char *orig_uid, int adminmode, int unum) do { int max_days = (x.lastlogin - x.firstlogin) / DAY_SECONDS; snprintf(genbuf, sizeof(genbuf), "%d", x.numlogindays); - if (getdata_str(y++, 0, STR_LOGINDAYS, buf, 10, DOECHO, genbuf)) + if (getdata_str(y++, 0, STR_LOGINDAYS ":", buf, 10, DOECHO, genbuf)) if ((tmp = atoi(buf)) >= 0) x.numlogindays = tmp; if (x.numlogindays > max_days) |