From ee31ff20ce582489beaabcc4b32e07e44f2b1e38 Mon Sep 17 00:00:00 2001 From: Alexandre Delaunay Date: Thu, 15 Sep 2016 13:48:33 +0200 Subject: [PATCH] remove keys for entities in getMyProfiles endpoint; see #964 --- inc/api.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/inc/api.class.php b/inc/api.class.php index f8ec7c06221..d7b7ea08ed0 100644 --- a/inc/api.class.php +++ b/inc/api.class.php @@ -339,7 +339,13 @@ protected function getMyProfiles() { $myprofiles = array(); foreach($_SESSION['glpiprofiles'] as $profiles_id => $profile) { + // append if of the profile into values $profile = ['id' => $profiles_id] + $profile; + + // don't keep keys for entities + $profile['entities'] = array_values($profile['entities']); + + // don't keep keys for profiles $myprofiles[] = $profile; } return array('myprofiles' => $myprofiles);