From 31ce1742e5f4137878ce931c3b5ad3da726a62df Mon Sep 17 00:00:00 2001 From: INOPIAE Date: Sat, 8 Dec 2012 06:49:43 +0100 Subject: bug 795: Changed contact form to just one form with two different send buttons and added a hidden field robotest for honeypot. in styles/default.css a new style ".robotic" is added for the robotest --- www/index.php | 43 ++++++++++++++++++++++++------------------- www/styles/default.css | 4 ++++ 2 files changed, 28 insertions(+), 19 deletions(-) (limited to 'www') diff --git a/www/index.php b/www/index.php index 41b6d7a..4d2e774 100644 --- a/www/index.php +++ b/www/index.php @@ -563,7 +563,14 @@ require_once('../includes/lib/l10n.php'); $subject = stripslashes($_REQUEST['subject']); $message = stripslashes($_REQUEST['message']); $secrethash = $_REQUEST['secrethash2']; - + $robotest = $_REQUEST['robotest']; + + //check for spam via honeypot + if ($robotest!=""){ + + + } + if($_SESSION['_config']['secrethash'] != $secrethash || $secrethash == "" || $_SESSION['_config']['secrethash'] == "") { $id = $oldid; @@ -603,26 +610,24 @@ require_once('../includes/lib/l10n.php'); } } - if($oldid == 11 && $process != "" && $_REQUEST['support'] != "yes") - { - $message = "From: $who\nEmail: $email\nSubject: $subject\n\nMessage:\n".$message; - - sendmail("support@cacert.org", "[CAcert.org] ".$subject, $message, $email, "", "", "CAcert Support"); - showheader(_("Welcome to CAcert.org")); - echo _("Your message has been sent."); - showfooter(); - exit; - } - - if($oldid == 11 && $process != "" && $_REQUEST['support'] == "yes") + if($oldid == 11 && $process != "") { $message = "From: $who\nEmail: $email\nSubject: $subject\n\nMessage:\n".$message; - - sendmail("cacert-support@lists.cacert.org", "[website form email]: ".$subject, $message, "website-form@cacert.org", "cacert-support@lists.cacert.org, $email", "", "CAcert-Website"); - showheader(_("Welcome to CAcert.org")); - echo _("Your message has been sent to the general support list."); - showfooter(); - exit; + if (isset($process[0])){ + $message = "From: $who\nEmail: $email\nSubject: $subject\n\nMessage:\n".$message; + sendmail("cacert-support@lists.cacert.org", "[website form email]: ".$subject, $message, "website-form@cacert.org", "cacert-support@lists.cacert.org, $email", "", "CAcert-Website"); + showheader(_("Welcome to CAcert.org")); + echo _("Your message has been sent to the general support list."); + showfooter(); + exit; + } + if (isset($process[1])){ + sendmail("support@cacert.org", "[CAcert.org] ".$subject, $message, $email, "", "", "CAcert Support"); + showheader(_("Welcome to CAcert.org")); + echo _("Your message has been sent."); + showfooter(); + exit; + } } if(!array_key_exists('signup',$_SESSION) || $_SESSION['signup']['year'] < 1900) diff --git a/www/styles/default.css b/www/styles/default.css index 9fdd85c..c97e429 100644 --- a/www/styles/default.css +++ b/www/styles/default.css @@ -651,3 +651,7 @@ div.footerbar { padding: 10px 10px 10px 10px; } +/************ Honeypot ***********/ + +.robotic { display: none; } + -- cgit v1.2.1 From 002a2f126180ca96a3cd1365306747b0b6a55108 Mon Sep 17 00:00:00 2001 From: INOPIAE Date: Mon, 10 Dec 2012 21:27:36 +0100 Subject: bug 795: correted robotest if functionality --- www/index.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'www') diff --git a/www/index.php b/www/index.php index 4d2e774..4d45473 100644 --- a/www/index.php +++ b/www/index.php @@ -563,14 +563,15 @@ require_once('../includes/lib/l10n.php'); $subject = stripslashes($_REQUEST['subject']); $message = stripslashes($_REQUEST['message']); $secrethash = $_REQUEST['secrethash2']; - $robotest = $_REQUEST['robotest']; - + //check for spam via honeypot + if(!isset($_REQUEST['robotest']) || !empty($_REQUEST['robotest'])) //check for spam via honeypot if ($robotest!=""){ - - + echo _("Form could not be send."); + showfooter(); + exit; } - + if($_SESSION['_config']['secrethash'] != $secrethash || $secrethash == "" || $_SESSION['_config']['secrethash'] == "") { $id = $oldid; -- cgit v1.2.1 From ad569591b69fdcd886712d6a53218e23fc539089 Mon Sep 17 00:00:00 2001 From: INOPIAE Date: Mon, 10 Dec 2012 21:32:29 +0100 Subject: bug 795: correct copy paste error --- www/index.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'www') diff --git a/www/index.php b/www/index.php index 4d45473..f203d61 100644 --- a/www/index.php +++ b/www/index.php @@ -563,10 +563,9 @@ require_once('../includes/lib/l10n.php'); $subject = stripslashes($_REQUEST['subject']); $message = stripslashes($_REQUEST['message']); $secrethash = $_REQUEST['secrethash2']; + //check for spam via honeypot - if(!isset($_REQUEST['robotest']) || !empty($_REQUEST['robotest'])) - //check for spam via honeypot - if ($robotest!=""){ + if(!isset($_REQUEST['robotest']) || !empty($_REQUEST['robotest'])){ echo _("Form could not be send."); showfooter(); exit; -- cgit v1.2.1 From 416d776e7243a942b21151cc503ab44830dec6ca Mon Sep 17 00:00:00 2001 From: INOPIAE Date: Wed, 12 Dec 2012 00:29:01 +0100 Subject: bug 792:layout in forms, code in www/account.php --- www/account.php | 43 ++++++++++++++++++++++--------------------- www/index.php | 1 - 2 files changed, 22 insertions(+), 22 deletions(-) (limited to 'www') diff --git a/www/account.php b/www/account.php index 0b32c2c..3f115e0 100644 --- a/www/account.php +++ b/www/account.php @@ -25,34 +25,35 @@ } else if($id == 19) { include_once("../pages/account/19.php"); exit; - } else if($oldid == 40 && $_REQUEST['process'] != "" && $_POST['support'] != "yes") { - $who = stripslashes($_REQUEST['who']); - $email = stripslashes($_REQUEST['email']); - $subject = stripslashes($_REQUEST['subject']); - $message = stripslashes($_REQUEST['message']); - - $message = "From: $who\nEmail: $email\nSubject: $subject\n\nMessage:\n".$message; - - sendmail("support@cacert.org", "[CAcert.org] ".$subject, $message, $email, $email, "", "CAcert Website"); - showheader(_("Welcome to CAcert.org")); - echo _("Your message has been sent."); - showfooter(); - exit; - } else if($oldid == 40 && $_REQUEST['process'] != "" && $_POST['support'] == "yes") { + } else if($oldid == 40 && $_REQUEST['process'] != "") { $who = stripslashes($_REQUEST['who']); $email = stripslashes($_REQUEST['email']); $subject = stripslashes($_REQUEST['subject']); $message = stripslashes($_REQUEST['message']); + //check for spam via honeypot + if(!isset($_REQUEST['robotest']) || !empty($_REQUEST['robotest'])){ + echo _("Form could not be send."); + showfooter(); + exit; + } - $message = "From: $who\nEmail: $email\nSubject: $subject\n\nMessage:\n".$message; + $message = "From: $who\nEmail: $email\nSubject: $subject\n\nMessage:\n".$message; + if (isset($process[0])){ + sendmail("cacert-support@lists.cacert.org", "[website form email]: ".$subject, $message, "website-form@cacert.org", "cacert-support@lists.cacert.org, $email", "", "CAcert-Website"); + showheader(_("Welcome to CAcert.org")); + echo _("Your message has been sent to the general support list."); + showfooter(); + exit; + } + if (isset($process[1])){ + sendmail("support@cacert.org", "[CAcert.org] ".$subject, $message, $email, "", "", "CAcert Support"); + showheader(_("Welcome to CAcert.org")); + echo _("Your message has been sent."); + showfooter(); + exit; + } - sendmail("cacert-support@lists.cacert.org", "[website form email]: ".$subject, $message, "website-form@cacert.org", "cacert-support@lists.cacert.org, $email", "", "CAcert Website"); - - showheader(_("Welcome to CAcert.org")); - echo _("Your message has been sent to the general support list."); - showfooter(); - exit; } else if($id == 51 && $_GET['img'] == "show") { $query = "select * from `tverify` where `id`='".intval($_GET['photoid'])."' and `modified`=0"; $res = mysql_query($query); diff --git a/www/index.php b/www/index.php index f203d61..3cddb47 100644 --- a/www/index.php +++ b/www/index.php @@ -614,7 +614,6 @@ require_once('../includes/lib/l10n.php'); { $message = "From: $who\nEmail: $email\nSubject: $subject\n\nMessage:\n".$message; if (isset($process[0])){ - $message = "From: $who\nEmail: $email\nSubject: $subject\n\nMessage:\n".$message; sendmail("cacert-support@lists.cacert.org", "[website form email]: ".$subject, $message, "website-form@cacert.org", "cacert-support@lists.cacert.org, $email", "", "CAcert-Website"); showheader(_("Welcome to CAcert.org")); echo _("Your message has been sent to the general support list."); -- cgit v1.2.1 From 2b28585e5f4f56f4766ac144d3470273893a457e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernhard=20Fr=C3=B6hlich?= Date: Thu, 3 Jan 2013 23:04:13 +0100 Subject: Typos... --- www/account.php | 2 +- www/index.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'www') diff --git a/www/account.php b/www/account.php index 3f115e0..c7f34a3 100644 --- a/www/account.php +++ b/www/account.php @@ -33,7 +33,7 @@ //check for spam via honeypot if(!isset($_REQUEST['robotest']) || !empty($_REQUEST['robotest'])){ - echo _("Form could not be send."); + echo _("Form could not be sent."); showfooter(); exit; } diff --git a/www/index.php b/www/index.php index 3cddb47..35d22d7 100644 --- a/www/index.php +++ b/www/index.php @@ -566,7 +566,7 @@ require_once('../includes/lib/l10n.php'); //check for spam via honeypot if(!isset($_REQUEST['robotest']) || !empty($_REQUEST['robotest'])){ - echo _("Form could not be send."); + echo _("Form could not be sent."); showfooter(); exit; } -- cgit v1.2.1