1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/17333] ACP option to enable-disable all push notifications

PHPBB-17333

Signed-off-by: Matt Friedman <maf675@gmail.com>
This commit is contained in:
Matt Friedman
2024-06-04 08:26:21 -07:00
parent b5d1d03a47
commit e35a6f7aa5
5 changed files with 57 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
<?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 add_webpush_options extends migration
{
public static function depends_on(): array
{
return [
'\phpbb\db\migration\data\v400\add_webpush',
];
}
public function effectively_installed(): bool
{
return $this->config->offsetExists('webpush_method_enables');
}
public function update_data(): array
{
return [
['config.add', ['webpush_method_enables', false]],
];
}
public function revert_data(): array
{
return [
['config.remove', ['webpush_method_enables']],
];
}
}

View File

@@ -91,6 +91,14 @@ class webpush extends messenger_base implements extended_method_interface
&& !empty($this->config['webpush_vapid_public']) && !empty($this->config['webpush_vapid_private']);
}
/**
* {@inheritDoc}
*/
public function is_enabled_by_default()
{
return $this->config['webpush_method_enables'];
}
/**
* {@inheritdoc}
*/