From 91fa18f78c6a57be335e919539b712f2de8e4684 Mon Sep 17 00:00:00 2001 From: leosw Date: Mon, 22 Oct 2018 23:33:27 +0200 Subject: [PATCH] Fix contact form --- controllers/d.contact.php | 20 ++++++++++---------- views/d.contact.html | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/controllers/d.contact.php b/controllers/d.contact.php index 2fb16dc..fdaaae8 100755 --- a/controllers/d.contact.php +++ b/controllers/d.contact.php @@ -11,8 +11,8 @@ if(isset($_POST['submit'])) { $message .= "
\r\n"; $message .= "
".strip_tags(post('message'))."

\r\n"; - $headers = 'From: '. post('mail') . "\r\n" . - 'Reply-To: '. post('mail') . "\r\n" . + $headers = 'From: '. post('email') . "\r\n" . + 'Reply-To: '. post('email') . "\r\n" . 'X-Mailer: PHP/' . phpversion() . "\r\n" . 'MIME-Version: 1.0' . "\r\n" . 'Content-type: text/html; charset=UTF-8' . "\r\n"; @@ -27,8 +27,8 @@ if(isset($_POST['submit'])) { $error = "subject"; $send = false; } - if(post('mail') == '') { - $error = "mail"; + if(post('email') == '') { + $error = "email"; $send = false; } if(post('message') == '') { @@ -50,17 +50,17 @@ if(isset($_POST['submit'])) { if(post('name') != '') $contact['name'] = post('name'); -else if($user->role > 0) +else if($user->rankIsHigher("registered")) $contact['name'] = $user->name; else $contact['name'] = ''; -if(post('mail') != '') - $contact['mail'] = post('mail'); -else if($user->role > 0) - $contact['mail'] = $user->mail; +if(post('email') != '') + $contact['email'] = post('email'); +else if($user->rankIsHigher("registered")) + $contact['email'] = $user->email; else - $contact['mail'] = ''; + $contact['email'] = ''; $contact['subject'] = post('subject'); $contact['message'] = post('message'); diff --git a/views/d.contact.html b/views/d.contact.html index 3b46d78..a2b31cc 100755 --- a/views/d.contact.html +++ b/views/d.contact.html @@ -16,7 +16,7 @@

Veuillez renseigner un sujet.

- +

Veuillez renseigner une adresse mail.

@@ -33,10 +33,10 @@

Message bien envoyé.

- + - role >= 200) { ?> + rankIsHigher("registered")) { ?>