mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/10073] Fallback to board_contact when contact page is disabled
PHPBB3-10073
This commit is contained in:
parent
d1fb8d3c9e
commit
ed8c16bf0d
8 changed files with 69 additions and 9 deletions
|
@ -200,8 +200,17 @@ class acp_email
|
||||||
$messenger->subject(htmlspecialchars_decode($subject));
|
$messenger->subject(htmlspecialchars_decode($subject));
|
||||||
$messenger->set_mail_priority($priority);
|
$messenger->set_mail_priority($priority);
|
||||||
|
|
||||||
|
if ($config['contact_admin_form_enable'])
|
||||||
|
{
|
||||||
|
$contact_link = generate_board_url() . '/memberlist.' . $phpEx . '?mode=contactadmin';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$contact_link = $config['board_contact'];
|
||||||
|
}
|
||||||
|
|
||||||
$messenger->assign_vars(array(
|
$messenger->assign_vars(array(
|
||||||
'CONTACT_EMAIL' => generate_board_url() . '/memberlist.' . $phpEx . '?mode=contactadmin',
|
'CONTACT_EMAIL' => $contact_link,
|
||||||
'MESSAGE' => htmlspecialchars_decode($message))
|
'MESSAGE' => htmlspecialchars_decode($message))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,15 @@ class phpbb_captcha_plugins_captcha_abstract
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$link = append_sid($phpbb_root_path . 'ucp.' . $phpEx, 'mode=confirm&confirm_id=' . $this->confirm_id . '&type=' . $this->type);
|
$link = append_sid($phpbb_root_path . 'ucp.' . $phpEx, 'mode=confirm&confirm_id=' . $this->confirm_id . '&type=' . $this->type);
|
||||||
$explain = $user->lang(($this->type != CONFIRM_POST) ? 'CONFIRM_EXPLAIN' : 'POST_CONFIRM_EXPLAIN', '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contactadmin') . '">', '</a>');
|
if ($config['contact_admin_form_enable'])
|
||||||
|
{
|
||||||
|
$contact_link = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contactadmin');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$contact_link = 'mailto:' . htmlspecialchars($config['board_contact']);
|
||||||
|
}
|
||||||
|
$explain = $user->lang(($this->type != CONFIRM_POST) ? 'CONFIRM_EXPLAIN' : 'POST_CONFIRM_EXPLAIN', '<a href="' . $contact_link . '">', '</a>');
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'CONFIRM_IMAGE_LINK' => $link,
|
'CONFIRM_IMAGE_LINK' => $link,
|
||||||
|
|
|
@ -158,7 +158,15 @@ class phpbb_recaptcha extends phpbb_default_captcha
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$explain = $user->lang(($this->type != CONFIRM_POST) ? 'CONFIRM_EXPLAIN' : 'POST_CONFIRM_EXPLAIN', '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contactadmin') . '">', '</a>');
|
if ($config['contact_admin_form_enable'])
|
||||||
|
{
|
||||||
|
$contact_link = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contactadmin');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$contact_link = 'mailto:' . htmlspecialchars($config['board_contact']);
|
||||||
|
}
|
||||||
|
$explain = $user->lang(($this->type != CONFIRM_POST) ? 'CONFIRM_EXPLAIN' : 'POST_CONFIRM_EXPLAIN', '<a href="' . $contact_link . '">', '</a>');
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'RECAPTCHA_SERVER' => $this->recaptcha_server,
|
'RECAPTCHA_SERVER' => $this->recaptcha_server,
|
||||||
|
|
|
@ -2814,11 +2814,20 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LOGIN_ERROR_PASSWORD_CONVERT:
|
case LOGIN_ERROR_PASSWORD_CONVERT:
|
||||||
|
if ($config['contact_admin_form_enable'])
|
||||||
|
{
|
||||||
|
$contact_link = append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=sendpassword');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$contact_link = 'mailto:' . htmlspecialchars($config['board_contact']);
|
||||||
|
}
|
||||||
|
|
||||||
$err = sprintf(
|
$err = sprintf(
|
||||||
$user->lang[$result['error_msg']],
|
$user->lang[$result['error_msg']],
|
||||||
($config['email_enable']) ? '<a href="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=sendpassword') . '">' : '',
|
($config['email_enable']) ? '<a href="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=sendpassword') . '">' : '',
|
||||||
($config['email_enable']) ? '</a>' : '',
|
($config['email_enable']) ? '</a>' : '',
|
||||||
'<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contactadmin') . '">',
|
'<a href="' . $contact_link . '">',
|
||||||
'</a>'
|
'</a>'
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -392,8 +392,17 @@ switch ($mode)
|
||||||
$messenger->replyto($user->data['user_email']);
|
$messenger->replyto($user->data['user_email']);
|
||||||
$messenger->set_addresses($row);
|
$messenger->set_addresses($row);
|
||||||
|
|
||||||
|
if ($config['contact_admin_form_enable'])
|
||||||
|
{
|
||||||
|
$contact_link = generate_board_url() . '/memberlist.' . $phpEx . '?mode=contactadmin';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$contact_link = $config['board_contact'];
|
||||||
|
}
|
||||||
|
|
||||||
$messenger->assign_vars(array(
|
$messenger->assign_vars(array(
|
||||||
'BOARD_CONTACT' => generate_board_url() . '/memberlist.' . $phpEx . '?mode=contactadmin',
|
'BOARD_CONTACT' => $contact_link,
|
||||||
'FROM_USERNAME' => htmlspecialchars_decode($user->data['username']),
|
'FROM_USERNAME' => htmlspecialchars_decode($user->data['username']),
|
||||||
'TO_USERNAME' => htmlspecialchars_decode($row['username']),
|
'TO_USERNAME' => htmlspecialchars_decode($row['username']),
|
||||||
'MESSAGE' => htmlspecialchars_decode($message))
|
'MESSAGE' => htmlspecialchars_decode($message))
|
||||||
|
|
|
@ -149,7 +149,16 @@ abstract class form
|
||||||
$this->message->cc_sender();
|
$this->message->cc_sender();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->message->send($messenger, $this->phpEx);
|
|
||||||
|
if ($this->config['contact_admin_form_enable'])
|
||||||
|
{
|
||||||
|
$board_contact = generate_board_url() . '/memberlist.' . $this->phpEx . '?mode=contactadmin';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$board_contact = $this->config['board_contact'];
|
||||||
|
}
|
||||||
|
$this->message->send($messenger, $board_contact);
|
||||||
|
|
||||||
meta_refresh(3, append_sid($this->phpbb_root_path . 'index.' . $this->phpEx));
|
meta_refresh(3, append_sid($this->phpbb_root_path . 'index.' . $this->phpEx));
|
||||||
trigger_error($this->user->lang['EMAIL_SENT'] . '<br /><br />' . $this->get_return_message());
|
trigger_error($this->user->lang['EMAIL_SENT'] . '<br /><br />' . $this->get_return_message());
|
||||||
|
|
|
@ -234,7 +234,7 @@ class message
|
||||||
* @param string $phpEx
|
* @param string $phpEx
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
public function send(\messenger $messenger, $phpEx)
|
public function send(\messenger $messenger, $contact)
|
||||||
{
|
{
|
||||||
if (!sizeof($this->recipients))
|
if (!sizeof($this->recipients))
|
||||||
{
|
{
|
||||||
|
@ -263,7 +263,7 @@ class message
|
||||||
$messenger->subject(htmlspecialchars_decode($this->subject));
|
$messenger->subject(htmlspecialchars_decode($this->subject));
|
||||||
|
|
||||||
$messenger->assign_vars(array(
|
$messenger->assign_vars(array(
|
||||||
'BOARD_CONTACT' => generate_board_url() . '/memberlist.' . $phpEx . '?mode=contactadmin',
|
'BOARD_CONTACT' => $contact,
|
||||||
'TO_USERNAME' => htmlspecialchars_decode($recipient['to_name']),
|
'TO_USERNAME' => htmlspecialchars_decode($recipient['to_name']),
|
||||||
'FROM_USERNAME' => htmlspecialchars_decode($this->sender_name),
|
'FROM_USERNAME' => htmlspecialchars_decode($this->sender_name),
|
||||||
'MESSAGE' => htmlspecialchars_decode($this->body))
|
'MESSAGE' => htmlspecialchars_decode($this->body))
|
||||||
|
|
|
@ -1233,7 +1233,15 @@ class session
|
||||||
$till_date = ($ban_row['ban_end']) ? $this->format_date($ban_row['ban_end']) : '';
|
$till_date = ($ban_row['ban_end']) ? $this->format_date($ban_row['ban_end']) : '';
|
||||||
$message = ($ban_row['ban_end']) ? 'BOARD_BAN_TIME' : 'BOARD_BAN_PERM';
|
$message = ($ban_row['ban_end']) ? 'BOARD_BAN_TIME' : 'BOARD_BAN_PERM';
|
||||||
|
|
||||||
$message = sprintf($this->lang[$message], $till_date, '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contactadmin') . '">', '</a>');
|
if ($config['contact_admin_form_enable'])
|
||||||
|
{
|
||||||
|
$contact_link = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contactadmin');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$contact_link = 'mailto:' . htmlspecialchars($config['board_contact']);
|
||||||
|
}
|
||||||
|
$message = sprintf($this->lang[$message], $till_date, '<a href="' . $contact_link . '">', '</a>');
|
||||||
$message .= ($ban_row['ban_give_reason']) ? '<br /><br />' . sprintf($this->lang['BOARD_BAN_REASON'], $ban_row['ban_give_reason']) : '';
|
$message .= ($ban_row['ban_give_reason']) ? '<br /><br />' . sprintf($this->lang['BOARD_BAN_REASON'], $ban_row['ban_give_reason']) : '';
|
||||||
$message .= '<br /><br /><em>' . $this->lang['BAN_TRIGGERED_BY_' . strtoupper($ban_triggered_by)] . '</em>';
|
$message .= '<br /><br /><em>' . $this->lang['BAN_TRIGGERED_BY_' . strtoupper($ban_triggered_by)] . '</em>';
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue