mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
Change handling of re-activation emails
If account activation is set to admin, these are now sent to the administrator and not the user. This is a slight change in behaviour but brings the code into line with the messages displayed to the user and the email which is sent and is required because only an administrator is able to re-activate an account with that account activation setting. [Bug #145] git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@5225 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
4f97339ffa
commit
202a96cb90
1 changed files with 50 additions and 16 deletions
|
@ -532,6 +532,8 @@ if ( isset($HTTP_POST_VARS['submit']) )
|
||||||
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
|
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
|
||||||
$emailer = new emailer($board_config['smtp_delivery']);
|
$emailer = new emailer($board_config['smtp_delivery']);
|
||||||
|
|
||||||
|
if ( $board_config['require_activation'] != USER_ACTIVATION_ADMIN )
|
||||||
|
{
|
||||||
$emailer->from($board_config['board_email']);
|
$emailer->from($board_config['board_email']);
|
||||||
$emailer->replyto($board_config['board_email']);
|
$emailer->replyto($board_config['board_email']);
|
||||||
|
|
||||||
|
@ -548,6 +550,38 @@ if ( isset($HTTP_POST_VARS['submit']) )
|
||||||
);
|
);
|
||||||
$emailer->send();
|
$emailer->send();
|
||||||
$emailer->reset();
|
$emailer->reset();
|
||||||
|
}
|
||||||
|
else if ( $board_config['require_activation'] == USER_ACTIVATION_ADMIN )
|
||||||
|
{
|
||||||
|
$sql = 'SELECT user_email, user_lang
|
||||||
|
FROM ' . USERS_TABLE . '
|
||||||
|
WHERE user_level = ' . ADMIN;
|
||||||
|
|
||||||
|
if ( !($result = $db->sql_query($sql)) )
|
||||||
|
{
|
||||||
|
message_die(GENERAL_ERROR, 'Could not select Administrators', '', __LINE__, __FILE__, $sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
while ($row = $db->sql_fetchrow($result))
|
||||||
|
{
|
||||||
|
$emailer->from($board_config['board_email']);
|
||||||
|
$emailer->replyto($board_config['board_email']);
|
||||||
|
|
||||||
|
$emailer->email_address(trim($row['user_email']));
|
||||||
|
$emailer->use_template("admin_activate", $row['user_lang']);
|
||||||
|
$emailer->set_subject($lang['Reactivate']);
|
||||||
|
|
||||||
|
$emailer->assign_vars(array(
|
||||||
|
'USERNAME' => preg_replace($unhtml_specialchars_match, $unhtml_specialchars_replace, substr(str_replace("\'", "'", $username), 0, 25)),
|
||||||
|
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']),
|
||||||
|
|
||||||
|
'U_ACTIVATE' => $server_url . '?mode=activate&' . POST_USERS_URL . '=' . $user_id . '&act_key=' . $user_actkey)
|
||||||
|
);
|
||||||
|
$emailer->send();
|
||||||
|
$emailer->reset();
|
||||||
|
}
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
}
|
||||||
|
|
||||||
$message = $lang['Profile_updated_inactive'] . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
|
$message = $lang['Profile_updated_inactive'] . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue