Skip to content

Commit c3451d3

Browse files
committed
Merge branch 'main' into prep-1.0.1
2 parents cb1f634 + 9a5a147 commit c3451d3

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

migrations/fix_acp_module_auth.php

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
/**
3+
*
4+
* phpBB Browser Push Notifications. An extension for the phpBB Forum Software package.
5+
*
6+
* @copyright (c) 2024, phpBB Limited <https://www.phpbb.com>
7+
* @license GNU General Public License, version 2 (GPL-2.0)
8+
*
9+
*/
10+
11+
namespace phpbb\webpushnotifications\migrations;
12+
13+
use phpbb\db\migration\migration;
14+
15+
class fix_acp_module_auth extends migration
16+
{
17+
public static function depends_on()
18+
{
19+
return ['\phpbb\webpushnotifications\migrations\add_webpush'];
20+
}
21+
22+
public function update_data(): array
23+
{
24+
return [
25+
['custom', [[$this, 'set_acp_module_auth']]],
26+
];
27+
}
28+
29+
public function set_acp_module_auth()
30+
{
31+
$phpbb_modules_table = $this->table_prefix . 'modules';
32+
$sql = 'UPDATE ' . $phpbb_modules_table . "
33+
SET module_auth = '" . $this->db->sql_escape('ext_phpbb/webpushnotifications && acl_a_server') . "'
34+
WHERE module_langname = '" . $this->db->sql_escape('ACP_WEBPUSH_EXT_SETTINGS') . "'";
35+
$this->db->sql_query($sql);
36+
}
37+
}

0 commit comments

Comments
 (0)