mod 510
Geplaatst: 07 nov 2004, 22:15
Heb deze ingebouwd, maar zie geen enkel verschil.
Is deze niet geschikt voor phpBB-2.0.10 ?????
##############################################################
## MOD Title: Yet Another Anti Robotic Register Flood
## MOD Author: Iluvatar
##
## MOD Information: Most of the code comes from Smartor's Anti Robotic Register Flood
## I've just modded the mod. I wanted a more comercial type look, aswell
## as avoiding using images (Some users found the difficult to understand
## don't ask me why).
##
## MOD Description: This will add a Random-graphical-text Vadiation field in
## Registration form to protect your phpBB from being flooded
## of robotic-member-registration (like many free webhost signup form...)
## MOD Version: 0.0.3
##
## MOD Credits: Smartor < smartor_xp@hotmail.com > (Hoang Ngoc Tu) http://smartor.is-root.com
##
## Installation Level: easy
## Installation Time: 10 Minutes
## Files To Edit: 4
## includes/constants.php
## includes/usercp_register.php
## admin/admin_board.php
## templates/subSilver/admin/board_config_body.tpl
##
## Included Files: 1
## yaarrf_pic.php
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ SQL ]---------------------------------------------
#
CREATE TABLE phpbb_anti_robotic_reg (
session_id char(32) DEFAULT '' NOT NULL,
reg_key char(5) NOT NULL,
timestamp int(11) unsigned NOT NULL,
PRIMARY KEY (session_id));
#
#-----[ COPY ]--------------------------------------------
#
copy yaarrf_pic.php to yaarrf_pic.php
#
#-----[ OPEN ]--------------------------------------------
#
includes/constants.php
#
#-----[ FIND ]--------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]-------------------------------------
#
// Anti Robotic Register
define('ANTI_ROBOT_TABLE', $table_prefix.'anti_robotic_reg');
#
#-----[ OPEN ]--------------------------------------------
#
includes/usercp_register.php
#
#-----[ FIND ]--------------------------------------------
#
$strip_var_list = array('username' => 'username',
#
#-----[ AFTER, ADD ]--------------------------------------
#
'confirm_code' => 'confirm_code',
#
#-----[ FIND ]--------------------------------------------
#
else if ( $mode == 'register' )
{
if ( empty($username) || empty($new_password) || empty($password_confirm) || empty($email) )
{
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Fields_empty'];
}
#
#-----[ AFTER, ADD ]--------------------------------------
#
if ( $board_config['enable_confirm'] ) {
if ( empty($confirm_code) ) {
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Fields_empty'];
} else {
$sql = "SELECT * FROM " . ANTI_ROBOT_TABLE . " WHERE session_id = '" . $userdata['session_id'] . "'";
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not obtain registration information', '', __LINE__, __FILE__, $sql);
}
$anti_robot_row = $db->sql_fetchrow($result);
if ( $confirm_code != $anti_robot_row['reg_key'] )
{
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Confirm_code_wrong'];
} else {
$sql = "DELETE FROM " . ANTI_ROBOT_TABLE . " WHERE session_id = '" . $userdata['session_id'] . "'";
if( $db->sql_query($sql) == FALSE )
{
message_die(GENERAL_ERROR, 'Could not delete validation key', '', __LINE__, __FILE__, $sql);
}
}
}
}
#
#-----[ FIND ]--------------------------------------------
#
'CUR_PASSWORD' => $cur_password,
'NEW_PASSWORD' => $new_password,
'PASSWORD_CONFIRM' => $password_confirm,
#
#-----[ AFTER, ADD ]--------------------------------------
#
'CONFIRM_IMG' => '<img src="yaarrf_pic.php" />',
#
#-----[ FIND ]--------------------------------------------
#
'L_CONFIRM_PASSWORD_EXPLAIN' => ( $mode == 'editprofile' ) ? $lang['Confirm_password_explain'] : '',
'L_PASSWORD_IF_CHANGED' => ( $mode == 'editprofile' ) ? $lang['password_if_changed'] : '',
'L_PASSWORD_CONFIRM_IF_CHANGED' => ( $mode == 'editprofile' ) ? $lang['password_confirm_if_changed'] : '',
#
#-----[ AFTER, ADD ]--------------------------------------
#
'L_CONFIRM_CODE_IMPAIRED' => ( $mode == 'register' ) ? $lang['Confirm_code_impaired'] : '',
'L_CONFIRM_CODE' => ( $mode == 'register' ) ? $lang['Confirm_code'] : '',
'L_CONFIRM_CODE_EXPLAIN' => ( $mode == 'register' ) ? $lang['Confirm_code_explain'] : '',
#
#-----[ FIND ]--------------------------------------------
#
}
}
$template->pparse('body');
#
#-----[ BEFORE, ADD ]--------------------------------------
#
} else {
if ( $board_config['enable_confirm'] ) {
$template->assign_block_vars('switch_confirm', array() );
}
#
#-----[ OPEN ]--------------------------------------------
#
admin/admin_board.php
#
#-----[ FIND ]--------------------------------------------
#
$activation_none = ( $new['require_activation'] == USER_ACTIVATION_NONE ) ? "checked=\"checked\"" : "";
$activation_user = ( $new['require_activation'] == USER_ACTIVATION_SELF ) ? "checked=\"checked\"" : "";
$activation_admin = ( $new['require_activation'] == USER_ACTIVATION_ADMIN ) ? "checked=\"checked\"" : "";
#
#-----[ AFTER, ADD ]--------------------------------------
#
$confirm_yes = ( $new['enable_confirm'] ) ? "checked=\"checked\"" : "";
$confirm_no = ( !$new['enable_confirm'] ) ? "checked=\"checked\"" : "";
#
#-----[ FIND ]--------------------------------------------
#
"L_ACCT_ACTIVATION" => $lang['Acct_activation'],
"L_NONE" => $lang['Acc_None'],
"L_USER" => $lang['Acc_User'],
"L_ADMIN" => $lang['Acc_Admin'],
#
#-----[ AFTER, ADD ]--------------------------------------
#
"L_CONFIRM_CODE" => $lang['Confirm_code'],
#
#-----[ OPEN ]--------------------------------------------
#
templates/subSilver/admin/board_config_body.tpl
#
#-----[ FIND ]--------------------------------------------
#
<tr>
<td class="row1">{L_ACCT_ACTIVATION}</td>
<td class="row2"><input type="radio" name="require_activation" value="{ACTIVATION_NONE}" {ACTIVATION_NONE_CHECKED} />{L_NONE} <input type="radio" name="require_activation" value="{ACTIVATION_USER}" {ACTIVATION_USER_CHECKED} />{L_USER} <input type="radio" name="require_activation" value="{ACTIVATION_ADMIN}" {ACTIVATION_ADMIN_CHECKED} />{L_ADMIN}</td>
</tr>
#
#-----[ AFTER, ADD ]--------------------------------------
#
<tr>
<td class="row1">{L_CONFIRM_CODE}</td>
<td class="row2"><input type="radio" name="enable_confirm" value="1" {CONFIRM_ENABLE} />{L_YES} <input type="radio" name="enable_confirm" value="0" {CONFIRM_DISABLE} />{L_NO}</td>
</tr>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Is deze niet geschikt voor phpBB-2.0.10 ?????
##############################################################
## MOD Title: Yet Another Anti Robotic Register Flood
## MOD Author: Iluvatar
##
## MOD Information: Most of the code comes from Smartor's Anti Robotic Register Flood
## I've just modded the mod. I wanted a more comercial type look, aswell
## as avoiding using images (Some users found the difficult to understand
## don't ask me why).
##
## MOD Description: This will add a Random-graphical-text Vadiation field in
## Registration form to protect your phpBB from being flooded
## of robotic-member-registration (like many free webhost signup form...)
## MOD Version: 0.0.3
##
## MOD Credits: Smartor < smartor_xp@hotmail.com > (Hoang Ngoc Tu) http://smartor.is-root.com
##
## Installation Level: easy
## Installation Time: 10 Minutes
## Files To Edit: 4
## includes/constants.php
## includes/usercp_register.php
## admin/admin_board.php
## templates/subSilver/admin/board_config_body.tpl
##
## Included Files: 1
## yaarrf_pic.php
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ SQL ]---------------------------------------------
#
CREATE TABLE phpbb_anti_robotic_reg (
session_id char(32) DEFAULT '' NOT NULL,
reg_key char(5) NOT NULL,
timestamp int(11) unsigned NOT NULL,
PRIMARY KEY (session_id));
#
#-----[ COPY ]--------------------------------------------
#
copy yaarrf_pic.php to yaarrf_pic.php
#
#-----[ OPEN ]--------------------------------------------
#
includes/constants.php
#
#-----[ FIND ]--------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]-------------------------------------
#
// Anti Robotic Register
define('ANTI_ROBOT_TABLE', $table_prefix.'anti_robotic_reg');
#
#-----[ OPEN ]--------------------------------------------
#
includes/usercp_register.php
#
#-----[ FIND ]--------------------------------------------
#
$strip_var_list = array('username' => 'username',
#
#-----[ AFTER, ADD ]--------------------------------------
#
'confirm_code' => 'confirm_code',
#
#-----[ FIND ]--------------------------------------------
#
else if ( $mode == 'register' )
{
if ( empty($username) || empty($new_password) || empty($password_confirm) || empty($email) )
{
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Fields_empty'];
}
#
#-----[ AFTER, ADD ]--------------------------------------
#
if ( $board_config['enable_confirm'] ) {
if ( empty($confirm_code) ) {
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Fields_empty'];
} else {
$sql = "SELECT * FROM " . ANTI_ROBOT_TABLE . " WHERE session_id = '" . $userdata['session_id'] . "'";
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not obtain registration information', '', __LINE__, __FILE__, $sql);
}
$anti_robot_row = $db->sql_fetchrow($result);
if ( $confirm_code != $anti_robot_row['reg_key'] )
{
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Confirm_code_wrong'];
} else {
$sql = "DELETE FROM " . ANTI_ROBOT_TABLE . " WHERE session_id = '" . $userdata['session_id'] . "'";
if( $db->sql_query($sql) == FALSE )
{
message_die(GENERAL_ERROR, 'Could not delete validation key', '', __LINE__, __FILE__, $sql);
}
}
}
}
#
#-----[ FIND ]--------------------------------------------
#
'CUR_PASSWORD' => $cur_password,
'NEW_PASSWORD' => $new_password,
'PASSWORD_CONFIRM' => $password_confirm,
#
#-----[ AFTER, ADD ]--------------------------------------
#
'CONFIRM_IMG' => '<img src="yaarrf_pic.php" />',
#
#-----[ FIND ]--------------------------------------------
#
'L_CONFIRM_PASSWORD_EXPLAIN' => ( $mode == 'editprofile' ) ? $lang['Confirm_password_explain'] : '',
'L_PASSWORD_IF_CHANGED' => ( $mode == 'editprofile' ) ? $lang['password_if_changed'] : '',
'L_PASSWORD_CONFIRM_IF_CHANGED' => ( $mode == 'editprofile' ) ? $lang['password_confirm_if_changed'] : '',
#
#-----[ AFTER, ADD ]--------------------------------------
#
'L_CONFIRM_CODE_IMPAIRED' => ( $mode == 'register' ) ? $lang['Confirm_code_impaired'] : '',
'L_CONFIRM_CODE' => ( $mode == 'register' ) ? $lang['Confirm_code'] : '',
'L_CONFIRM_CODE_EXPLAIN' => ( $mode == 'register' ) ? $lang['Confirm_code_explain'] : '',
#
#-----[ FIND ]--------------------------------------------
#
}
}
$template->pparse('body');
#
#-----[ BEFORE, ADD ]--------------------------------------
#
} else {
if ( $board_config['enable_confirm'] ) {
$template->assign_block_vars('switch_confirm', array() );
}
#
#-----[ OPEN ]--------------------------------------------
#
admin/admin_board.php
#
#-----[ FIND ]--------------------------------------------
#
$activation_none = ( $new['require_activation'] == USER_ACTIVATION_NONE ) ? "checked=\"checked\"" : "";
$activation_user = ( $new['require_activation'] == USER_ACTIVATION_SELF ) ? "checked=\"checked\"" : "";
$activation_admin = ( $new['require_activation'] == USER_ACTIVATION_ADMIN ) ? "checked=\"checked\"" : "";
#
#-----[ AFTER, ADD ]--------------------------------------
#
$confirm_yes = ( $new['enable_confirm'] ) ? "checked=\"checked\"" : "";
$confirm_no = ( !$new['enable_confirm'] ) ? "checked=\"checked\"" : "";
#
#-----[ FIND ]--------------------------------------------
#
"L_ACCT_ACTIVATION" => $lang['Acct_activation'],
"L_NONE" => $lang['Acc_None'],
"L_USER" => $lang['Acc_User'],
"L_ADMIN" => $lang['Acc_Admin'],
#
#-----[ AFTER, ADD ]--------------------------------------
#
"L_CONFIRM_CODE" => $lang['Confirm_code'],
#
#-----[ OPEN ]--------------------------------------------
#
templates/subSilver/admin/board_config_body.tpl
#
#-----[ FIND ]--------------------------------------------
#
<tr>
<td class="row1">{L_ACCT_ACTIVATION}</td>
<td class="row2"><input type="radio" name="require_activation" value="{ACTIVATION_NONE}" {ACTIVATION_NONE_CHECKED} />{L_NONE} <input type="radio" name="require_activation" value="{ACTIVATION_USER}" {ACTIVATION_USER_CHECKED} />{L_USER} <input type="radio" name="require_activation" value="{ACTIVATION_ADMIN}" {ACTIVATION_ADMIN_CHECKED} />{L_ADMIN}</td>
</tr>
#
#-----[ AFTER, ADD ]--------------------------------------
#
<tr>
<td class="row1">{L_CONFIRM_CODE}</td>
<td class="row2"><input type="radio" name="enable_confirm" value="1" {CONFIRM_ENABLE} />{L_YES} <input type="radio" name="enable_confirm" value="0" {CONFIRM_DISABLE} />{L_NO}</td>
</tr>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM