X-Git-Url: http://git.euphorik.ch/?p=euphorik.git;a=blobdiff_plain;f=modules%2Ferl%2Feuphorik_protocole.erl;h=d99e4cc1e303b2e70a20efe6cb8d77231ba7d53c;hp=e3e2cdf373829afffacbc70c2fbcf901056711ee;hb=c021866458e347a8c704217247ba207ad99c5cb7;hpb=5f6ea43b8825c6df005e0130f9e4fa54b1931831 diff --git a/modules/erl/euphorik_protocole.erl b/modules/erl/euphorik_protocole.erl index e3e2cdf..d99e4cc 100755 --- a/modules/erl/euphorik_protocole.erl +++ b/modules/erl/euphorik_protocole.erl @@ -85,13 +85,13 @@ loginUser({ok, User}, IP) -> json_reponse_login_ok(User); loginUser(_, _) -> % ajoute un délais d'attente - timer:sleep(1000), - erreur("Erreur login"). + timer:sleep(?TEMPS_ATTENTE_ERREUR_LOGIN), + erreur("Couple login/pass introuvable"). % Renvoie un string() représentant un cookie en base 36. Il y a 10^32 possibillités. generer_cookie() -> - {A1,A2,A3} = now(), + {A1, A2, A3} = now(), random:seed(A1, A2, A3), erlang:integer_to_list(random:uniform(math:pow(10, 32)), 36). @@ -111,6 +111,8 @@ profile( {email, Email}, {css, Css}, {nick_format, Nick_format_str}, + {view_times, View_times}, + {view_tooltips, View_tooltips}, {main_page, Main_page}, {conversations, {array, Conversations_json}} ] @@ -128,7 +130,19 @@ profile( [], Conversations_json ), - case euphorik_bd:set_profile(Cookie, Login, Password, Pseudo, Email, Css, list_to_atom(Nick_format_str), Main_page, Conversations) of + % TODO : pas très beau, mieux vaut construire un #user + case euphorik_bd:set_profile( + Cookie, + Login, + Password, + Pseudo, + Email, + Css, + list_to_atom(Nick_format_str), + View_times, + View_tooltips, + Main_page, + Conversations) of ok -> json_reponse_ok(); login_deja_pris -> @@ -662,6 +676,8 @@ json_reponse_login_ok(User) -> {email, User#user.email}, {css, User#user.css}, {nick_format, atom_to_list(User#user.nick_format)}, + {view_times, User#user.view_times}, + {view_tooltips, User#user.view_tooltips}, {main_page, User#user.page_principale}, {conversations, {array,