diff --git a/core/users/user_edit.php b/core/users/user_edit.php index 0f7270cacc..bc0937e5b9 100644 --- a/core/users/user_edit.php +++ b/core/users/user_edit.php @@ -125,10 +125,10 @@ $user_status = $_POST["user_status"]; $user_language = $_POST["user_language"]; $user_time_zone = $_POST["user_time_zone"]; - if (permission_exists('user_edit') && $action == 'edit') { + if (permission_exists('contact_add') && $action == 'edit') { $contact_uuid = $_POST["contact_uuid"]; } - else if (permission_exists('user_add') && $action == 'add') { + else if (permission_exists('contact_add') && $action == 'add') { $contact_organization = $_POST["contact_organization"]; $contact_name_given = $_POST["contact_name_given"]; $contact_name_family = $_POST["contact_name_family"]; @@ -485,7 +485,9 @@ if (permission_exists('user_add') || permission_exists('user_edit')) { $array['users'][$x]['api_key'] = ($api_key != '') ? $api_key : null; $array['users'][$x]['user_enabled'] = $user_enabled; - $array['users'][$x]['contact_uuid'] = ($contact_uuid != '') ? $contact_uuid : null; + if (permission_exists('contact_add')) { + $array['users'][$x]['contact_uuid'] = ($contact_uuid != '') ? $contact_uuid : null; + } if ($action == 'add') { $array['users'][$x]['add_user'] = $_SESSION["user"]["username"]; $array['users'][$x]['add_date'] = date("Y-m-d H:i:s.uO"); @@ -567,7 +569,9 @@ $user_email = $row["user_email"]; $api_key = $row["api_key"]; $user_enabled = $row["user_enabled"]; - $contact_uuid = $row["contact_uuid"]; + if (permission_exists('contact_view')) { + $contact_uuid = $row["contact_uuid"]; + } $user_status = $row["user_status"]; } else { @@ -813,7 +817,7 @@ echo " \n"; } - if ($action == 'edit' && permission_exists("user_edit")) { + if ($action == 'edit' && permission_exists("user_edit") && permission_exists('contact_edit')) { echo "