mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/17493] Remove remnants of user_notify_type
PHPBB-17493
This commit is contained in:
parent
bb26658a00
commit
da32d51a81
20 changed files with 190 additions and 152 deletions
|
@ -226,33 +226,29 @@ class acp_email
|
|||
*/
|
||||
foreach ($messenger_collection_iterator as $messenger_method)
|
||||
{
|
||||
$notify_method = $messenger_method->get_id();
|
||||
if ($notify_method == messenger_interface::NOTIFY_EMAIL)
|
||||
$messenger_method->set_use_queue($use_queue);
|
||||
$messenger_method->template($email_template, $used_lang);
|
||||
$messenger_method->subject(html_entity_decode($subject, ENT_COMPAT));
|
||||
$messenger_method->assign_vars($template_data);
|
||||
|
||||
for ($j = 0, $list_size = count($email_list[$i]); $j < $list_size; $j++)
|
||||
{
|
||||
$messenger_method->set_use_queue($use_queue);
|
||||
$messenger_method->template($email_template, $used_lang);
|
||||
$messenger_method->subject(html_entity_decode($subject, ENT_COMPAT));
|
||||
$messenger_method->assign_vars($template_data);
|
||||
|
||||
for ($j = 0, $list_size = count($email_list[$i]); $j < $list_size; $j++)
|
||||
$email_row = $email_list[$i][$j];
|
||||
if (count($email_list[$i]) == 1)
|
||||
{
|
||||
$email_row = $email_list[$i][$j];
|
||||
if (count($email_list[$i]) == 1)
|
||||
{
|
||||
$messenger_method->to($email_row['email'], $email_row['name']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$messenger_method->bcc($email_row['email'], $email_row['name']);
|
||||
}
|
||||
$messenger_method->to($email_row['email'], $email_row['name']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$messenger_method->bcc($email_row['email'], $email_row['name']);
|
||||
}
|
||||
|
||||
$messenger_method->anti_abuse_headers($config, $user);
|
||||
$messenger_method->set_mail_priority($priority);
|
||||
|
||||
$errored = !$messenger_method->send() || $errored;
|
||||
$messenger_method->save_queue();
|
||||
}
|
||||
|
||||
$messenger_method->anti_abuse_headers($config, $user);
|
||||
$messenger_method->set_mail_priority($priority);
|
||||
|
||||
$errored = !$messenger_method->send() || $errored;
|
||||
$messenger_method->save_queue();
|
||||
}
|
||||
}
|
||||
unset($email_list);
|
||||
|
|
|
@ -185,7 +185,7 @@ class acp_inactive
|
|||
trigger_error($user->lang['EMAIL_DISABLED'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
$sql = 'SELECT user_id, username, user_email, user_lang, user_notify_type, user_regdate, user_actkey
|
||||
$sql = 'SELECT user_id, username, user_email, user_lang, user_regdate, user_actkey
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('user_id', $mark) . '
|
||||
AND user_inactive_reason';
|
||||
|
@ -211,20 +211,17 @@ class acp_inactive
|
|||
*/
|
||||
foreach ($messenger_collection_iterator as $messenger_method)
|
||||
{
|
||||
if ($messenger_method->get_id() == $user_row['user_notify_type'] || $user_row['user_notify_type'] == $messenger_method::NOTIFY_BOTH)
|
||||
{
|
||||
$messenger_method->template('user_remind_inactive', $row['user_lang']);
|
||||
$messenger_method->set_addresses($row);
|
||||
$messenger_method->anti_abuse_headers($config, $user);
|
||||
$messenger_method->assign_vars([
|
||||
'USERNAME' => html_entity_decode($row['username'], ENT_COMPAT),
|
||||
'REGISTER_DATE' => $user->format_date($row['user_regdate'], false, true),
|
||||
'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&u=" . $row['user_id'] . '&k=' . $row['user_actkey'],
|
||||
]);
|
||||
$messenger_method->template('user_remind_inactive', $row['user_lang']);
|
||||
$messenger_method->set_addresses($row);
|
||||
$messenger_method->anti_abuse_headers($config, $user);
|
||||
$messenger_method->assign_vars([
|
||||
'USERNAME' => html_entity_decode($row['username'], ENT_COMPAT),
|
||||
'REGISTER_DATE' => $user->format_date($row['user_regdate'], false, true),
|
||||
'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&u=" . $row['user_id'] . '&k=' . $row['user_actkey'],
|
||||
]);
|
||||
|
||||
$messenger_method->send();
|
||||
$messenger_method->save_queue();
|
||||
}
|
||||
$messenger_method->send();
|
||||
$messenger_method->save_queue();
|
||||
}
|
||||
|
||||
$usernames[] = $row['username'];
|
||||
|
|
|
@ -1577,7 +1577,6 @@ class acp_users
|
|||
'viewemail' => $request->variable('viewemail', $user_row['user_allow_viewemail']),
|
||||
'massemail' => $request->variable('massemail', $user_row['user_allow_massemail']),
|
||||
'hideonline' => $request->variable('hideonline', !$user_row['user_allow_viewonline']),
|
||||
'notifymethod' => $request->variable('notifymethod', $user_row['user_notify_type']),
|
||||
'notifypm' => $request->variable('notifypm', $user_row['user_notify_pm']),
|
||||
'allowpm' => $request->variable('allowpm', $user_row['user_allow_pm']),
|
||||
|
||||
|
@ -1648,7 +1647,6 @@ class acp_users
|
|||
'user_allow_viewemail' => $data['viewemail'],
|
||||
'user_allow_massemail' => $data['massemail'],
|
||||
'user_allow_viewonline' => !$data['hideonline'],
|
||||
'user_notify_type' => $data['notifymethod'],
|
||||
'user_notify_pm' => $data['notifypm'],
|
||||
|
||||
'user_dateformat' => $data['dateformat'],
|
||||
|
|
|
@ -246,7 +246,6 @@ function user_add($user_row, $cp_data = false, $notifications_data = null)
|
|||
|
||||
'user_notify' => 0,
|
||||
'user_notify_pm' => 1,
|
||||
'user_notify_type' => messenger_interface::NOTIFY_EMAIL,
|
||||
'user_allow_pm' => 1,
|
||||
'user_allow_viewonline' => 1,
|
||||
'user_allow_viewemail' => 1,
|
||||
|
@ -2528,7 +2527,7 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna
|
|||
|
||||
case 'approve':
|
||||
// Make sure we only approve those which are pending ;)
|
||||
$sql = 'SELECT u.user_id, u.user_email, u.username, u.username_clean, u.user_notify_type, u.user_lang
|
||||
$sql = 'SELECT u.user_id
|
||||
FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . ' ug
|
||||
WHERE ug.group_id = ' . $group_id . '
|
||||
AND ug.user_pending = 1
|
||||
|
|
|
@ -661,7 +661,7 @@ function close_report($report_id_list, $mode, $action, $pm = false)
|
|||
{
|
||||
$post_info = ($pm) ? phpbb_get_pm_data($post_id_list) : phpbb_get_post_data($post_id_list, 'm_report');
|
||||
|
||||
$sql = "SELECT r.report_id, r.$id_column, r.report_closed, r.user_id, r.user_notify, u.username, u.username_clean, u.user_email, u.user_lang, u.user_notify_type
|
||||
$sql = "SELECT r.report_id, r.$id_column, r.report_closed, r.user_id, r.user_notify, u.username, u.username_clean, u.user_email, u.user_lang
|
||||
FROM " . REPORTS_TABLE . ' r, ' . USERS_TABLE . ' u
|
||||
WHERE ' . $db->sql_in_set('r.report_id', $report_id_list) . '
|
||||
' . (($action == 'close') ? 'AND r.report_closed = 0' : '') . '
|
||||
|
|
|
@ -35,7 +35,7 @@ class ucp_activate
|
|||
$user_id = $request->variable('u', 0);
|
||||
$key = $request->variable('k', '');
|
||||
|
||||
$sql = 'SELECT user_id, username, user_type, user_email, user_newpasswd, user_lang, user_notify_type, user_actkey, user_inactive_reason
|
||||
$sql = 'SELECT user_id, username, user_type, user_email, user_newpasswd, user_lang, user_actkey, user_inactive_reason
|
||||
FROM ' . USERS_TABLE . "
|
||||
WHERE user_id = $user_id";
|
||||
$result = $db->sql_query($sql);
|
||||
|
@ -140,18 +140,15 @@ class ucp_activate
|
|||
*/
|
||||
foreach ($messenger_collection_iterator as $messenger_method)
|
||||
{
|
||||
if ($messenger_method->get_id() == $user_row['user_notify_type'] || $user_row['user_notify_type'] == $messenger_method::NOTIFY_BOTH)
|
||||
{
|
||||
$messenger_method->set_use_queue(false);
|
||||
$messenger_method->template('admin_welcome_activated', $user_row['user_lang']);
|
||||
$messenger_method->set_addresses($user_row);
|
||||
$messenger_method->anti_abuse_headers($config, $user);
|
||||
$messenger_method->assign_vars([
|
||||
'USERNAME' => html_entity_decode($user_row['username'], ENT_COMPAT),
|
||||
]);
|
||||
$messenger_method->set_use_queue(false);
|
||||
$messenger_method->template('admin_welcome_activated', $user_row['user_lang']);
|
||||
$messenger_method->set_addresses($user_row);
|
||||
$messenger_method->anti_abuse_headers($config, $user);
|
||||
$messenger_method->assign_vars([
|
||||
'USERNAME' => html_entity_decode($user_row['username'], ENT_COMPAT),
|
||||
]);
|
||||
|
||||
$messenger_method->send();
|
||||
}
|
||||
$messenger_method->send();
|
||||
}
|
||||
|
||||
$message = 'ACCOUNT_ACTIVE_ADMIN';
|
||||
|
|
|
@ -42,7 +42,6 @@ class ucp_prefs
|
|||
case 'personal':
|
||||
add_form_key('ucp_prefs_personal');
|
||||
$data = array(
|
||||
'notifymethod' => $request->variable('notifymethod', $user->data['user_notify_type']),
|
||||
'dateformat' => $request->variable('dateformat', $user->data['user_dateformat'], true),
|
||||
'lang' => basename($request->variable('lang', $user->data['user_lang'])),
|
||||
'user_style' => $request->variable('user_style', (int) $user->data['user_style']),
|
||||
|
@ -99,7 +98,6 @@ class ucp_prefs
|
|||
'user_allow_viewemail' => $data['viewemail'],
|
||||
'user_allow_massemail' => $data['massemail'],
|
||||
'user_allow_viewonline' => ($auth->acl_get('u_hideonline')) ? !$data['hideonline'] : $user->data['user_allow_viewonline'],
|
||||
'user_notify_type' => $data['notifymethod'],
|
||||
'user_options' => $user->data['user_options'],
|
||||
|
||||
'user_dateformat' => $data['dateformat'],
|
||||
|
|
|
@ -357,9 +357,7 @@ class ucp_profile
|
|||
|
||||
if (!count($error))
|
||||
{
|
||||
$sql_ary = array(
|
||||
'user_notify_type' => messenger_interface::NOTIFY_EMAIL,
|
||||
);
|
||||
$sql_ary = [];
|
||||
|
||||
if ($config['allow_birthdays'])
|
||||
{
|
||||
|
@ -378,13 +376,17 @@ class ucp_profile
|
|||
$vars = array('cp_data', 'data', 'sql_ary');
|
||||
extract($phpbb_dispatcher->trigger_event('core.ucp_profile_info_modify_sql_ary', compact($vars)));
|
||||
|
||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
|
||||
WHERE user_id = ' . $user->data['user_id'];
|
||||
$db->sql_query($sql);
|
||||
// Skip query if no data to update
|
||||
if (count($sql_ary))
|
||||
{
|
||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
|
||||
WHERE user_id = ' . $user->data['user_id'];
|
||||
$db->sql_query($sql);
|
||||
|
||||
// Update Custom Fields
|
||||
$cp->update_profile_field_data($user->data['user_id'], $cp_data);
|
||||
// Update Custom Fields
|
||||
$cp->update_profile_field_data($user->data['user_id'], $cp_data);
|
||||
}
|
||||
|
||||
meta_refresh(3, $this->u_action);
|
||||
$message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
|
||||
|
|
|
@ -128,7 +128,7 @@ class ucp_resend
|
|||
// Grab an array of user_id's with a_user permissions ... these users can activate a user
|
||||
$admin_ary = $auth->acl_get_list(false, 'a_user', false);
|
||||
|
||||
$sql = 'SELECT user_id, username, user_email, user_lang, user_notify_type
|
||||
$sql = 'SELECT user_id, username, user_email, user_lang
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('user_id', $admin_ary[0]['a_user']);
|
||||
$result = $db->sql_query($sql);
|
||||
|
@ -145,19 +145,16 @@ class ucp_resend
|
|||
foreach ($messenger_collection_iterator as $messenger_method)
|
||||
{
|
||||
$messenger_method->set_use_queue(false);
|
||||
if ($messenger_method->get_id() == $row['user_notify_type'] || $row['user_notify_type'] == $messenger_method::NOTIFY_BOTH)
|
||||
{
|
||||
$messenger_method->template('admin_activate', $row['user_lang']);
|
||||
$messenger_method->set_addresses($row);
|
||||
$messenger_method->anti_abuse_headers($config, $user);
|
||||
$messenger_method->assign_vars([
|
||||
'USERNAME' => html_entity_decode($user_row['username'], ENT_COMPAT),
|
||||
'U_USER_DETAILS' => $board_url . "/memberlist.$phpEx?mode=viewprofile&u={$user_row['user_id']}",
|
||||
'U_ACTIVATE' => $board_url . "/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k={$user_row['user_actkey']}",
|
||||
]);
|
||||
$messenger_method->template('admin_activate', $row['user_lang']);
|
||||
$messenger_method->set_addresses($row);
|
||||
$messenger_method->anti_abuse_headers($config, $user);
|
||||
$messenger_method->assign_vars([
|
||||
'USERNAME' => html_entity_decode($user_row['username'], ENT_COMPAT),
|
||||
'U_USER_DETAILS' => $board_url . "/memberlist.$phpEx?mode=viewprofile&u={$user_row['user_id']}",
|
||||
'U_ACTIVATE' => $board_url . "/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k={$user_row['user_actkey']}",
|
||||
]);
|
||||
|
||||
$messenger_method->send();
|
||||
}
|
||||
$messenger_method->send();
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
|
|
@ -69,7 +69,7 @@ class remove_jabber extends migration
|
|||
]],
|
||||
['permission.remove', ['a_jabber']],
|
||||
['permission.remove', ['u_sendim']],
|
||||
['custom', [[$this, 'remove_from_user_notifcations']]],
|
||||
['custom', [[$this, 'move_jabber_to_email_notifications']]],
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -101,10 +101,15 @@ class remove_jabber extends migration
|
|||
];
|
||||
}
|
||||
|
||||
public function remove_from_user_notifcations()
|
||||
public function move_jabber_to_email_notifications(int $start = 0)
|
||||
{
|
||||
$sql = 'DELETE FROM ' . $this->table_prefix . 'user_notifications
|
||||
WHERE notification_method = ' . $this->db->sql_escape('notification.method.jabber');
|
||||
$this->db->sql_query($sql);
|
||||
$limit = 1000;
|
||||
|
||||
$sql = 'UPDATE ' . $this->tables['user_notifications'] . '
|
||||
SET ' . $this->db->sql_build_array('UPDATE', ['method' => 'notification.method.email']) . "
|
||||
WHERE method = 'notification.method.jabber'";
|
||||
$this->db->sql_query_limit($sql, $limit, $start);
|
||||
|
||||
return $this->db->sql_affectedrows() < $limit ? true : $start + $limit;
|
||||
}
|
||||
}
|
||||
|
|
64
phpBB/phpbb/db/migration/data/v400/remove_notify_type.php
Normal file
64
phpBB/phpbb/db/migration/data/v400/remove_notify_type.php
Normal file
|
@ -0,0 +1,64 @@
|
|||
<?php
|
||||
/**
|
||||
*
|
||||
* This file is part of the phpBB Forum Software package.
|
||||
*
|
||||
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
||||
* @license GNU General Public License, version 2 (GPL-2.0)
|
||||
*
|
||||
* For full copyright and license information, please see
|
||||
* the docs/CREDITS.txt file.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace phpbb\db\migration\data\v400;
|
||||
|
||||
use phpbb\db\migration\migration;
|
||||
|
||||
class remove_notify_type extends migration
|
||||
{
|
||||
public static function depends_on(): array
|
||||
{
|
||||
return [
|
||||
'\phpbb\db\migration\data\v400\remove_jabber',
|
||||
'\phpbb\db\migration\data\v400\dev',
|
||||
'\phpbb\db\migration\data\v30x\release_3_0_0',
|
||||
];
|
||||
}
|
||||
|
||||
public function update_schema(): array
|
||||
{
|
||||
return [
|
||||
'drop_columns' => [
|
||||
$this->table_prefix . 'users' => [
|
||||
'user_notify_type',
|
||||
],
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
public function revert_schema(): array
|
||||
{
|
||||
return [
|
||||
'add_columns' => [
|
||||
$this->table_prefix . 'users' => [
|
||||
'user_notify_type' => ['TINT:4', 0],
|
||||
],
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
return [
|
||||
['custom', [[$this, 'remove_jabber_user_notifications']]],
|
||||
];
|
||||
}
|
||||
|
||||
protected function remove_jabber_user_notifications(): void
|
||||
{
|
||||
$sql = 'DELETE FROM ' . $this->tables['user_notifications'] . "
|
||||
WHERE method = 'notification.method.jabber'";
|
||||
$this->db->sql_query($sql);
|
||||
}
|
||||
}
|
|
@ -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 . ')';
|
||||
|
|
|
@ -176,7 +176,7 @@ class reset_password
|
|||
}
|
||||
|
||||
$sql_array = [
|
||||
'SELECT' => 'user_id, username, user_permissions, user_email, user_notify_type, user_type,'
|
||||
'SELECT' => 'user_id, username, user_permissions, user_email, user_type,'
|
||||
. ' user_lang, user_inactive_reason, reset_token, reset_token_expiration',
|
||||
'FROM' => [$this->users_table => 'u'],
|
||||
'WHERE' => "user_email = '" . $this->db->sql_escape($email) . "'" .
|
||||
|
@ -308,7 +308,7 @@ class reset_password
|
|||
add_form_key('ucp_reset_password');
|
||||
|
||||
$sql_array = [
|
||||
'SELECT' => 'user_id, username, user_permissions, user_email, user_notify_type, user_type,'
|
||||
'SELECT' => 'user_id, username, user_permissions, user_email, user_type,'
|
||||
. ' user_lang, user_inactive_reason, reset_token, reset_token_expiration',
|
||||
'FROM' => [$this->users_table => 'u'],
|
||||
'WHERE' => 'user_id = ' . $user_id,
|
||||
|
|
|
@ -152,7 +152,6 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case
|
|||
'user_post_sortby_dir' => 'a',
|
||||
'user_notify' => 0,
|
||||
'user_notify_pm' => 1,
|
||||
'user_notify_type' => 0,
|
||||
'user_allow_pm' => 1,
|
||||
'user_allow_viewonline' => 1,
|
||||
'user_allow_viewemail' => 1,
|
||||
|
|
|
@ -263,7 +263,7 @@ class phpbb_functional_user_password_reset_test extends phpbb_functional_test_ca
|
|||
protected function get_user_data($username)
|
||||
{
|
||||
$db = $this->get_db();
|
||||
$sql = 'SELECT user_id, username, user_type, user_email, user_newpasswd, user_lang, user_notify_type, user_actkey, user_inactive_reason, reset_token, reset_token_expiration
|
||||
$sql = 'SELECT user_id, username, user_type, user_email, user_newpasswd, user_lang, user_actkey, user_inactive_reason, reset_token, reset_token_expiration
|
||||
FROM ' . USERS_TABLE . "
|
||||
WHERE username = '" . $db->sql_escape($username) . "'";
|
||||
$result = $db->sql_query($sql);
|
||||
|
|
|
@ -30,15 +30,33 @@ class phpbb_notification_convert_test extends phpbb_database_test_case
|
|||
$this->db = $this->new_dbal();
|
||||
$this->doctrine_db = $this->new_doctrine_dbal();
|
||||
$factory = new \phpbb\db\tools\factory();
|
||||
$db_tools = $factory->get($this->doctrine_db);
|
||||
$core_tables = self::get_core_tables();
|
||||
|
||||
// Add user_notify_type column for testing this migration and set type
|
||||
$db_tools->sql_column_add($core_tables['users'], 'user_notify_type', ['TINT:4', 0]);
|
||||
$user_notify_type_map = [
|
||||
1 => 0,
|
||||
2 => 0,
|
||||
3 => 1,
|
||||
4 => 1,
|
||||
5 => 2,
|
||||
6 => 2,
|
||||
];
|
||||
|
||||
foreach ($user_notify_type_map as $user_id => $notify_type)
|
||||
{
|
||||
$this->db->sql_query('UPDATE ' . $core_tables['users'] . ' SET user_notify_type = ' . (int) $notify_type . ' WHERE user_id = ' . (int) $user_id);
|
||||
}
|
||||
|
||||
$this->migration = new \phpbb\db\migration\data\v310\notification_options_reconvert(
|
||||
new \phpbb\config\config(array()),
|
||||
$this->db,
|
||||
$factory->get($this->doctrine_db),
|
||||
$db_tools,
|
||||
$phpbb_root_path,
|
||||
$phpEx,
|
||||
'phpbb_',
|
||||
self::get_core_tables()
|
||||
$core_tables
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
<column>user_id</column>
|
||||
<column>username</column>
|
||||
<column>username_clean</column>
|
||||
<column>user_notify_type</column>
|
||||
<column>user_notify_pm</column>
|
||||
<column>user_permissions</column>
|
||||
<column>user_sig</column>
|
||||
|
@ -13,7 +12,6 @@
|
|||
<value>1</value>
|
||||
<value>1</value>
|
||||
<value>0</value>
|
||||
<value>0</value>
|
||||
<value></value>
|
||||
<value></value>
|
||||
</row>
|
||||
|
@ -21,7 +19,6 @@
|
|||
<value>2</value>
|
||||
<value>2</value>
|
||||
<value>2</value>
|
||||
<value>0</value>
|
||||
<value>1</value>
|
||||
<value></value>
|
||||
<value></value>
|
||||
|
@ -30,7 +27,6 @@
|
|||
<value>3</value>
|
||||
<value>3</value>
|
||||
<value>3</value>
|
||||
<value>1</value>
|
||||
<value>0</value>
|
||||
<value></value>
|
||||
<value></value>
|
||||
|
@ -40,7 +36,6 @@
|
|||
<value>4</value>
|
||||
<value>4</value>
|
||||
<value>1</value>
|
||||
<value>1</value>
|
||||
<value></value>
|
||||
<value></value>
|
||||
</row>
|
||||
|
@ -48,7 +43,6 @@
|
|||
<value>5</value>
|
||||
<value>5</value>
|
||||
<value>5</value>
|
||||
<value>2</value>
|
||||
<value>0</value>
|
||||
<value></value>
|
||||
<value></value>
|
||||
|
@ -57,7 +51,6 @@
|
|||
<value>6</value>
|
||||
<value>6</value>
|
||||
<value>6</value>
|
||||
<value>2</value>
|
||||
<value>1</value>
|
||||
<value></value>
|
||||
<value></value>
|
||||
|
|
Loading…
Add table
Reference in a new issue