mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-11-27 15:59:29 +00:00
Divided important users informations requests
This commit is contained in:
parent
71e3d06209
commit
8651b87244
@ -86,8 +86,21 @@ class userController
|
|||||||
//No ID specified
|
//No ID specified
|
||||||
Rest_fatal_error(400, "Please specify at least one user ID !");
|
Rest_fatal_error(400, "Please specify at least one user ID !");
|
||||||
|
|
||||||
|
//Check if it is a wide request or not
|
||||||
|
if(count($usersID) <= 10)
|
||||||
//Try to get user infos
|
//Try to get user infos
|
||||||
$userInfos = CS::get()->components->user->getMultipleUserInfos($usersID);
|
$userInfos = CS::get()->components->user->getMultipleUserInfos($usersID);
|
||||||
|
else {
|
||||||
|
//Divide request in multiples ones
|
||||||
|
$userInfos = array();
|
||||||
|
foreach(array_chunk($usersID, 10) as $process_users_ID){
|
||||||
|
|
||||||
|
//Get informations about the IDS
|
||||||
|
foreach(CS::get()->components->user->getMultipleUserInfos($process_users_ID) as $key=>$val){
|
||||||
|
$userInfos[$key] = $val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//Check if response is empty
|
//Check if response is empty
|
||||||
if(count($userInfos) == 0)
|
if(count($userInfos) == 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user