chti56 Posted February 5, 2020 Share Posted February 5, 2020 Bonjour, J'ai un site installé avec PS 1.6.1.16 depuis longtemps. Je reçois régulièrement par jour des dizaines messages Spams au travers le formulaire de contact alors qu'un reCaptcha est en place sur ce formulaire. Voir le fichier joint de messages envoyés aujourd'hui et les jours précédents. Y aurait-il possibilité de filtrer ces types de messages au départ ou de bloquer l'expéditeur ? Merci pour votre aide car ces messages sont exaspérants. JP Link to comment Share on other sites More sharing options...
Eolia Posted February 5, 2020 Share Posted February 5, 2020 Quel captcha utilisez vous car il ne semble pas très efficace ? Link to comment Share on other sites More sharing options...
chti56 Posted February 5, 2020 Author Share Posted February 5, 2020 Il faut que je vérifie car cela a été fait il y a pas mal de temps. Par ailleurs j'ai essayé d'installer le module eicpatcha.zip sur un autre site installé avec PS 1.7.2.2, mais là j'ai un autre soucis car cette version n'est pas compatible avec la version de PS. JP Link to comment Share on other sites More sharing options...
chti56 Posted February 5, 2020 Author Share Posted February 5, 2020 Sur le site installé avec PS 1.6.1.16 , je ne trouve pas de module reCaptcha alors qu'il est bien présent dans le formulaire.... J'ai installé ce site il y a plusieurs années.... Link to comment Share on other sites More sharing options...
Eolia Posted February 5, 2020 Share Posted February 5, 2020 Vous avez utilisé ça ? https://shop.devcustom.net/fr/content/9-mise-en-place-captcha?content_only=1 Link to comment Share on other sites More sharing options...
chti56 Posted February 5, 2020 Author Share Posted February 5, 2020 (edited) Seule cette ligne est présente dans le fichier contact-form.tpl: <form action="{$request_uri}" method="post" class="contact-form-box" enctype="multipart/form-data"> Mais rien vu dans les autres fichiers. Le site de la cliente est celui-ci: ............ Edited February 5, 2020 by chti56 (see edit history) Link to comment Share on other sites More sharing options...
doekia Posted February 5, 2020 Share Posted February 5, 2020 eicaptcha est réputé ne rien protéger. Migrez en 1.6.1.24 + le lien fourni par @Eolia (equivalentde http://area51.enter-solutions.com/snippets/74) A tester avec ce bookmarklet http://area51.enter-solutions.com/snippets/92 il y a 1 minute, chti56 a dit : Le site de la cliente grrrr ! Link to comment Share on other sites More sharing options...
chti56 Posted February 5, 2020 Author Share Posted February 5, 2020 (edited) J'ai encore vérifié les fichiers à corriger sur le site en PS 1.6.1.16 qui affiche pourtant un reCaptcha dans le formulaire de contact. J'ai trouvé ces codes (lignes 98 à 119} dans le fichier header.tpl (...j'ai enlevé la clé Google...), mais rien dans les autres. header_test.tpl Edited February 5, 2020 by chti56 Suppression des clés Google (see edit history) Link to comment Share on other sites More sharing options...
doekia Posted February 5, 2020 Share Posted February 5, 2020 (edited) Il te faut ensuite mettre la vérification en place ( avec la clé privé) ... dans le fichier index.php à la racine du site Edited February 5, 2020 by doekia (see edit history) Link to comment Share on other sites More sharing options...
chti56 Posted February 5, 2020 Author Share Posted February 5, 2020 C'est-à-dire mettre ceci dans le fichier index.php qui est 'vide' pour le moment ?: **************************************************** if (isset($_REQUEST['submitMessage']) || isset($_REQUEST['submitAccount'])) { if (empty($_REQUEST['g-recaptcha-response'])) { sleep(25); die('not human'); } $opts = array('http' => array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => http_build_query( $post = array( 'secret' => 'XXXXXXX-the-secret-key-XXXXXXXXXX', 'response' => $_REQUEST['g-recaptcha-response'], ) ), ), ); if (in_array(ini_get('allow_url_fopen'), array('On', 'on', '1'))) { $stream = stream_context_create($opts); $captcha = @json_decode(file_get_contents('https://www.google.com/recaptcha/api/siteverify', false, $stream), true); } elseif (function_exists('curl_init')) { $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_RETURNTRANSFER => 1, CURLOPT_URL => 'https://www.google.com/recaptcha/api/siteverify', CURLOPT_POST => 1, CURLOPT_POSTFIELDS => $post, ) ); $captcha = @json_decode(curl_exec($curl),true); curl_close($curl); } else { // buggy hoster ! $captcha = array('error' => 'buggy hoster'); } if (empty($captcha['success'])){ if(!empty($_SERVER['HTTP_REFERER'])) { sleep(5); die('<p>Captcha Invalide</p><a href="'.$_SERVER['HTTP_REFERER'].'"><button>Retour au formulaire</button></a>'); } sleep(25); die('not human'); } } **************************************************** index.php Link to comment Share on other sites More sharing options...
Eolia Posted February 5, 2020 Share Posted February 5, 2020 à la ligne 26 oui, avec la clé secrète Link to comment Share on other sites More sharing options...
chti56 Posted February 5, 2020 Author Share Posted February 5, 2020 Je viens de faire la modif. Un Grand merci pour ton aide, car il y a pas mal de temps que je n'ai plus touché à Prestashop... Que me conseilles-tu pour mon autre site qui tourne avec PS 1.7.2.2 et qui n'a pas du tout de fonction reCaptcha ? Cdt Link to comment Share on other sites More sharing options...
Eolia Posted February 5, 2020 Share Posted February 5, 2020 On va éviter de parler de choses qui fâchent^^ Link to comment Share on other sites More sharing options...
chti56 Posted February 5, 2020 Author Share Posted February 5, 2020 A bientôt 75 ans c'est vrai ... Pas grave. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now