1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 14:00:31 +02:00

[ticket/16764] Remove remote avatar functionality

PHPBB3-16764
This commit is contained in:
Marc Alexander
2021-04-23 22:26:07 +02:00
parent de48b4d2c1
commit cc8b4ef619
23 changed files with 81 additions and 469 deletions

View 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\container_aware_migration;
class remove_remote_avatar extends container_aware_migration
{
public static function depends_on()
{
return ['\phpbb\db\migration\data\v400\dev'];
}
public function update_data()
{
return [
['config.remove', ['allow_avatar_remote']],
['config.remove', ['allow_avatar_remote_upload']],
['custom', [[$this, 'remove_remote_avatars']]],
];
}
public function remove_remote_avatars(): void
{
// Remove remote avatar from users and groups
$sql = 'UPDATE ' . $this->table_prefix . "users
SET user_avatar = '',
user_avatar_type = ''
WHERE user_avatar_type = 'avatar.driver.remote'";
$this->db->sql_query($sql);
$sql = 'UPDATE ' . $this->table_prefix . "groups
SET group_avatar = '',
group_avatar_type = ''
WHERE group_avatar_type = 'avatar.driver.remote'";
$this->db->sql_query($sql);
}
}