C2_crypt = common:crypt(C2),\r
if C1 =:= C2_crypt ->\r
Cookie = generer_cookie(),\r
C2_crypt = common:crypt(C2),\r
if C1 =:= C2_crypt ->\r
Cookie = generer_cookie(),\r
nouveau_user_login(Action) ->\r
{Login, Password, Login_deja_pris} = case {xmerl_xpath:string("login", Action), xmerl_xpath:string("password", Action)} of\r
{[#xmlElement{content = [#xmlText{value = L}]}], [#xmlElement{content = [#xmlText{value = P}]}]} ->\r
nouveau_user_login(Action) ->\r
{Login, Password, Login_deja_pris} = case {xmerl_xpath:string("login", Action), xmerl_xpath:string("password", Action)} of\r
{[#xmlElement{content = [#xmlText{value = L}]}], [#xmlElement{content = [#xmlText{value = P}]}]} ->\r
- {L, P, case minichat:get_user_by_login(L) of {ok, _} -> true; _ -> false end};\r
+ {L, P, case euphorik_minichat:get_user_by_login(L) of {ok, _} -> true; _ -> false end};\r
xml_reponse_login_pas_ok("Login déjà pris");\r
true ->\r
Cookie = generer_cookie(),\r
xml_reponse_login_pas_ok("Login déjà pris");\r
true ->\r
Cookie = generer_cookie(),\r
- User = minichat:nouveau_user(Login, Password, Cookie),\r
+ User = euphorik_minichat:nouveau_user(Login, Password, Cookie),\r
login(Action) ->
case xmerl_xpath:string("cookie", Action) of
[#xmlElement{content = [#xmlText{value = Cookie}]}] ->
login(Action) ->
case xmerl_xpath:string("cookie", Action) of
[#xmlElement{content = [#xmlText{value = Cookie}]}] ->
_ ->
case {xmerl_xpath:string("login", Action), xmerl_xpath:string("password", Action)} of
{[#xmlElement{content = [#xmlText{value = Login}]}], [#xmlElement{content = [#xmlText{value = Password}]}]} ->
_ ->
case {xmerl_xpath:string("login", Action), xmerl_xpath:string("password", Action)} of
{[#xmlElement{content = [#xmlText{value = Login}]}], [#xmlElement{content = [#xmlText{value = Password}]}]} ->
simple_xml_to_string(xml_reponse_login_ok(User));
loginUser(_) ->
simple_xml_to_string(xml_reponse_login_pas_ok("Erreur de login")).
simple_xml_to_string(xml_reponse_login_ok(User));
loginUser(_) ->
simple_xml_to_string(xml_reponse_login_pas_ok("Erreur de login")).
Pseudo = case xmerl_xpath:string("pseudo", Action) of [#xmlElement{content = [#xmlText{value = P2}]}] -> P2; _ -> Login end,
Email = case xmerl_xpath:string("email", Action) of [#xmlElement{content = [#xmlText{value = E}]}] -> E; _ -> undefined end,
Css = case xmerl_xpath:string("css", Action) of [#xmlElement{content = [#xmlText{value = C}]}] -> C; _ -> undefined end,
Pseudo = case xmerl_xpath:string("pseudo", Action) of [#xmlElement{content = [#xmlText{value = P2}]}] -> P2; _ -> Login end,
Email = case xmerl_xpath:string("email", Action) of [#xmlElement{content = [#xmlText{value = E}]}] -> E; _ -> undefined end,
Css = case xmerl_xpath:string("css", Action) of [#xmlElement{content = [#xmlText{value = C}]}] -> C; _ -> undefined end,
- case minichat:set_profile(Cookie, Login, Password, Pseudo, Email, Css) of
+ case euphorik_minichat:set_profile(Cookie, Login, Password, Pseudo, Email, Css) of
end,
User = case xmerl_xpath:string("cookie", Action) of
[#xmlElement{content = [#xmlText{value = Cookie}]}] ->
end,
User = case xmerl_xpath:string("cookie", Action) of
[#xmlElement{content = [#xmlText{value = Cookie}]}] ->
- A_repondu_a_message = User =/= inconnu andalso minichat:a_repondu_a_message(User#user.id, Mess#minichat.id),\r
- Est_une_reponse_a_user = User =/= inconnu andalso minichat:est_une_reponse_a_user(User#user.id, Mess#minichat.id),
+ A_repondu_a_message = User =/= inconnu andalso euphorik_minichat:a_repondu_a_message(User#user.id, Mess#minichat.id),\r
+ Est_une_reponse_a_user = User =/= inconnu andalso euphorik_minichat:est_une_reponse_a_user(User#user.id, Mess#minichat.id),
U2
end, \r
{message, [{id, erlang:integer_to_list(Mess#minichat.id, 36)}],\r
U2
end, \r
{message, [{id, erlang:integer_to_list(Mess#minichat.id, 36)}],\r
),
[{reponse, [{name, "refreshMessages"}],\r
% la fonction get_nb_page DOIT être évalué après get_dernieres_messages (merci les effets de bord)
),
[{reponse, [{name, "refreshMessages"}],\r
% la fonction get_nb_page DOIT être évalué après get_dernieres_messages (merci les effets de bord)
}];
_ ->
[{reponse, [{name, "refreshMessages"}], [{erreur, [], ["erreur"]}]}]
}];
_ ->
[{reponse, [{name, "refreshMessages"}], [{erreur, [], ["erreur"]}]}]
- Messages = minichat:messages(Dernier_id, Nb_message, Page),
+ Messages = euphorik_minichat:messages(Dernier_id, Nb_message, Page),
- minichat:attends_nouveau_messages(),
- minichat:messages(Dernier_id, Nb_message, Page);
+ euphorik_minichat:attends_nouveau_messages(),
+ euphorik_minichat:messages(Dernier_id, Nb_message, Page);
[#xmlElement{content = Pseudo_fragments}],
[#xmlElement{content = Contenu_fragments}]
} -> \r
[#xmlElement{content = Pseudo_fragments}],
[#xmlElement{content = Contenu_fragments}]
} -> \r
{ok, U} ->\r
Pseudo = defragmenter(Pseudo_fragments),\r
Contenu = defragmenter(Contenu_fragments),\r
% met à jour le pseudo du user\r
{ok, U} ->\r
Pseudo = defragmenter(Pseudo_fragments),\r
Contenu = defragmenter(Contenu_fragments),\r
% met à jour le pseudo du user\r
Reponses = case xmerl_xpath:string("reponses", Action) of\r
[#xmlElement{content = C}] ->\r
lists:map(\r
Reponses = case xmerl_xpath:string("reponses", Action) of\r
[#xmlElement{content = C}] ->\r
lists:map(\r
Contenu_strip = string:strip(Contenu),
if Contenu_strip =:= [] -> xml_reponse_message(pas_ok);
true ->
Contenu_strip = string:strip(Contenu),
if Contenu_strip =:= [] -> xml_reponse_message(pas_ok);
true ->
{id, [{id, erlang:integer_to_list(M#minichat.id, 36)}, {pseudo, M#minichat.pseudo}, {login, User#user.login}], []}
end,
{id, [{id, erlang:integer_to_list(M#minichat.id, 36)}, {pseudo, M#minichat.pseudo}, {login, User#user.login}], []}
end,