From 5e295cb6b5129a8cac5bdee75ae7d3a06e690e72 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Fri, 15 Oct 2010 14:15:21 +0200 Subject: added mass_register --- client/client.erl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'client/client.erl') diff --git a/client/client.erl b/client/client.erl index ee9421f..ce82669 100644 --- a/client/client.erl +++ b/client/client.erl @@ -1,5 +1,5 @@ -module(client). --export([register/2, register/3, login/3, list/0, handle/2, getVotes/0, vote/2, devote/2]). +-export([register/2, register/3, login/3, list/0, handle/2, getVotes/0, vote/2, devote/2, mass_register/1]). checkLogin(Value) -> %% check if user meets the requirements to be logged in or not by @@ -142,3 +142,14 @@ devote(Artist, Title) -> register(Name, Password) -> %% register a new user (used by the admin) try_logged_in_rpc({register, Name, Password}). + +mass_register(Count) when Count > 0 -> + %% mass register some user with some simple password + case try_logged_in_rpc({register, "User" ++ integer_to_list(Count), "User" ++ integer_to_list(Count)}) of + {ok, _} -> + %% if creation was successfull, create next user + mass_register(Count - 1); + Why -> Why + end; +mass_register(_) -> + {ok}. -- cgit v1.2.3