Vinno1988 Posted December 20, 2018 Share Posted December 20, 2018 Bonjour à vous, Je reçois environ 20 spams venant de Russie par heure. J'ai vu que le sujet a été abordé de nombreuses fois sur de nombreux forums. J'ai tenté de suivre les conseils d'Eolia pour intégrer un reCaptcha, mais rien ne marche. Après la validation du formulaire, une page blanche s'ouvre avec l'inscription "not human". J'ai donc voulu intégrer le re-captcha et modifié les fichiers index.php et contactform.tpl (chemin -> /www/themes/monTheme/modules/contactform/views/templates/widget/contactform.tpl). J'ai également ajouté la classe "contact-form-box" , mais rien ne marche, et toujours cette page not human même après avoir coché la checkbox du captcha. Merci à vous ! Link to comment Share on other sites More sharing options...
Eolia Posted December 21, 2018 Share Posted December 21, 2018 url de votre page contact svp ? Si vous avez ce message c'est que la réponse de Google n'est pas ok. Avez-vous mis les bonnes clés (publiques et privées) dans les bons fichiers ? Link to comment Share on other sites More sharing options...
doekia Posted December 21, 2018 Share Posted December 21, 2018 Revérifié la clé privé dans le index.php Link to comment Share on other sites More sharing options...
biotradmeding Posted December 25, 2018 Share Posted December 25, 2018 Bonjour de quel clé parlez-vous et ou la trouver pour la comparer avec celle du fichier Link to comment Share on other sites More sharing options...
doekia Posted December 25, 2018 Share Posted December 25, 2018 De la clé privé que tu as mis dans ton fichier index, avec le code de vérification (le code qui dit "not human") Link to comment Share on other sites More sharing options...
Vinno1988 Posted December 25, 2018 Author Share Posted December 25, 2018 Bonjour à vous, Avant tout merci pour vos réponses et désolé de mon retard. Je ne pense pas avoir inversé private key et site key, voici l'url de la page concernée https://annadimjewels.com/nous-contacter ; la checkbox du captcha ne s'affiche même pas alors que j'ai collé la ligne e code dans le form pour affiche la div de la checkbox... Le problème ne viendrait pas du fat que je sois en PS 1.7 ? Voici mon index.php en racine : <?php /* * 2007-2015 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/osl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <[email protected]> * @copyright 2007-2015 PrestaShop SA * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ if (isset($_REQUEST['submitMessage'])){ 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( array( 'secret' => '6Lc6y4MUAAAAAC6_l_PU1firfrklB_A6DfJIsbv2', 'response' => $_REQUEST['g-recaptcha-response'], ) ), ), ); $stream = stream_context_create($opts); $captcha = @json_decode(file_get_contents('https://www.google.com/recaptcha/api/siteverify', false, $stream), true); if (empty($captcha) || empty($captcha['success']) || !$captcha['success']){ sleep(25); die('not human'.PHP_EOL.print_r($captcha,1)); } } require(dirname(__FILE__).'/config/config.inc.php'); Dispatcher::getInstance()->dispatch(); Et voici le script en tête du contactform.tpl ; à savoir que le formulaire contient bien la classe "contact-form-box: <script> var googlecaptchasitekey = '6Lc6y4MUAAAAAL6leQ3JZT9WnbwV8xquIMkmea1f'; /* TODO: tune this https://www.google.com/recaptcha/admin */ $(document).ready(function(){ var $forms = $('form.contact-form-box'); if ($forms.length > 0){ var captcha = $('<div class="g-recaptcha" data-sitekey="'6Lc6y4MUAAAAAL6leQ3JZT9WnbwV8xquIMkmea1f'">'); var $submit = $forms.find('#submitMessage'); $submit.before(captcha); $submit.click(function(event){ if ($forms.find('#g-recaptcha-response').val().length == 0) { event.preventDefault(); event.stopPropagation(); return false; } }); } }); </script> <script src='https://www.google.com/recaptcha/api.js?hl={$language_code}'></script> Link to comment Share on other sites More sharing options...
doekia Posted December 25, 2018 Share Posted December 25, 2018 Ce qu'il y a de bien avec ta réponse de gros bourrin, c'est que maintenant ta paire de clé est grillée. Même si tu as tout bien fait, tu n'a plus qua en régénérer une nouvelle paire car elle ne servent plus à rien. Je me demande ce que tu n'a pas compris dans le concept de clé. Si tout le monde a une copie de tes clés, la serrure n'a plus aucun intérêt 1 Link to comment Share on other sites More sharing options...
amerigeau Posted January 2, 2019 Share Posted January 2, 2019 Bonjour à tous, J'ai écrit un article avec le tuto de la solution : https://www.arnaud-merigeau.fr/bonne-annee-sans-spams-russes-prestashop/ ++ Link to comment Share on other sites More sharing options...
Eolia Posted January 2, 2019 Share Posted January 2, 2019 C'est pas cool Arnaud de piquer les tutos des autres et mettre son nom dedans^^ Le tuto de base est ici: https://shop.devcustom.net/fr/content/9-mise-en-place-captcha?content_only=1 et le copyright appartient à @doekia 2 Link to comment Share on other sites More sharing options...
amerigeau Posted January 2, 2019 Share Posted January 2, 2019 5 minutes ago, Eolia said: C'est pas cool Arnaud de piquer les tutos des autres et mettre son nom dedans^^ Le tuto de base est ici: https://shop.devcustom.net/fr/content/9-mise-en-place-captcha?content_only=1 et le copyright appartient à @doekia ah beh merci de me donner le lien car je n'avais vu que le snippet qui ne donnait pas bcp d'info dommage que le tuto ne soit pas bien référencé car sinon je n'aurais pas poster sans crédit.. bref, j'ai ajouté le crédit de @doekia dans l'article, c'est normal maintenant que je suis au courant 1 Link to comment Share on other sites More sharing options...
doekia Posted January 3, 2019 Share Posted January 3, 2019 (edited) N'oublions pas non plus de remercier @Eolia , car là je suis un cuistre que n'a pas de pédagogie et il a fait une super tutos pour pour permettre à tout le monde d'implanter sans peine ce code. Son tutos permet a tous de comprendre comment intégrer le code. Merci de m'avoir crédité car, ayant vu tant et tant de clone de "guru" m'ayant copié, à force, ça lasse. Pensez a regarder ici: http://area51.enter-solutions.com/snippets D'autres "tips" sont là pour vous sauver Pense également a consulter/créditer ces pages afin de solutionner vos problèmes récurrents: https://aide.prestashop.click/category/5/bug-connus Edited January 3, 2019 by doekia (see edit history) Link to comment Share on other sites More sharing options...
doekia Posted January 3, 2019 Share Posted January 3, 2019 et pourquoi bande de de bashibouzouk le reply précédent est "hidden" ? Vraiment ce forum commence à me les briser sévère Link to comment Share on other sites More sharing options...
endriu107 Posted January 3, 2019 Share Posted January 3, 2019 Spam filter marked it automatically as hidden. Link to comment Share on other sites More sharing options...
doekia Posted January 3, 2019 Share Posted January 3, 2019 @endriu107 Why such? Things I foud really annoying is that those reply trigger the filter but sex enlargment pills spam does not. What a filter! 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