diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2006-06-16 15:26:12 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2006-06-16 15:26:12 +0800 |
commit | a4ca9945a1f90b2c65d73ecc454d98028a4ea0d7 (patch) | |
tree | 1ab335a00de543d08d02e62d89d53796ec0f5c6d /mbbsd/mail.c | |
parent | f7f94492d83cd0a7f70f4eda0f64e208aa8084fa (diff) | |
download | pttbbs-a4ca9945a1f90b2c65d73ecc454d98028a4ea0d7.tar pttbbs-a4ca9945a1f90b2c65d73ecc454d98028a4ea0d7.tar.gz pttbbs-a4ca9945a1f90b2c65d73ecc454d98028a4ea0d7.tar.bz2 pttbbs-a4ca9945a1f90b2c65d73ecc454d98028a4ea0d7.tar.lz pttbbs-a4ca9945a1f90b2c65d73ecc454d98028a4ea0d7.tar.xz pttbbs-a4ca9945a1f90b2c65d73ecc454d98028a4ea0d7.tar.zst pttbbs-a4ca9945a1f90b2c65d73ecc454d98028a4ea0d7.zip |
1.remove str_checksum() (use StringHash() now)
2.prevent cross posting from mail
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3371 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/mail.c')
-rw-r--r-- | mbbsd/mail.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/mbbsd/mail.c b/mbbsd/mail.c index b7011872..638dd393 100644 --- a/mbbsd/mail.c +++ b/mbbsd/mail.c @@ -1262,6 +1262,10 @@ mail_cross_post(int ent, fileheader_t * fhdr, const char *direct) char genbuf[200]; char genbuf2[4]; + if (!CheckPostPerm()) { + vmsg("對不起,您目前無法轉錄文章!"); + return FULLUPDATE; + } move(2, 0); clrtoeol(); move(1, 0); @@ -1269,6 +1273,20 @@ mail_cross_post(int ent, fileheader_t * fhdr, const char *direct) if (*xboard == '\0' || !haspostperm(xboard)) return FULLUPDATE; + /* 借用變數 */ + ent = StringHash(fhdr->title); + /* 同樣 title 不管對哪個板都算 cross post , 所以不用檢查 author */ + + if ((ent != 0 && ent == postrecord.checksum[0])) { + /* 檢查 cross post 次數 */ + if (postrecord.times++ > MAX_CROSSNUM) + anticrosspost(); + } else { + postrecord.times = 0; + postrecord.last_bid = 0; + postrecord.checksum[0] = ent; + } + ent = getbnum(xboard); assert(0<=ent-1 && ent-1<MAX_BOARD); if ( !(HasUserPerm(PERM_SYSOP)) && |