#! /bin/sh

printf "Content-Type: text/plain\r\n\r\n"

request=server-request
port=4000
first=1

for id in $("$request" $port GET-USERS-LIST)
do
	name=$("$request" $port "GET-USER-NAME $id")
	type=$("$request" $port "GET-USER-TYPE $id")
	permissions=$("$request" $port "GET-USER-PERMISSIONS $id")

	if [ "$first" = "1" ]
	then
		first=0
	else
		printf " "
	fi
	printf "$id,$name,$type,$permissions"
done
