From: Greg Burri Date: Wed, 16 Apr 2008 06:54:01 +0000 (+0000) Subject: DEL tout ce qui concerne la gestion du CAPTCHA X-Git-Tag: 1.0.0^2~160 X-Git-Url: http://git.euphorik.ch/?p=euphorik.git;a=commitdiff_plain;h=7ed3a03bffb4112ee174b05ef1d7b486d6ad6534 DEL tout ce qui concerne la gestion du CAPTCHA --- diff --git a/js/euphorik.js b/js/euphorik.js index 4b76b93..dfd398d 100755 --- a/js/euphorik.js +++ b/js/euphorik.js @@ -396,9 +396,6 @@ function Client(util) this.cookie = null this.regexCookie = new RegExp("^cookie=([^;]*)") - - // Obsolète - //this.captchaCrypt = null // données personnels this.resetDonneesPersonnelles() @@ -535,32 +532,6 @@ Client.prototype.getXMLloginCookie = function() return XMLDocument } - -/* Obsolète -Client.prototype.getXMLloginCaptcha = function(captchaCrypt, captchaInput) -{ - var XMLDocument = this.util.creerDocumentXMLAction() - XMLDocument.documentElement.setAttribute("name", "loginCaptcha") - - var nodecaptchaCrypt = XMLDocument.createElement("captchaCrypt") - nodecaptchaCrypt.appendChild(XMLDocument.createTextNode(captchaCrypt)) - XMLDocument.documentElement.appendChild(nodecaptchaCrypt) - - var nodecaptchaInput = XMLDocument.createElement("captchaInput") - nodecaptchaInput.appendChild(XMLDocument.createTextNode(captchaInput)) - XMLDocument.documentElement.appendChild(nodecaptchaInput) - - return XMLDocument -}*/ - -/* Obsolète -Client.prototype.getXMLgenerationCaptcha = function() -{ - var XMLDocument = this.util.creerDocumentXMLAction() - XMLDocument.documentElement.setAttribute("name", "generationCaptcha") - - return XMLDocument -}*/ Client.prototype.getXMLEnregistrement = function(login, password) { @@ -676,33 +647,7 @@ Client.prototype.setStatut = function(statut) this.statut = statut this.majMenu() -} - -/** - * Demande la génération d'un captcha au serveur et l'affiche. - */ - /* Obsolète -Client.prototype.afficherCaptcha = function(query) -{ - var thisClient = this - - $.post("request", this.util.xmlVersAction(this.getXMLgenerationCaptcha()), - function(data, textStatus) - { - var chemin = jQuery("chemin", data.documentElement).text() - thisClient.captchaCrypt = jQuery("captchaCrypt", data.documentElement).text() - jQuery(query).prepend( - "

Es-tu un bot ? " + - "

" - ) - } - ) } - -Client.prototype.cacherCaptcha = function() -{ - jQuery("#captcha").remove() -}*/ /** * Effectue la connexion vers le serveur. @@ -720,13 +665,7 @@ Client.prototype.connexionCookie = function() Client.prototype.connexionLogin = function(login, password) { return this.connexion(this.util.xmlVersAction(this.getXMLlogin(login, password))) -} - -/* Obsolète -Client.prototype.connexionCaptcha = function() -{ - return this.connexion(this.util.xmlVersAction(this.getXMLloginCaptcha(this.captchaCrypt, jQuery("#captcha input").val()))) -}*/ +} Client.prototype.enregistrement = function(login, password) { diff --git a/modules/erl/euphorik_bd.erl b/modules/erl/euphorik_bd.erl index c27a694..298db8d 100755 --- a/modules/erl/euphorik_bd.erl +++ b/modules/erl/euphorik_bd.erl @@ -94,5 +94,3 @@ peupler() -> mnesia:write({minichat, now(), "Paul", "Salut à toi !"}) end ). - - diff --git a/modules/erl/euphorik_protocole.erl b/modules/erl/euphorik_protocole.erl index 251d4c1..f56a335 100755 --- a/modules/erl/euphorik_protocole.erl +++ b/modules/erl/euphorik_protocole.erl @@ -8,8 +8,6 @@ -module(euphorik_protocole). -export([ - %generation_captcha/1, Obsolète - %nouveau_user_captcha/1, Obsolète nouveau_user_login/1, login/1, logout/1, @@ -22,34 +20,6 @@ -include("../include/euphorik_bd.hrl"). -include("../include/euphorik_defines.hrl"). - -% Génère un nouveau captchat dans ?DOSSIER_CAPTCHA -% Obsolète -%~ generation_captcha(_) -> - %~ {Mot_crypt, Nom_fichier} = captcha:create(5, ?DOSSIER_CAPTCHA), - %~ simple_xml_to_string(xml_reponse_generation_captcha(?DOSSIER_CAPTCHA_RELATIF "/" ++ Nom_fichier, Mot_crypt)). - - -% Un nouvel utilisateur doit être créé. -% Obolète : le captcha n'existe plus -% Action est un xmlElement(). -%~ nouveau_user_captcha(Action) -> - %~ simple_xml_to_string( - %~ case {xmerl_xpath:string("captchaCrypt", Action), xmerl_xpath:string("captchaInput", Action)} of - %~ {[#xmlElement{content = [#xmlText{value = C1}]}], [#xmlElement{content = [#xmlText{value = C2}]}]} -> - %~ C2_crypt = common:crypt(C2), - %~ if C1 =:= C2_crypt -> - %~ Cookie = generer_cookie(), - %~ User = euphorik_minichat:nouveau_user("Paul", Cookie), - %~ xml_reponse_login_ok(User); - %~ true -> - %~ xml_reponse_login_pas_ok("Captcha incorrect") - %~ end; - %~ _ -> - %~ xml_reponse_login_pas_ok("XML malformé") - %~ end - %~ ). - % Une utilisateur s'enregistre avec un tuple {Login, Password}. % @spec nouveau_user_login(xmerl:xmlElement()) -> string() @@ -374,16 +344,5 @@ xml_reponse_message(Ok) -> ] } ]. - - -% Obsolète -%~ xml_reponse_generation_captcha(Chemin, Captcha) -> - %~ [ - %~ {reponse, [{name, "generationCaptcha"}], - %~ [ - %~ {chemin, [], [Chemin]}, - %~ {captchaCrypt, [], [Captcha]} - %~ ] - %~ } - %~ ]. + %%%%%%%%% %%%%%%%%% diff --git a/modules/erl/euphorik_requests.erl b/modules/erl/euphorik_requests.erl index abfdd93..d6d7294 100755 --- a/modules/erl/euphorik_requests.erl +++ b/modules/erl/euphorik_requests.erl @@ -14,13 +14,7 @@ -include_lib("yaws/include/yaws_api.hrl"). % Test du module -tester() -> - %~ {XML, _} = xmerl_scan:string( - %~ "" - %~ " b1b1b4e72e6f3d00e477cf37cced5851" - %~ " LKJDLA" - %~ ""), - %~ io:format("Nouvel user : ~p~n", [nouveau_user(XML)]). +tester() -> %~ {XML2, _} = xmerl_scan:string( %~ "" @@ -40,9 +34,6 @@ tester() -> %~ "4UDUSY6Z2IZNTQO484S8X" %~ "Pifou" %~ "test & plop" - %~ ""). - %~ traiter_xml( - %~ "" %~ ""). @@ -57,14 +48,6 @@ out(A) -> traiter_xml(Contenu) -> {XML, _} = xmerl_scan:string(Contenu), traiter_action(XML#xmlElement.attributes, XML). - - -% un client demande la génération d'un captcha (obsolète) -%~ traiter_action([#xmlAttribute{value="generationCaptcha"}], XML) -> - %~ euphorik_protocole:generation_captcha(XML); -% un client se log pour la première fois (obsolète) -%~ traiter_action([#xmlAttribute{value="loginCaptcha"}], XML) -> - %~ euphorik_protocole:nouveau_user_captcha(XML); % un client s'enregistre (pseudo + password) diff --git a/modules/include/euphorik_bd.hrl b/modules/include/euphorik_bd.hrl index a3a7f20..841d7a4 100755 --- a/modules/include/euphorik_bd.hrl +++ b/modules/include/euphorik_bd.hrl @@ -7,6 +7,7 @@ key, value }). + % décrit un enregistrement d'un message -record(minichat, @@ -43,5 +44,3 @@ page_principale = 1, % la page de la conversation principale conversations = [] % [{integer(), integer()}], la liste des messages correspondant au conversation ainsi que la page affichée }). - - \ No newline at end of file diff --git a/modules/include/euphorik_defines.hrl b/modules/include/euphorik_defines.hrl index 42026b6..e69de29 100755 --- a/modules/include/euphorik_defines.hrl +++ b/modules/include/euphorik_defines.hrl @@ -1,3 +0,0 @@ --define(DOSSIER_CAPTCHA_RELATIF, "img/tmp"). --define(DOSSIER_CAPTCHA, "/var/www/euphorik/" ?DOSSIER_CAPTCHA_RELATIF). -