mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-10 10:44:20 +02:00
[ticket/17493] Remove remnants of user_notify_type
PHPBB-17493
This commit is contained in:
@@ -157,7 +157,6 @@ class admin_form extends form
|
||||
}
|
||||
|
||||
$this->message->set_sender($this->user->ip, $this->sender_name, $this->sender_address, $this->user->lang_name);
|
||||
$this->message->set_sender_notify_type(messenger_interface::NOTIFY_EMAIL);
|
||||
}
|
||||
|
||||
$this->message->set_template('contact_admin');
|
||||
|
@@ -54,9 +54,6 @@ class message
|
||||
/** @var string */
|
||||
protected $sender_username = '';
|
||||
|
||||
/** @var int */
|
||||
protected $sender_notify_type = messenger_interface::NOTIFY_EMAIL;
|
||||
|
||||
/** @var array */
|
||||
protected $recipients;
|
||||
|
||||
@@ -126,7 +123,6 @@ class message
|
||||
$user['username'],
|
||||
$user['user_email'],
|
||||
$user['user_lang'],
|
||||
$user['user_notify_type'],
|
||||
$user['username']
|
||||
);
|
||||
}
|
||||
@@ -137,18 +133,16 @@ class message
|
||||
* @param string $recipient_name Displayed sender name
|
||||
* @param string $recipient_address Email address
|
||||
* @param string $recipient_lang
|
||||
* @param int $recipient_notify_type Used notification methods (Jabber, Email, ...)
|
||||
* @param string $recipient_username User Name (used for AntiAbuse header)
|
||||
* @return void
|
||||
*/
|
||||
public function add_recipient($recipient_name, $recipient_address, $recipient_lang, $recipient_notify_type = messenger_interface::NOTIFY_EMAIL, $recipient_username = '')
|
||||
public function add_recipient($recipient_name, $recipient_address, $recipient_lang, $recipient_username = '')
|
||||
{
|
||||
$this->recipients[] = array(
|
||||
'name' => $recipient_name,
|
||||
'user_email' => $recipient_address,
|
||||
'lang' => $recipient_lang,
|
||||
'username' => $recipient_username,
|
||||
'notify_type' => $recipient_notify_type,
|
||||
'to_name' => $recipient_name,
|
||||
);
|
||||
}
|
||||
@@ -169,8 +163,6 @@ class message
|
||||
$user->data['user_id'],
|
||||
$user->data['username']
|
||||
);
|
||||
|
||||
$this->set_sender_notify_type($user->data['user_notify_type']);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -194,17 +186,6 @@ class message
|
||||
$this->sender_username = $sender_username;
|
||||
}
|
||||
|
||||
/**
|
||||
* Which notification type should be used? Jabber, Email, ...?
|
||||
*
|
||||
* @param int $sender_notify_type
|
||||
* @return void
|
||||
*/
|
||||
public function set_sender_notify_type($sender_notify_type)
|
||||
{
|
||||
$this->sender_notify_type = $sender_notify_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ok, now the same email if CC specified, but without exposing the user's email address
|
||||
*
|
||||
@@ -226,7 +207,6 @@ class message
|
||||
'user_email' => $this->sender_address,
|
||||
'name' => $this->sender_name,
|
||||
'username' => $this->sender_username,
|
||||
'notify_type' => $this->sender_notify_type,
|
||||
'to_name' => $this->recipients[0]['to_name'],
|
||||
);
|
||||
}
|
||||
@@ -257,40 +237,37 @@ class message
|
||||
foreach ($messenger_collection_iterator as $messenger_method)
|
||||
{
|
||||
$messenger_method->set_use_queue(false);
|
||||
if ($messenger_method->get_id() == $recipient['notify_type'] || $recipient['notify_type'] == $messenger_method::NOTIFY_BOTH)
|
||||
$messenger_method->template($this->template, $recipient['lang']);
|
||||
$messenger_method->set_addresses($recipient);
|
||||
$messenger_method->reply_to($this->sender_address);
|
||||
|
||||
$messenger_method->header('X-AntiAbuse', 'Board servername - ' . $this->server_name);
|
||||
$messenger_method->header('X-AntiAbuse', 'User IP - ' . $this->sender_ip);
|
||||
if ($this->sender_id)
|
||||
{
|
||||
$messenger_method->template($this->template, $recipient['lang']);
|
||||
$messenger_method->set_addresses($recipient);
|
||||
$messenger_method->reply_to($this->sender_address);
|
||||
|
||||
$messenger_method->header('X-AntiAbuse', 'Board servername - ' . $this->server_name);
|
||||
$messenger_method->header('X-AntiAbuse', 'User IP - ' . $this->sender_ip);
|
||||
if ($this->sender_id)
|
||||
{
|
||||
$messenger_method->header('X-AntiAbuse', 'User_id - ' . $this->sender_id);
|
||||
}
|
||||
|
||||
if ($this->sender_username)
|
||||
{
|
||||
$messenger_method->header('X-AntiAbuse', 'Username - ' . $this->sender_username);
|
||||
}
|
||||
|
||||
$messenger_method->subject(html_entity_decode($this->subject, ENT_COMPAT));
|
||||
|
||||
$messenger_method->assign_vars([
|
||||
'BOARD_CONTACT' => $contact,
|
||||
'TO_USERNAME' => html_entity_decode($recipient['to_name'], ENT_COMPAT),
|
||||
'FROM_USERNAME' => html_entity_decode($this->sender_name, ENT_COMPAT),
|
||||
'MESSAGE' => html_entity_decode($this->body, ENT_COMPAT),
|
||||
]);
|
||||
|
||||
if (count($this->template_vars))
|
||||
{
|
||||
$messenger_method->assign_vars($this->template_vars);
|
||||
}
|
||||
|
||||
$messenger_method->send();
|
||||
$messenger_method->header('X-AntiAbuse', 'User_id - ' . $this->sender_id);
|
||||
}
|
||||
|
||||
if ($this->sender_username)
|
||||
{
|
||||
$messenger_method->header('X-AntiAbuse', 'Username - ' . $this->sender_username);
|
||||
}
|
||||
|
||||
$messenger_method->subject(html_entity_decode($this->subject, ENT_COMPAT));
|
||||
|
||||
$messenger_method->assign_vars([
|
||||
'BOARD_CONTACT' => $contact,
|
||||
'TO_USERNAME' => html_entity_decode($recipient['to_name'], ENT_COMPAT),
|
||||
'FROM_USERNAME' => html_entity_decode($this->sender_name, ENT_COMPAT),
|
||||
'MESSAGE' => html_entity_decode($this->body, ENT_COMPAT),
|
||||
]);
|
||||
|
||||
if (count($this->template_vars))
|
||||
{
|
||||
$messenger_method->assign_vars($this->template_vars);
|
||||
}
|
||||
|
||||
$messenger_method->send();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -134,7 +134,6 @@ class topic_form extends form
|
||||
$this->recipient_lang,
|
||||
messenger_interface::NOTIFY_EMAIL
|
||||
);
|
||||
$this->message->set_sender_notify_type(messenger_interface::NOTIFY_EMAIL);
|
||||
|
||||
parent::submit($messenger);
|
||||
}
|
||||
|
@@ -34,7 +34,7 @@ class user_form extends form
|
||||
*/
|
||||
protected function get_user_row($user_id)
|
||||
{
|
||||
$sql = 'SELECT user_id, username, user_colour, user_email, user_allow_viewemail, user_lang, user_notify_type
|
||||
$sql = 'SELECT user_id, username, user_colour, user_email, user_allow_viewemail, user_lang
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE user_id = ' . (int) $user_id . '
|
||||
AND user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')';
|
||||
|
Reference in New Issue
Block a user