diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2010-10-15 14:15:21 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2010-10-15 14:15:21 +0200 |
commit | 5e295cb6b5129a8cac5bdee75ae7d3a06e690e72 (patch) | |
tree | 9a56d52dc25f7635f085d09d671ab4b2d0c0ef7a /client/client.erl | |
parent | 7292f0a6d61127b4c7ba3c830fe62f73c7ef3cff (diff) | |
download | erlang-5e295cb6b5129a8cac5bdee75ae7d3a06e690e72.tar.gz erlang-5e295cb6b5129a8cac5bdee75ae7d3a06e690e72.tar.xz erlang-5e295cb6b5129a8cac5bdee75ae7d3a06e690e72.zip |
added mass_register
Diffstat (limited to 'client/client.erl')
-rw-r--r-- | client/client.erl | 13 |
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}. |