Hello, In the API Function /user/add/ you have a mistake in the file "application/controllers/api/User.php" ?
function "public function add_post()"
$group = json_decode($this->post('group'));
if (is_array($group) AND count($group)) {
$user_id = $save_user;
foreach ($this->post('group') as $group_id) {
$this->aauth->add_member($user_id, $group_id);
}
}
You receive with the POST the GROUPS and use the function json_decode to convert the string in an array but in the FOREACH you use the POST that is an string variable and not the GROUP that is an array variable.
This is a mistake of the code or can I send directly an array in the API. If yes What is the structure of the string to declare the array?
Currently Im using this estructure: ["2","3"] (Each number is the ID of the group) but is not working.
Hello, In the API Function /user/add/ you have a mistake in the file "application/controllers/api/User.php" ?
You receive with the POST the GROUPS and use the function json_decode to convert the string in an array but in the FOREACH you use the POST that is an string variable and not the GROUP that is an array variable.
This is a mistake of the code or can I send directly an array in the API. If yes What is the structure of the string to declare the array?
Currently Im using this estructure: ["2","3"] (Each number is the ID of the group) but is not working.
Thank you for check this issue,