Well I downloaded the Plus 1.53 2.0.20 to 2.0.21 updating file, so I am trying to update my Plus 1.52 heavly modded 2.0.20 to 2.0.21, but I didn't find some little parts of the code in the updating instructions.
Can u give me a little hand with this ? ¢¦
In the login.php file I didn't find this:
Code: Alles auswählen
#
#-----[ OPEN ]--------------------------------------------
#
login.php
#
#-----[ FIND ]---------------------------------------------
# Line 116
// Only store a failed login attempt for an active user - inactive users can't login even with a correct password
elseif( $row['user_active'] )
{
// Start add - Protect user account MOD
/*
// Save login tries and last login
if ($row['user_id'] != ANONYMOUS)
{
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_login_tries = user_login_tries + 1, user_last_login_try = ' . time() . '
WHERE user_id = ' . $row['user_id'];
$db->sql_query($sql);
}
*/
// End add - Protect user account MOD
if ($row['user_id'] != ANONYMOUS)
{
$sql = 'UPDATE ' . USERS_TABLE . '
SET ct_logintry = 1
WHERE user_id = ' . $row['user_id'];
$db->sql_query($sql);
}
$redirect = ( !empty($_POST['redirect']) ) ? str_replace('&', '&', htmlspecialchars($_POST['redirect'])) : '';
$redirect = str_replace('?', '&', $redirect);
if (strstr(urldecode($redirect), "\n") || strstr(urldecode($redirect), "\r"))
{
message_die(GENERAL_ERROR, 'Tried to redirect to potentially insecure url.');
}
$template->assign_vars(array(
'META' => "<meta http-equiv=\"refresh\" content=\"3;url=login.$phpEx?redirect=$redirect\">")
);
// Start add - Protect user account MOD
if ($row['user_active'] )
{
//count bad login
// block the user for X min
if (($row['user_badlogin']+1) % $board_config['max_login_error'])
{
$sql = "UPDATE " . USERS_TABLE . " SET user_badlogin=user_badlogin+1
WHERE username = '" . str_replace("\'", "''", $username) . "'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error updating bad login data'.$user_ip, '', __LINE__, __FILE__, $sql);
}
} else
{
$blocktime = ", user_block_by='$user_ip', user_blocktime='" . (time()+($board_config['block_time']*60)) . "'";
$sql = "UPDATE " . USERS_TABLE . " SET user_badlogin=user_badlogin+1 $blocktime
WHERE username = '" . str_replace("\'", "''", $username) . "'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error updating bad login data'.$user_ip, '', __LINE__, __FILE__, $sql);
}
if ($row['user_email'] && $row['user_blocktime']<(time()-3600))
{
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
$server_name = trim($board_config['server_name']);
$emailer = new emailer($board_config['smtp_delivery']);
$emailer->email_address($row['user_email']);
$email_headers = "To: \"".$row['username']."\" <".$row['user_email']. ">\r\n";
$email_headers .= "From: \"".$board_config['sitename']."\" <".$board_config['board_email'].">\r\n";
$email_headers .= "X-AntiAbuse: Board servername - " . $server_name . "\r\n";
$email_headers .= "X-AntiAbuse: User IP - " . decode_ip($user_ip) . "\r\n";
$emailer->use_template('bad_login', $row['user_lang']);
$emailer->extra_headers($email_headers);
$emailer->assign_vars(array(
'USER' => '"'.$row['username'].'"',
'BLOCK_TIME' => $board_config['block_time'],
'BAD_LOGINS' => $row['user_badlogin']+1,
'BLOCK_UNTIL' => create_date ($lang['Time_format'],time()+($board_config['block_time']*60),$row['user_timezone']),
'SITENAME' => $board_config['sitename'],
'BOARD_EMAIL' => $board_config['board_email']));
$emailer->send();
$emailer->reset();
}
}
}
// End add - Protect user account MOD
$message = $lang['Error_login'] . '<br /><br />' . sprintf($lang['Click_return_login'], "<a href=\"login.$phpEx?redirect=$redirect\">", '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
message_die(GENERAL_MESSAGE, $message);
}
// Start add - Protect user account MOD
} else
{
$message = (($lang['Error_login_tomutch'])?$lang['Error_login_tomutch']:$lang['Error_login']) . '<br /><br />' . sprintf($lang['Click_return_login'], '<a href="' . append_sid("login.$phpEx?redirect=$redirect") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
message_die(GENERAL_MESSAGE, $message);
}
// End add - Protect user account MOD
}
}
else
#
#-----[ REPLACE WITH ]---------------------------------------------
#
// Only store a failed login attempt for an active user - inactive users can't login even with a correct password
elseif( $row['user_active'] )
{
// Start add - Protect user account MOD
/*
// Save login tries and last login
if ($row['user_id'] != ANONYMOUS)
{
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_login_tries = user_login_tries + 1, user_last_login_try = ' . time() . '
WHERE user_id = ' . $row['user_id'];
$db->sql_query($sql);
}
*/
// End add - Protect user account MOD
if ($row['user_id'] != ANONYMOUS)
{
$sql = 'UPDATE ' . USERS_TABLE . '
SET ct_logintry = 1
WHERE user_id = ' . $row['user_id'];
if( !$db->sql_query($sql))
{
message_die(CRITICAL_ERROR, "Could not perform Database operation", "", __LINE__, __FILE__, $sql);
}
}
// Start add - Protect user account MOD
//count bad login
// block the user for X min
if (($row['user_badlogin']+1) % $board_config['max_login_error'])
{
$sql = "UPDATE " . USERS_TABLE . " SET user_badlogin=user_badlogin+1
WHERE username = '" . str_replace("\'", "''", $username) . "'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error updating bad login data'.$user_ip, '', __LINE__, __FILE__, $sql);
}
} else
{
$blocktime = ", user_block_by='$user_ip', user_blocktime='" . (time()+($board_config['block_time']*60)) . "'";
$sql = "UPDATE " . USERS_TABLE . " SET user_badlogin=user_badlogin+1 $blocktime
WHERE username = '" . str_replace("\'", "''", $username) . "'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error updating bad login data'.$user_ip, '', __LINE__, __FILE__, $sql);
}
if ($row['user_email'] && $row['user_blocktime']<(time()-3600))
{
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
$server_name = trim($board_config['server_name']);
$emailer = new emailer($board_config['smtp_delivery']);
$emailer->email_address($row['user_email']);
$email_headers = "To: \"".$row['username']."\" <".$row['user_email']. ">\r\n";
$email_headers .= "From: \"".$board_config['sitename']."\" <".$board_config['board_email'].">\r\n";
$email_headers .= "X-AntiAbuse: Board servername - " . $server_name . "\r\n";
$email_headers .= "X-AntiAbuse: User IP - " . decode_ip($user_ip) . "\r\n";
$emailer->use_template('bad_login', $row['user_lang']);
$emailer->extra_headers($email_headers);
$emailer->assign_vars(array(
'USER' => '"'.$row['username'].'"',
'BLOCK_TIME' => $board_config['block_time'],
'BAD_LOGINS' => $row['user_badlogin']+1,
'BLOCK_UNTIL' => create_date ($lang['Time_format'],time()+($board_config['block_time']*60),$row['user_timezone']),
'SITENAME' => $board_config['sitename'],
'BOARD_EMAIL' => $board_config['board_email']));
$emailer->send();
$emailer->reset();
}
}
// End add - Protect user account MOD
}
}
$redirect = ( !empty($_POST['redirect']) ) ? str_replace('&', '&', htmlspecialchars($_POST['redirect'])) : '';
$redirect = str_replace('?', '&', $redirect);
if (strstr(urldecode($redirect), "\n") || strstr(urldecode($redirect), "\r"))
{
message_die(GENERAL_ERROR, 'Tried to redirect to potentially insecure url.');
}
$template->assign_vars(array(
'META' => "<meta http-equiv=\"refresh\" content=\"3;url=login.$phpEx?redirect=$redirect\">")
);
// Start add - Protect user account MOD
/*
$message = $lang['Error_login'] . '<br /><br />' . sprintf($lang['Click_return_login'], "<a href=\"login.$phpEx?redirect=$redirect\">", '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
*/
$message = (($lang['Error_login_tomutch'])?$lang['Error_login_tomutch']:$lang['Error_login']) . '<br /><br />' . sprintf($lang['Click_return_login'], '<a href="' . append_sid("login.$phpEx?redirect=$redirect") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
message_die(GENERAL_MESSAGE, $message);
// End add - Protect user account MOD
}
}
elseIn search.php I didn't find this:
Code: Alles auswählen
#
#-----[ OPEN ]--------------------------------------------
#
search.php
#
#-----[ FIND ]---------------------------------------------
# Line 216
if( !$only_bluecards && ( strpos($search_author, '%') !== false ) && ( strlen(str_replace('%', '', $search_author)) < 3 ) )
#
#-----[ REPLACE WITH ]---------------------------------------------
#
if( !$only_bluecards && ( strpos($search_author, '%') !== false ) && ( strlen(str_replace('%', '', $search_author)) < $board_config['search_min_chars'] ) )
#
#-----[ FIND ]---------------------------------------------
# Line 288
if (!$only_bluecards && (preg_match('#^[\*%]+$#', trim($split_search[$i])) || preg_match('#^[^\*]{1,2}$#', str_replace(array('*', '%'), '', trim($split_search[$i])))) )
#
#-----[ REPLACE WITH ]---------------------------------------------
#
if (!$only_bluecards && ( strlen(str_replace(array('*', '%'), '', trim($split_search[$i]))) < $board_config['search_min_chars'] ) )
#
#-----[ FIND ]---------------------------------------------
# Line 439
if (preg_match('#^[\*%]+$#', trim($search_author)) || preg_match('#^[^\*]{1,2}$#', str_replace(array('*', '%'), '', trim($search_author))))
{
$search_author = '';
}
$search_author = str_replace('*', '%', trim(str_replace("\'", "''", $search_author)));
#
#-----[ REPLACE WITH ]---------------------------------------------
#
$search_author = str_replace('*', '%', trim($search_author));
if( ( strpos($search_author, '%') !== false ) && ( strlen(str_replace('%', '', $search_author)) < $board_config['search_min_chars'] ) )
{
$search_author = '';
}In the includes/usercp_register.php I didn't find any part of the code in the instructions ¦4 , so I don't know if I have to do something there.
In the profile.php I didn't find this:
Code: Alles auswählen
#
#-----[ FIND ]---------------------------------------------
# Line 60
return ( $hash ) ? md5($rand_str) : substr($rand_str, 8);Code: Alles auswählen
return ( $hash ) ? md5($rand_str) : $rand_str;And also I don't have the includes/usercp_confirm.php I think that this is only for the phpbb2 Plus 1.53.
I attach here my Files if you want to take a look into them.
Cheers.
[ Attachment gelöscht am Fr 23.Jun, 2006 00:05 von oxpus ]