Merge pull request #24118 from comaiteseb/patch-1

FIX impossible to edit user if you are admin
This commit is contained in:
Laurent Destailleur 2023-03-04 15:02:16 +01:00 committed by GitHub
commit cd7f0f2962
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -125,7 +125,7 @@ if ($user->id != $id && !$canreaduser) {
// Define value to know what current user can do on properties of edited user
if ($id > 0) {
// $user is the current logged user, $id is the user we want to edit
$canedituser = (($user->id == $id) && $user->hasRight("user", "self", "write")); // can edit myself
$canedituser = (($user->id == $id) && $user->hasRight("user", "self", "write")) || (($user->id != $id) && $user->hasRight("user", "user", "write"));
$caneditfield = ((($user->id == $id) && $user->hasRight("user", "self", "write")) || (($user->id != $id) && $user->hasRight("user", "user", "write")));
$caneditpassword = ((($user->id == $id) && $user->hasRight("user", "self", "password")) || (($user->id != $id) && $user->hasRight("user", "user", "password")));
}