aboutsummaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/client.erl13
1 files changed, 12 insertions, 1 deletions
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}.