PHP_SMART_HOME_V3/app/api/UserApi.php
JonatanRek cb6ab3bdda Fixed
2020-06-23 20:25:42 +02:00

20 lines
439 B
PHP

<?php
class UsersApi extends ApiController{
public function default(){
//$this->requireAuth();
$response = null;
$users = UserManager::getUsers(["user_id", "username", "at_home"]);
foreach ($users as $key => $user) {
$response[] = [
"userName" => $users['username'],
"homeStatus" => ($users['at_home']) ? true : false,
"avatarUrl" => getAvatarUrl($value['user_id']),
];
}
$this->response($response);
}
}