typhoon Posted February 25, 2018 Share Posted February 25, 2018 (edited) Bonjour, 1&1 m'a envoyé hier un mail me disant que ce fichier avait été utilisé pour expédier des mails. Ils ont bloqué du coup le fichier du coup les clients ne peuvent plus envoyer de mails vi Edited February 26, 2018 by typhoon (see edit history) Link to comment Share on other sites More sharing options...
Eolia Posted February 25, 2018 Share Posted February 25, 2018 - Commencez par aller là et créez les clés pour votre domaine: https://www.google.com/recaptcha/admin - Saisissez votre nom de domaine seul (pas de www ou http://, juste le domaine) - dans le fichier /controllers/ContactController.php, copiez ce code (remplacez l'existant) en mettant votre clé SECRETE à la place de XXXXXXX-the-secret-key-XXXXXXXXXX et en conservant les guillemets simples): <?php /* * 2007-2011 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-2011 PrestaShop SA * @version Release: $Revision: 7197 $ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ if (isset($_POST['submitMessage']) || isset($_GET['submitMessage'])){ if (empty($_REQUEST['g-recaptcha-response'])){ sleep(25); die('Bad request...'); } $opts = array('http' => array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => http_build_query( array( 'secret' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', '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['success'])){ if(isset($_SERVER['HTTP_REFERER'])) { sleep(5); die('<p>Captcha Invalide</p><button><a href='.$_SERVER['HTTP_REFERER'].'>Retour au formulaire</a></button>'); } sleep(25); die('Hello Bot! How are you ?'); } } // Code existant à suivre class ContactControllerCore extends FrontController { Dans le header.tpl de votre thème vous copiez ce code en début de fichier avant la fermeture de la balise </head>, en mettant votre clé PUBLIQUE à la place de XXXXXXX-the-public-key-XXXXXXXXXX et en conservant les guillemets simples): <script> var googlecaptchasitekey = '6Lc2REgUAAAAAIpoSrM4GQBfFzlvZn_BzkM8e8GL'; $(document).ready(function(){ var $forms = $('form.contact-form-box'); if ($forms.length > 0){ var captcha = $('<div class="g-recaptcha" data-sitekey="'+ googlecaptchasitekey + '">'); 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; } else $submit.fadeOut('slow'); }); } }); </script> <script src='https://www.google.com/recaptcha/api.js?hl={$language_code}'></script> Vérifiez que votre formulaire <form> a bien la classe "contact-form-box" dans /themes/botre_theme/contact-form.tpl sinon ajoutez-là (Souvent en 1.4 il n'y a que la classe "std" sur ce formulaire.) 1 Link to comment Share on other sites More sharing options...
typhoon Posted February 25, 2018 Author Share Posted February 25, 2018 (edited) merci pour les infos, pour le modif de contactcontroller.php, ce code est bien à rajouter? je ne remplace pas tout le fichier par ce que vous me mettez là car il me semble que ça ne concerne que le captcha non? Et pour contact-form-box ? il faut juste changer " std " par " std contact-form-box " ? Merci! Edited February 25, 2018 by typhoon (see edit history) Link to comment Share on other sites More sharing options...
typhoon Posted February 25, 2018 Author Share Posted February 25, 2018 et pour l'instant j'ai toujours Access Denied en FO quand j'essaye d'accéder à la page de contact :-/ Link to comment Share on other sites More sharing options...
Eolia Posted February 25, 2018 Share Posted February 25, 2018 Il y a 1 heure, typhoon a dit : merci pour les infos, pour le modif de contactcontroller.php, ce code est bien à rajouter? je ne remplace pas tout le fichier par ce que vous me mettez là car il me semble que ça ne concerne que le captcha non? Et pour contact-form-box ? il faut juste changer " std " par " std contact-form-box " ? Merci! Je pensais avoir été assez clair... Ce code est à RAJOUTER, je vous ai même mis la ligne existante du début de ce qui suit. Et oui pour std contact-form-box Link to comment Share on other sites More sharing options...
Eolia Posted February 25, 2018 Share Posted February 25, 2018 il y a une heure, typhoon a dit : et pour l'instant j'ai toujours Access Denied en FO quand j'essaye d'accéder à la page de contact :-/ Avez-vous prévenu votre hébergeur que vous aviez effectué les modifications requises pour sécuriser le fichier ? Link to comment Share on other sites More sharing options...
typhoon Posted February 25, 2018 Author Share Posted February 25, 2018 il y a 8 minutes, Eolia a dit : Je pensais avoir été assez clair... Ce code est à RAJOUTER, je vous ai même mis la ligne existante du début de ce qui suit. Et oui pour std contact-form-box Désolée, j'ai eu un doute comme vous mettiez qu'il fallait remplacer le code existant, je préférais être sure plutot que de faire une betise ;-) Merci pour la précision Link to comment Share on other sites More sharing options...
typhoon Posted February 25, 2018 Author Share Posted February 25, 2018 il y a 9 minutes, Eolia a dit : Avez-vous prévenu votre hébergeur que vous aviez effectué les modifications requises pour sécuriser le fichier ? Ils m'ont indiqué qu'il fallait simplement modifier les droits du fichier par "604", ce que j'ai fait dans fillezilla, enfin je pense? Link to comment Share on other sites More sharing options...
Eolia Posted February 25, 2018 Share Posted February 25, 2018 Généralement c'est 755 pour les répertoires et 644 pour les fichiers Mais il faut être sûr qu'ils n'aient pas mis un blocage plus haut. Quels étaient les droits avant que vous ne les passiez à 604 ? Link to comment Share on other sites More sharing options...
typhoon Posted February 26, 2018 Author Share Posted February 26, 2018 Il y a 14 heures, Eolia a dit : Généralement c'est 755 pour les répertoires et 644 pour les fichiers Mais il faut être sûr qu'ils n'aient pas mis un blocage plus haut. Quels étaient les droits avant que vous ne les passiez à 604 ? Je n'ai pas fait attention avant de recharger le fichier, mais c'était 644 sinon. Je vais appeler 1&1; Merci en tout cas pour l'aide! Link to comment Share on other sites More sharing options...
typhoon Posted February 26, 2018 Author Share Posted February 26, 2018 bon c'est bon il n'y a plus de blocage au niveau de 1&1, par contre j'ai une page blanche https://www.selleriebucephale.com/contact il y a donc un soucis au niveau du code? il n'y avait rien à modifier dans le fichier contact-form.php lui-même? Link to comment Share on other sites More sharing options...
Eolia Posted February 26, 2018 Share Posted February 26, 2018 il doit y avoir une coquille de code quelque part... Envoyez-nous les 2 fichiers (tpl et php) que l'on regarde ça 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