All pastes #181714 Raw Edit

Quelque chose

public text v1 · immutable
#181714 ·published 2006-09-25 09:43 UTC
rendered paste body
##############################################################
## MOD Title: Unique Registration Hash
## MOD Author: pentapenguin < n/a > (Jeremy Conley) http://www.pentapenguin.com
## MOD Description: This MOD changes the "agreed=true" part of the registration 
## form to a unique identifier to help stop spam bots from registering.
## MOD Version: 0.1.0
## Installation Level: Easy
## Installation Time: 5 Minutes
## Files To Edit: 1
## includes/usercp_register.php
############################################################## 


#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php


#
#-----[ FIND ]------------------------------------------
#
$unhtml_specialchars_replace = array('>', '<', '"', '&');


#
#-----[ AFTER, ADD ]------------------------------------------
#

// Begin Unique Registration Hash MOD by pentapenguin (http://www.pentapenguin.com)
$registration_hash = md5($userdata['session_ip'] . $userdata['session_id']);
// End Unique Registration Hash MOD by pentapenguin


#
#-----[ FIND ]------------------------------------------
#
	global $userdata, $template, $lang


#
#-----[ IN-LINE FIND ]------------------------------------------
#
$phpEx


#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, $registration_hash


#
#-----[ FIND ]------------------------------------------
#
		"U_AGREE_OVER13" => append_sid("profile.$phpEx


#
#-----[ IN-LINE FIND ]------------------------------------------
#
agreed=true


#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
agreed=$registration_hash


#
#-----[ FIND ]------------------------------------------
#
		"U_AGREE_UNDER13" => append_sid("profile.$phpEx


#
#-----[ IN-LINE FIND ]------------------------------------------
#
agreed=true


#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
agreed=$registration_hash


#
#-----[ FIND ]------------------------------------------
#
if ( $mode == 'register' && !isset($HTTP_POST_VARS['agreed']) && !isset($HTTP_GET_VARS['agreed']) )


#
#-----[ IN-LINE FIND ]------------------------------------------
#
!isset($HTTP_POST_VARS['agreed']) && !isset($HTTP_GET_VARS['agreed'])


#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
$HTTP_POST_VARS['agreed'] != $registration_hash && $HTTP_GET_VARS['agreed'] != $registration_hash


#
#-----[ FIND ]------------------------------------------
#
	$s_hidden_fields = '<input type="hidden"


#
#-----[ IN-LINE FIND ]------------------------------------------
#
name="agreed" value="true"


#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
name="agreed" value="' . $registration_hash . '"



#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM