mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
Merge pull request #6802 from marc1706/ticket/17493
[ticket/17493] Drop support for jabber
This commit is contained in:
@@ -13,10 +13,12 @@
|
||||
|
||||
namespace phpbb\db\migration\data\v310;
|
||||
|
||||
use phpbb\messenger\method\messenger_interface;
|
||||
|
||||
class notification_options_reconvert extends \phpbb\db\migration\migration
|
||||
{
|
||||
protected const NOTIFY_EMAIL = 0;
|
||||
protected const NOTIFY_IM = 1;
|
||||
protected const NOTIFY_BOTH = 2;
|
||||
|
||||
public static function depends_on()
|
||||
{
|
||||
return array('\phpbb\db\migration\data\v310\notifications_schema_fix');
|
||||
@@ -69,12 +71,12 @@ class notification_options_reconvert extends \phpbb\db\migration\migration
|
||||
// In-board notification
|
||||
$notification_methods[] = '';
|
||||
|
||||
if ($row['user_notify_type'] == messenger_interface::NOTIFY_EMAIL || $row['user_notify_type'] == messenger_interface::NOTIFY_BOTH)
|
||||
if ($row['user_notify_type'] == self::NOTIFY_EMAIL || $row['user_notify_type'] == self::NOTIFY_BOTH)
|
||||
{
|
||||
$notification_methods[] = 'email';
|
||||
}
|
||||
|
||||
if ($row['user_notify_type'] == messenger_interface::NOTIFY_IM || $row['user_notify_type'] == messenger_interface::NOTIFY_BOTH)
|
||||
if ($row['user_notify_type'] == self::NOTIFY_IM || $row['user_notify_type'] == self::NOTIFY_BOTH)
|
||||
{
|
||||
$notification_methods[] = 'jabber';
|
||||
}
|
||||
|
115
phpBB/phpbb/db/migration/data/v400/remove_jabber.php
Normal file
115
phpBB/phpbb/db/migration/data/v400/remove_jabber.php
Normal file
@@ -0,0 +1,115 @@
|
||||
<?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_jabber extends migration
|
||||
{
|
||||
public static function depends_on(): array
|
||||
{
|
||||
return [
|
||||
'\phpbb\db\migration\data\v310\notifications_use_full_name',
|
||||
'\phpbb\db\migration\data\v31x\add_jabber_ssl_context_config_options',
|
||||
'\phpbb\db\migration\data\v400\dev',
|
||||
'\phpbb\db\migration\data\v400\add_webpush',
|
||||
];
|
||||
}
|
||||
|
||||
public function update_schema(): array
|
||||
{
|
||||
return [
|
||||
'drop_columns' => [
|
||||
$this->table_prefix . 'users' => [
|
||||
'user_jabber',
|
||||
],
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
public function revert_schema(): array
|
||||
{
|
||||
return [
|
||||
'add_columns' => [
|
||||
$this->table_prefix . 'users' => [
|
||||
'user_jabber' => ['VCHAR_UNI', ''],
|
||||
],
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
public function update_data(): array
|
||||
{
|
||||
return [
|
||||
['config.remove', ['jab_enable']],
|
||||
['config.remove', ['jab_host']],
|
||||
['config.remove', ['jab_package_size']],
|
||||
['config.remove', ['jab_password']],
|
||||
['config.remove', ['jab_port']],
|
||||
['config.remove', ['jab_use_ssl']],
|
||||
['config.remove', ['jab_username']],
|
||||
['config.remove', ['jab_verify_peer']],
|
||||
['config.remove', ['jab_verify_peer_name']],
|
||||
['config.remove', ['jab_allow_self_signed']],
|
||||
['module.remove', [
|
||||
'acp',
|
||||
'ACP_CLIENT_COMMUNICATION',
|
||||
'ACP_JABBER_SETTINGS',
|
||||
]],
|
||||
['permission.remove', ['a_jabber']],
|
||||
['permission.remove', ['u_sendim']],
|
||||
['custom', [[$this, 'move_jabber_to_email_notifications']]],
|
||||
];
|
||||
}
|
||||
|
||||
public function revert_data(): array
|
||||
{
|
||||
return [
|
||||
['config.add', ['jab_enable', 0]],
|
||||
['config.add', ['jab_host', '']],
|
||||
['config.add', ['jab_package_size', 20]],
|
||||
['config.add', ['jab_password', '']],
|
||||
['config.add', ['jab_port', 5222]],
|
||||
['config.add', ['jab_use_ssl', 0]],
|
||||
['config.add', ['jab_username', '']],
|
||||
['config.add', ['jab_verify_peer', 1]],
|
||||
['config.add', ['jab_verify_peer_name', 1]],
|
||||
['config.add', ['jab_allow_self_signed', 0]],
|
||||
['module.add', [
|
||||
'acp',
|
||||
'ACP_CLIENT_COMMUNICATION',
|
||||
[
|
||||
'module_basename' => 'acp_jabber',
|
||||
'module_langname' => 'ACP_JABBER_SETTINGS',
|
||||
'module_mode' => 'settings',
|
||||
'module_auth' => 'acl_a_jabber',
|
||||
],
|
||||
]],
|
||||
['permission.add', ['a_jabber', true]],
|
||||
['permission.add', ['u_sendim', true]],
|
||||
];
|
||||
}
|
||||
|
||||
public function move_jabber_to_email_notifications(?int $start)
|
||||
{
|
||||
$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 ?: 0);
|
||||
|
||||
return $this->db->sql_affectedrows() < $limit ? true : $start + $limit;
|
||||
}
|
||||
}
|
50
phpBB/phpbb/db/migration/data/v400/remove_notify_type.php
Normal file
50
phpBB/phpbb/db/migration/data/v400/remove_notify_type.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?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],
|
||||
],
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user