Merge pull request #6443 from rubencm/ticket/17074

[ticket/17074] Don't allow to create two roles with the same name
This commit is contained in:
Marc Alexander 2023-01-03 22:52:04 +01:00
commit 02efbc251e
No known key found for this signature in database
GPG key ID: 50E0D2423696F995

View file

@ -179,7 +179,7 @@ class acp_permission_roles
$db->sql_freeresult($result);
// Make sure we only print out the error if we add the role or change it's name
if ($row && ($mode == 'add' || ($mode == 'edit' && $role_row['role_name'] != $role_name)))
if ($row && ($action == 'add' || ($action == 'edit' && $role_row['role_name'] != $role_name)))
{
trigger_error(sprintf($user->lang['ROLE_NAME_ALREADY_EXIST'], $role_name) . adm_back_link($this->u_action), E_USER_WARNING);
}