/* Delete a batch of users from a given realm */

parse arg realm filename admin_user admin_password

if realm = "?" | realm = "/?" | length(realm) = 0 | length(filename) = 0 then do
	say "Utility to Delete a Batch of Users from a PowerWeb Server++ User Database."
	say ""
	say "Usage:     DelUsers Realm BatchFileName [AdminName [AdminPassword]]"
	say ""
	say "Example 1: DelUsers admin users.del"
	say "Example 2: DelUsers admin oldusers.txt admin secret"
	say ""
	say "If the admin user name is omitted, it defaults to 'admin'."
	say "If the admin user password is omitted, it defaults to empty."
	return
end

if length(admin_user) = 0 then
	admin_user = 'admin'

http = '/!user?Realm=/security/userbase/'realm'&user=&password=&verify=&file='filename'&Submit=Delete%%20a%%20User'

call CallHTTP http, admin_user, admin_password, "User Results", "Copyright"

return


