summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2010-06-26 12:57:27 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2010-06-26 12:57:27 +0800
commitab0f4009c4f6342da897bd78438748c98964831b (patch)
tree054e80cc236a7d3d31f3a6267fd908e9cdf36440
parent6e4d4e8c1367a3e5669bfcd98eb4211594579629 (diff)
downloadpttbbs-ab0f4009c4f6342da897bd78438748c98964831b.tar
pttbbs-ab0f4009c4f6342da897bd78438748c98964831b.tar.gz
pttbbs-ab0f4009c4f6342da897bd78438748c98964831b.tar.bz2
pttbbs-ab0f4009c4f6342da897bd78438748c98964831b.tar.lz
pttbbs-ab0f4009c4f6342da897bd78438748c98964831b.tar.xz
pttbbs-ab0f4009c4f6342da897bd78438748c98964831b.tar.zst
pttbbs-ab0f4009c4f6342da897bd78438748c98964831b.zip
* raise ordersong restriction to prevent malicious newregs
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5073 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/mbbsd/ordersong.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/pttbbs/mbbsd/ordersong.c b/pttbbs/mbbsd/ordersong.c
index c835c7f0..19473664 100644
--- a/pttbbs/mbbsd/ordersong.c
+++ b/pttbbs/mbbsd/ordersong.c
@@ -11,7 +11,10 @@
#define ORDERSONG_MIN_NUMPOST (3)
#endif
#ifndef ORDERSONG_MAX_BADPOST
-#define ORDERSONG_MAX_BADPOST (2)
+#define ORDERSONG_MAX_BADPOST (1)
+#endif
+#ifndef ORDERSONG_MIN_NUMLOGINDAYS
+#define ORDERSONG_MIN_NUMLOGINDAYS (30)
#endif
#define MAX_SONGS (MAX_ADBANNER-100) // (400) XXX MAX_SONGS should be fewer than MAX_ADBANNER.
@@ -30,7 +33,7 @@ do_order_song(void)
int nsongs;
char save_title[STRLEN];
- // 由於變免費了,改成要文章數吧
+ // 由於變免費了,改成要文章數跟登入天數
#ifdef ORDERSONG_MIN_NUMPOST
if (cuser.numposts < ORDERSONG_MIN_NUMPOST) {
vmsgf("為避免濫用,點歌前請先獲得 %d 篇有效文章記錄",
@@ -45,6 +48,13 @@ do_order_song(void)
return 0;
}
#endif
+#ifdef ORDERSONG_MIN_NUMLOGINDAYS
+ if (cuser.numlogindays < ORDERSONG_MIN_NUMLOGINDAYS) {
+ vmsgf("為避免濫用,點歌前要先有%s %d %s",
+ STR_LOGINDAYS, ORDERSONG_MIN_NUMLOGINDAYS, STR_LOGINDAYS_QTY);
+ return 0;
+ }
+#endif
strlcpy(buf, Cdatedate(&now), sizeof(buf));
lockreturn0(OSONG, LOCK_MULTI);