Empire CMS Anti-irrigation, anti-spam message

Source: Internet
Author: User

There is a message board on the website, the server has been black recently, often a lot of rubbish. Just like the following:

What ' s The last date I can post this to to arrive in time for Christmas? <a href= "http://soundcloud.com/groups/zyprexa-buy" >zyprexa buy
</a> building Electronic enlargement.
<a href= "Http://soundcloud.com/groups/order-zyban" >order zyban </a> cut of the
chicken into quarters. Saute the chicken to brown in a little and put inside. Put oil in a heavy
<a href= "http://soundcloud.com/groups/zyprexa-10" >zyprexa
</a> Colorado CO Ne W Jersey NJ
<a href= "Http://soundcloud.com/groups/online-zyprexa" >online zyprexa
</a> Transaction with a entry in the eligibility clarification Code (309-C9) field on the Insurance
<a href= "http://so Undcloud.com/groups/purchase-zyprexa ">purchase Zyprexa </a> and for each
prescription item on the receipt:

In order to prevent spam, to the backend management staff to reduce workload, I suggest matching content, filter messages, but one team members do not agree that the opening of the verification code is more reasonable.

I had more important things in hand then I did it by exclusivity.


In my habit, I would not be able to fill in the contents of the verification code, especially if it was difficult to see, if I asked for a suggested message. Even if a mailbox site to register three times, five times the input registration code, it is a test of patience, and waste other people's time.


As a result, one weeks after the opening of the verification code, no message backstage.


So it closed again, but the rubbish came again.


or back to my original proposal, because the long image of the garbage is very characteristic, and the user's comments are very distinctive, so, as long as the match is OK. This method is for the reference of the friend who needs this aspect.

The specific method is as follows.

Modify File: e\enews\gbookfun.php

Modified as follows:

Post Message function Addgbook ($add) {Global $empire, $dbtbpre, $level _r, $public _r;
	Verify IP echeckaccessdoip (' Gbook '); Checkcanposturl ();
	Verify source $bid = (int) getcvar (' gbookbid ');
	if (empty ($bid)) {$bid = Intval ($add [bid]);
	$name = Reppoststr (Trim ($add [name]));
	$email = reppoststr ($add [email]);
	$call = Reppoststr ($add [call]);
	$lytext = Reppoststr ($add [Lytext]);
	if (Empty ($bid) | | | empty ($name) | |! Trim ($lytext)) {printerror ("Emptygbookname", "History.go (-1)", 1);
		///Match, if there is the injection of the machine, then directly omit if (! Preg_match ($pattern, $lytext)) {//verify code $keyvname = ' Checkgbookkey ';
		if ($public _r [' GBKEY_OK ']) {Ecmscheckshowkey ($keyvname, $add [' key '], 1);
		} $lasttime = Getcvar (' lastgbooktime ');
			if ($lasttime) {if (Time ()-$lasttime < $public _r [' regbooktime ']) {printerror ("Gbouttime", "", 1); }//Layout exists $BR = $empire->fetch1 ("select Bid,checked,groupid from {$dbtbpre}enewsgbookclass w")Here bid= ' $bid '; ");
		if (Empty ($br [bid])) {Printerror ("Emptygbook", "History.go (-1)", 1);
			}//permission if ($br [' GroupID ']) {$user = IsLogin (); if ($level _r [$BR [GroupID]] [level] > $level _r [$user [GroupID]] [level]) {Printerror ("Havenotenlevel", "histor
			Y.go (-1) ", 1);
		}} $lytime = Date ("y-m-d h:i:s");
		$ip = Egetip ();
		$userid = (int) getcvar (' Mluserid ');
		$username = Reppostvar (Getcvar (' mlusername ')); $sql = $empire->query (insert into {$dbtbpre}enewsgbook (name,email, ' call ', lytime,lytext,retext,bid,ip,checked, Userid,username) VALUES (' $name ', ' $email ', ' $call ', ' $lytime ', ' $lytext ', ', ' $bid ', ' $ip ', ' $br [checked] ', ' $userid ', '
		$username '); Ecmsemptyshowkey ($keyvname); Empty the Verification code if ($sql) {Esetcookie ("Lastgbooktime", Time (), times () + 3600 * 24);//Set last published $reurl = Doingretur Nurl ("..
			/tool/gbook/?bid= $bid ", $add [' Ecmsfrom ']);
		Printerror ("Addgbooksuccess", $reurl, 1); else {printerror ("DBerror "," History.go (-1) ", 1);
	}}else{Printerror ("Haveplclosewords", "History.go (-1)", 1); }
}

PS: Because different content, regular matching expression is not the same, here, I use variable $pattern instead.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.