phpBB

Code Changes

File: phpbb/db/migration/tool/permission.php

  Unmodified   Added   Modified   Removed
Line 425Line 425
				$role_id = (int) $this->db->sql_fetchfield('auth_role_id');
if ($role_id)
{

				$role_id = (int) $this->db->sql_fetchfield('auth_role_id');
if ($role_id)
{

					$sql = 'SELECT role_name
FROM ' . ACL_ROLES_TABLE . '

					$sql = 'SELECT role_name, role_type
FROM ' . ACL_ROLES_TABLE . '

						WHERE role_id = ' . $role_id;
$this->db->sql_query($sql);

						WHERE role_id = ' . $role_id;
$this->db->sql_query($sql);

					$role_name = $this->db->sql_fetchfield('role_name');



					$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);

					return $this->permission_set($role_name, $auth_option, 'role', $has_permission);

 
					}

				}

$sql = 'SELECT auth_option_id, auth_setting

				}

$sql = 'SELECT auth_option_id, auth_setting

Line 537Line 551
				}

$sql = 'DELETE FROM ' . ACL_ROLES_DATA_TABLE . '

				}

$sql = 'DELETE FROM ' . ACL_ROLES_DATA_TABLE . '

					WHERE ' . $this->db->sql_in_set('auth_option_id', $to_remove);


					WHERE ' . $this->db->sql_in_set('auth_option_id', $to_remove) . '
AND role_id = ' . (int) $role_id;

				$this->db->sql_query($sql);
break;


				$this->db->sql_query($sql);
break;


Line 621Line 636
					$arguments[1],
$arguments[0],
);

					$arguments[1],
$arguments[0],
);

 
			break;

case 'reverse':
// Reversing a reverse is just the call itself
$call = array_shift($arguments);

			break;
}


			break;
}