Changeset 185118
- Timestamp:
- 12/20/2009 12:39:00 AM (16 years ago)
- Location:
- ttc-user-registration-bot-detector/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (1 diff)
-
ttc_user_registration.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ttc-user-registration-bot-detector/trunk/readme.txt
r185105 r185118 4 4 Requires at least: 2.5 5 5 Tested up to: 2.5.1 6 Stable tag: 1. 96 Stable tag: 1.10 7 7 8 8 This plugin blocks and logs most bot user registrations. -
ttc-user-registration-bot-detector/trunk/ttc_user_registration.php
r185105 r185118 3 3 /* 4 4 Plugin Name: TimesToCome Stop Bot Registration 5 Version: 1. 95 Version: 1.10 6 6 Plugin URI: http://herselfswebtools.com/2008/06/wordpress-plugin-to-prevent-bot-registrations.html 7 7 Description: Stop bots from registering as users … … 11 11 12 12 13 14 // version 1.9 is a security fix 15 // ****************************************************************************************** 16 // version 2.0 sends rejected bots back to main site page 17 // if you'd rather send them to a custom error page as before uncomment the custom error page 18 // and comment out // send rejections back to main site page 19 //$host = $_SERVER['HTTP_HOST']; 20 //$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\'); 21 //header("Location: http://$host$uri"); 22 // which is in here twice starting around line 265 23 // ******************************************************************************************* 24 13 25 14 26 … … 246 258 247 259 248 /*249 // most hosting companies don't allow file_get_contents - need alternative!250 // but if you can use it, do so.251 // check forumspam252 if ( $blacklisted == 0 ){253 $check = file_get_contents ( "http://www.stopforumspam.com/api?email=$new_user" );254 $test = "<appears>yes</appears>";255 256 if ( strpos( $check, $test) > 0 ) {257 $blacklisted = 13;258 }259 }260 */261 262 263 /* // uncomment this if you wish to check the spamhaus blacklist.264 // check spamhaus265 if ( $blacklisted == 0 ){266 $spam_haus = 'zen.spamhaus.org';267 268 // valid query format is: ][reversed ip].zen.spamhaus.org269 270 $reverse_ip = array_reverse(explode('.', $http_remote_addr));271 $lookup = implode('.', $reverse_ip) . '.' . $spam_haus;272 273 274 if ($lookup == "127.0.0.2" ){ // direct ube sources, verified spam services and rokso spammers275 $blacklisted = 14;276 }else if (( $lookup == "127.0.0.4" )||( $lookup == "127.0.0.5" ) || ( $lookup == "127.0.0.6" )){ // 3rd party exploits277 $blacklisted = 15;278 }279 }280 */281 282 283 260 284 261 … … 296 273 ttc_add_to_log( $new_user, $blacklisted ); 297 274 275 276 // send rejections back to main site page 277 $host = $_SERVER['HTTP_HOST']; 278 $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\'); 279 header("Location: http://$host$uri"); 280 281 282 // or print a custom error page if you prefer 283 /* 298 284 // print error page 299 285 print "<html>\n"; … … 303 289 print "</body>\n"; 304 290 print "</html>\n"; 305 291 */ 306 292 exit(); 307 293 … … 315 301 ttc_add_to_ip_blacklist( $http_remote_addr ); 316 302 303 // send rejections back to main site page 304 $host = $_SERVER['HTTP_HOST']; 305 $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\'); 306 header("Location: http://$host$uri"); 307 308 // or send a custom error page if you prefer 309 /* 317 310 //print error page 318 311 print "<html>\n"; … … 322 315 print "</body>\n"; 323 316 print "</html>\n"; 324 317 */ 318 319 325 320 exit(); 326 321
Note: See TracChangeset
for help on using the changeset viewer.