aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/db/migration/tool
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2015-06-09 20:23:29 +0200
committerJoas Schilling <nickvergessen@gmx.de>2015-06-09 20:23:29 +0200
commit00c15c76c30719773dab26949445a143870ddbee (patch)
tree561fad722b8198d002293c5ec165a16063503155 /phpBB/phpbb/db/migration/tool
parent47ef99f6ef5ee781264797da74c4bf4076ae3d11 (diff)
parent832c9f64e04ad22dce1d51e72f3c65df4894c0eb (diff)
downloadforums-00c15c76c30719773dab26949445a143870ddbee.tar
forums-00c15c76c30719773dab26949445a143870ddbee.tar.gz
forums-00c15c76c30719773dab26949445a143870ddbee.tar.bz2
forums-00c15c76c30719773dab26949445a143870ddbee.tar.xz
forums-00c15c76c30719773dab26949445a143870ddbee.zip
Merge branch '3.1.x'
Diffstat (limited to 'phpBB/phpbb/db/migration/tool')
-rw-r--r--phpBB/phpbb/db/migration/tool/permission.php22
1 files changed, 18 insertions, 4 deletions
diff --git a/phpBB/phpbb/db/migration/tool/permission.php b/phpBB/phpbb/db/migration/tool/permission.php
index 1a91127d2d..ceff6d7d5a 100644
--- a/phpBB/phpbb/db/migration/tool/permission.php
+++ b/phpBB/phpbb/db/migration/tool/permission.php
@@ -425,13 +425,27 @@ class permission implements \phpbb\db\migration\tool\tool_interface
$role_id = (int) $this->db->sql_fetchfield('auth_role_id');
if ($role_id)
{
- $sql = 'SELECT role_name
+ $sql = 'SELECT role_name, role_type
FROM ' . ACL_ROLES_TABLE . '
WHERE role_id = ' . $role_id;
$this->db->sql_query($sql);
- $role_name = $this->db->sql_fetchfield('role_name');
-
- return $this->permission_set($role_name, $auth_option, 'role', $has_permission);
+ $role_data = $this->db->sql_fetchrow();
+ $role_name = $role_data['role_name'];
+ $role_type = $role_data['role_type'];
+
+ // Filter new auth options to match the role type: a_ | f_ | m_ | u_
+ // Set new auth options to the role only if options matching the role type were found
+ $auth_option = array_filter($auth_option,
+ function ($option) use ($role_type)
+ {
+ return strpos($option, $role_type) === 0;
+ }
+ );
+
+ if (sizeof($auth_option))
+ {
+ return $this->permission_set($role_name, $auth_option, 'role', $has_permission);
+ }
}
$sql = 'SELECT auth_option_id, auth_setting