mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
Added Send New Password functions + added check for current password when changing
git-svn-id: file:///svn/phpbb/trunk@1156 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
e5a8bda3ff
commit
eaec818287
2 changed files with 15 additions and 4 deletions
|
@ -460,7 +460,8 @@ if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
|
||||||
$username = (!empty($HTTP_POST_VARS['username'])) ? trim(strip_tags($HTTP_POST_VARS['username'])) : "";
|
$username = (!empty($HTTP_POST_VARS['username'])) ? trim(strip_tags($HTTP_POST_VARS['username'])) : "";
|
||||||
$email = (!empty($HTTP_POST_VARS['email'])) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['email']))) : "";
|
$email = (!empty($HTTP_POST_VARS['email'])) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['email']))) : "";
|
||||||
|
|
||||||
$password = (!empty($HTTP_POST_VARS['password'])) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['password']))) : "";
|
$password_current = (!empty($HTTP_POST_VARS['cur_password'])) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['cur_password']))) : "";
|
||||||
|
$password = (!empty($HTTP_POST_VARS['new_password'])) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['new_password']))) : "";
|
||||||
$password_confirm = (!empty($HTTP_POST_VARS['password_confirm'])) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['password_confirm']))) : "";
|
$password_confirm = (!empty($HTTP_POST_VARS['password_confirm'])) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['password_confirm']))) : "";
|
||||||
|
|
||||||
$icq = (!empty($HTTP_POST_VARS['icq'])) ? trim(strip_tags($HTTP_POST_VARS['icq'])) : "";
|
$icq = (!empty($HTTP_POST_VARS['icq'])) ? trim(strip_tags($HTTP_POST_VARS['icq'])) : "";
|
||||||
|
@ -549,7 +550,7 @@ if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
|
||||||
{
|
{
|
||||||
$row = $db->sql_fetchrow($result);
|
$row = $db->sql_fetchrow($result);
|
||||||
|
|
||||||
if( $row['user_password'] != $password )
|
if( $row['user_password'] != $password_current )
|
||||||
{
|
{
|
||||||
$error = TRUE;
|
$error = TRUE;
|
||||||
$error_msg = $lang['Current_password_mismatch'];
|
$error_msg = $lang['Current_password_mismatch'];
|
||||||
|
@ -1451,6 +1452,7 @@ if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
|
||||||
$emailer->extra_headers($email_headers);
|
$emailer->extra_headers($email_headers);
|
||||||
|
|
||||||
$emailer->assign_vars(array(
|
$emailer->assign_vars(array(
|
||||||
|
"SITENAME" => $board_config['sitename'],
|
||||||
"USERNAME" => $username,
|
"USERNAME" => $username,
|
||||||
"PASSWORD" => $user_password,
|
"PASSWORD" => $user_password,
|
||||||
"EMAIL_SIG" => str_replace("<br />", "\n", "-- \n" . $board_config['board_email_sig']),
|
"EMAIL_SIG" => str_replace("<br />", "\n", "-- \n" . $board_config['board_email_sig']),
|
||||||
|
@ -1552,6 +1554,7 @@ if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
|
||||||
$emailer->extra_headers($email_headers);
|
$emailer->extra_headers($email_headers);
|
||||||
|
|
||||||
$emailer->assign_vars(array(
|
$emailer->assign_vars(array(
|
||||||
|
"SITENAME" => $board_config['sitename'],
|
||||||
"USERNAME" => $username,
|
"USERNAME" => $username,
|
||||||
"PASSWORD" => $password_confirm,
|
"PASSWORD" => $password_confirm,
|
||||||
"EMAIL_SIG" => str_replace("<br />", "\n", "-- \n" . $board_config['board_email_sig']))
|
"EMAIL_SIG" => str_replace("<br />", "\n", "-- \n" . $board_config['board_email_sig']))
|
||||||
|
@ -1559,10 +1562,18 @@ if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
|
||||||
$emailer->send();
|
$emailer->send();
|
||||||
$emailer->reset();
|
$emailer->reset();
|
||||||
|
|
||||||
|
$template->assign_vars(array(
|
||||||
|
"META" => '<meta http-equiv="refresh" content="5;url=index.' . $phpEx . '">')
|
||||||
|
);
|
||||||
|
|
||||||
message_die(GENERAL_MESSAGE, $lang['Account_active_admin']);
|
message_die(GENERAL_MESSAGE, $lang['Account_active_admin']);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
$template->assign_vars(array(
|
||||||
|
"META" => '<meta http-equiv="refresh" content="5;url=index.' . $phpEx . '">')
|
||||||
|
);
|
||||||
|
|
||||||
$message = ( $sql_update_pass == "" ) ? $lang['Account_active'] : $lang['Password_activated'];
|
$message = ( $sql_update_pass == "" ) ? $lang['Account_active'] : $lang['Password_activated'];
|
||||||
message_die(GENERAL_MESSAGE, $message);
|
message_die(GENERAL_MESSAGE, $message);
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
<td class="row1"><span class="gen">{L_CURRENT_PASSWORD}: *</span><br />
|
<td class="row1"><span class="gen">{L_CURRENT_PASSWORD}: *</span><br />
|
||||||
<span class="gensmall">{L_PASSWORD_IF_CHANGED}</span></td>
|
<span class="gensmall">{L_PASSWORD_IF_CHANGED}</span></td>
|
||||||
<td class="row2">
|
<td class="row2">
|
||||||
<input type="password" class="post" style="width: 200px" name="password" size="25" maxlength="100" value="{PASSWORD}" />
|
<input type="password" class="post" style="width: 200px" name="cur_password" size="25" maxlength="100" value="{PASSWORD}" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- END edit_profile -->
|
<!-- END edit_profile -->
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
<td class="row1"><span class="gen">{L_NEW_PASSWORD}: *</span><br />
|
<td class="row1"><span class="gen">{L_NEW_PASSWORD}: *</span><br />
|
||||||
<span class="gensmall">{L_PASSWORD_IF_CHANGED}</span></td>
|
<span class="gensmall">{L_PASSWORD_IF_CHANGED}</span></td>
|
||||||
<td class="row2">
|
<td class="row2">
|
||||||
<input type="password" class="post" style="width: 200px" name="password" size="25" maxlength="100" value="{PASSWORD}" />
|
<input type="password" class="post" style="width: 200px" name="new_password" size="25" maxlength="100" value="{PASSWORD}" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
Loading…
Add table
Reference in a new issue