| @@ 175-184 (lines=10) @@ | ||
| 172 | $res = array(); |
|
| 173 | $groups = $auth->getGroupsByFilter(false); |
|
| 174 | $count = count($groups); |
|
| 175 | for($i = 0; $i < $count; $i++) |
|
| 176 | { |
|
| 177 | $tmp = json_decode(json_encode($groups[$i]), true); |
|
| 178 | $tmp['type'] = 'Group'; |
|
| 179 | if($keys !== false) |
|
| 180 | { |
|
| 181 | $tmp = array_intersect_key($tmp, $keys); |
|
| 182 | } |
|
| 183 | $res[] = $tmp; |
|
| 184 | } |
|
| 185 | $users = $auth->getUsersByFilter(false); |
|
| 186 | $count = count($users); |
|
| 187 | for($i = 0; $i < $count; $i++) |
|
| @@ 187-196 (lines=10) @@ | ||
| 184 | } |
|
| 185 | $users = $auth->getUsersByFilter(false); |
|
| 186 | $count = count($users); |
|
| 187 | for($i = 0; $i < $count; $i++) |
|
| 188 | { |
|
| 189 | $tmp = json_decode(json_encode($users[$i]), true); |
|
| 190 | $tmp['type'] = 'User'; |
|
| 191 | if($keys !== false) |
|
| 192 | { |
|
| 193 | $tmp = array_intersect_key($tmp, $keys); |
|
| 194 | } |
|
| 195 | $res[] = $tmp; |
|
| 196 | } |
|
| 197 | return $res; |
|
| 198 | } |
|
| 199 | ||
| @@ 230-235 (lines=6) @@ | ||
| 227 | { |
|
| 228 | $count = count($res); |
|
| 229 | $keys = array_flip($app->odata->select); |
|
| 230 | for($i = 0; $i < $count; $i++) |
|
| 231 | { |
|
| 232 | $tmp = json_decode(json_encode($res[$i]), true); |
|
| 233 | $tmp['type'] = getTypeOfEntity($res[$i]); |
|
| 234 | $res[$i] = array_intersect_key($tmp, $keys); |
|
| 235 | } |
|
| 236 | } |
|
| 237 | echo json_encode($res); |
|
| 238 | } |
|