diff --git a/api/api_functions.php b/api/api_functions.php index d985070..de20385 100644 --- a/api/api_functions.php +++ b/api/api_functions.php @@ -62,6 +62,7 @@ function valid_phonenumber($phone) { function get_user_data($ids, $conn) { + $ACTIVE_GROUP_ID = "2"; $conn->setFetchMode(DB_FETCHMODE_ASSOC); /* Get data */ @@ -87,6 +88,7 @@ function get_user_data($ids, $conn) { /* Encode and output */ foreach($res as $result) { + $is_active = "0"; foreach($result as $key => $value) { if($key == "groups") { if($value === "") { @@ -99,6 +101,9 @@ function get_user_data($ids, $conn) { if( !is_valid_utf8($name) ) { $name = utf8_encode($name); } + if($id == $ACTIVE_GROUP_ID) { + $is_active = "1"; + } $u_gs[] = array( 'id' => $id, @@ -112,6 +117,7 @@ function get_user_data($ids, $conn) { $result[$key] = utf8_encode($value); } } + $result['is_active'] = $is_active; $results[] = $result; } return $results;