diff --git a/src/Dropdown.php b/src/Dropdown.php index 90e6478b1da..1b8db84c1f5 100644 --- a/src/Dropdown.php +++ b/src/Dropdown.php @@ -2178,7 +2178,11 @@ public static function showFromArray($name, array $elements, $options = []) $to_display[] = $elements[$value]; } } - $output .= '' . implode(', ', $to_display) . ''; + $output .= ''; } else { $output .= "" . __('Active') . ""; - Dropdown::showYesNo('is_active', $this->fields['is_active'], -1, ['rand' => $activerand]); + $params = ['rand' => $activerand]; + if (!$higherrights) { + $params['readonly'] = true; + $params['tooltip'] = __('Not enough rights to change this field'); + } + Dropdown::showYesNo('is_active', $this->fields['is_active'], -1, $params); echo ""; } else { echo ""; diff --git a/src/UserEmail.php b/src/UserEmail.php index 3c4a2582fa7..3a2c4c850da 100644 --- a/src/UserEmail.php +++ b/src/UserEmail.php @@ -257,7 +257,12 @@ public static function showForUser(User $user) ) { return; } - $canedit = ($user->can($users_id, UPDATE) || ($users_id == Session::getLoginUserID())); + $canedit = ( + ( + $user->can($users_id, UPDATE) + && ($user->currentUserHaveMoreRightThan($users_id))) + || ($users_id == Session::getLoginUserID()) + ); parent::showChildsForItemForm($user, '_useremails', $canedit); } @@ -273,7 +278,12 @@ public static function showAddEmailButton(User $user) if (!$user->can($users_id, READ) && ($users_id != Session::getLoginUserID())) { return false; } - $canedit = ($user->can($users_id, UPDATE) || ($users_id == Session::getLoginUserID())); + $canedit = ( + ( + $user->can($users_id, UPDATE) + && ($user->currentUserHaveMoreRightThan($users_id))) + || ($users_id == Session::getLoginUserID()) + ); parent::showAddChildButtonForItemForm($user, '_useremails', $canedit);