mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
Merge branch '3.3.x'
This commit is contained in:
@@ -30,13 +30,17 @@ class remove_orphaned_roles extends \phpbb\db\migration\migration
|
||||
public function acl_remove_orphaned_roles()
|
||||
{
|
||||
$role_ids = [];
|
||||
$auth_role_ids = [];
|
||||
|
||||
$sql = 'SELECT auth_role_id
|
||||
FROM ' . ACL_GROUPS_TABLE . '
|
||||
WHERE auth_role_id <> 0
|
||||
AND forum_id = 0';
|
||||
$result = $this->db->sql_query($sql);
|
||||
$auth_role_ids = array_keys($this->db->sql_fetchrowset($result));
|
||||
while ($row = $this->db->sql_fetchrow($result))
|
||||
{
|
||||
$auth_role_ids[] = $row['auth_role_id'];
|
||||
}
|
||||
$this->db->sql_freeresult($result);
|
||||
|
||||
if (count($auth_role_ids))
|
||||
@@ -45,7 +49,10 @@ class remove_orphaned_roles extends \phpbb\db\migration\migration
|
||||
FROM ' . ACL_ROLES_TABLE . '
|
||||
WHERE ' . $this->db->sql_in_set('role_id', $auth_role_ids);
|
||||
$result = $this->db->sql_query($sql);
|
||||
$role_ids = array_keys($this->db->sql_fetchrowset($result));
|
||||
while ($row = $this->db->sql_fetchrow($result))
|
||||
{
|
||||
$role_ids[] = $row['role_id'];
|
||||
}
|
||||
$this->db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
|
36
phpBB/phpbb/db/migration/data/v33x/v337.php
Normal file
36
phpBB/phpbb/db/migration/data/v33x/v337.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?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\v33x;
|
||||
|
||||
class v337 extends \phpbb\db\migration\migration
|
||||
{
|
||||
public function effectively_installed()
|
||||
{
|
||||
return version_compare($this->config['version'], '3.3.7', '>=');
|
||||
}
|
||||
|
||||
public static function depends_on()
|
||||
{
|
||||
return [
|
||||
'\phpbb\db\migration\data\v33x\v336',
|
||||
];
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
return [
|
||||
['config.update', ['version', '3.3.7']],
|
||||
];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user