. */ require_once(dirname(__DIR__) . "/helpers/auth.php"); require_once(ROOT_DIR . "/helpers/track.php"); $auth = new uAuth(); $usersArr = []; if (uConfig::$public_tracks || $auth->isAdmin()) { $usersArr = uUser::getAll(); } else if ($auth->isAuthenticated()) { $usersArr = [ $auth->user ]; } $result = []; if ($usersArr === false) { $result = [ "error" => true ]; } else if (!empty($usersArr)) { foreach ($usersArr as $user) { $result[] = [ "id" => $user->id, "login" => $user->login ]; } } header("Content-type: application/json"); echo json_encode($result); ?>