jekyll-theme-consulting 0.9.10 → 0.10.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_includes/contact.html +1 -1
- data/_includes/{contact_script.html → contact_client_script.html} +1 -1
- data/_layouts/contact.html +89 -0
- data/_sass/libs/_vars.scss +2 -2
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0267749ef77dd82f236dd948e2aa7414eeda519ca5c13f54546e06d9933681be'
|
4
|
+
data.tar.gz: b84c63d4fef729187874985609a8866131caa3d927fdfdb97677c68f2f5c965c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 376739a8d52226d30c647ffe07b3343fb813047493a37c7150ac8c20e5212bcc99282820dc97b01ce701545af31c59e587bb9feca106e76f167219af08f3fd56
|
7
|
+
data.tar.gz: 1afd669eb76697a58b947c15a69b2e433600cd1fa088337850fd6cbddac90f841f5bdcfe54bd71c7e4e9673142cd469f2d84ce14aec4e9041fb04883979055de
|
data/_includes/contact.html
CHANGED
@@ -27,4 +27,4 @@
|
|
27
27
|
</div>
|
28
28
|
</section>
|
29
29
|
|
30
|
-
{% include
|
30
|
+
{% include contact_client_script.html form_id=form_id name_input_id=name_input_id email_input_id=email_input_id message_input_id=message_input_id submit_input_id=submit_input_id reset_input_id=reset_input_id recaptcha_widget_id=recaptcha_widget_id onsubmit_callback=onsubmit_callback onreset_callback=onreset_callback onfocusout_callback=onfocusout_callback %}
|
@@ -0,0 +1,89 @@
|
|
1
|
+
---
|
2
|
+
permalink: /contact.php
|
3
|
+
mail:
|
4
|
+
subject:
|
5
|
+
intro:
|
6
|
+
---
|
7
|
+
{%- capture mail-intro -%}You received a message on <a href="{{ site.url }}">your website</a>.{%- endcapture -%}
|
8
|
+
<?php
|
9
|
+
|
10
|
+
$contact_name = $contact_email = $contact_message = $token = $contact_ip = "";
|
11
|
+
|
12
|
+
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
13
|
+
if (has_required_data($_POST)) {
|
14
|
+
$contact_name = filter_var(
|
15
|
+
$_POST["name"],
|
16
|
+
FILTER_SANITIZE_FULL_SPECIAL_CHARS);
|
17
|
+
$contact_email = filter_var(
|
18
|
+
$_POST["email"],
|
19
|
+
FILTER_SANITIZE_EMAIL);
|
20
|
+
$contact_message = filter_var(
|
21
|
+
$_POST["message"],
|
22
|
+
FILTER_SANITIZE_FULL_SPECIAL_CHARS);
|
23
|
+
$token = filter_var(
|
24
|
+
$_POST["token"],
|
25
|
+
FILTER_SANITIZE_URL);
|
26
|
+
if (filter_var(
|
27
|
+
$_SERVER['REMOTE_ADDR'],
|
28
|
+
FILTER_VALIDATE_IP)) {
|
29
|
+
$contact_ip = $_SERVER['REMOTE_ADDR'];
|
30
|
+
}
|
31
|
+
|
32
|
+
if (is_recaptcha_valid($token)) {
|
33
|
+
send_mail($contact_name, $contact_email, $contact_message, $contact_ip);
|
34
|
+
} else {
|
35
|
+
send_mail($contact_name, $contact_email, "Tried to contact you, but his recaptcha is not valid.", $contact_ip);
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}
|
39
|
+
|
40
|
+
function has_required_data($request) {
|
41
|
+
return (
|
42
|
+
(
|
43
|
+
isset($request['name'])
|
44
|
+
&& isset($request['email'])
|
45
|
+
&& isset($request['message'])
|
46
|
+
&& isset($request['token']))
|
47
|
+
&& (
|
48
|
+
!empty($request['name'])
|
49
|
+
&& !empty($request['email'])
|
50
|
+
&& !empty($request['message'])
|
51
|
+
&& !empty($request['token'])));
|
52
|
+
}
|
53
|
+
|
54
|
+
function is_recaptcha_valid($token) {
|
55
|
+
$validation_url = "https://www.google.com/recaptcha/api/siteverify";
|
56
|
+
$data = array('secret' => '{{ site.recaptcha.secretkey }}', 'response' => $token);
|
57
|
+
$options = array(
|
58
|
+
'http' => array(
|
59
|
+
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
|
60
|
+
'method' => 'POST',
|
61
|
+
'content' => http_build_query($data)));
|
62
|
+
$context = stream_context_create($options);
|
63
|
+
$result = json_decode(file_get_contents($validation_url, false, $context));
|
64
|
+
|
65
|
+
return (
|
66
|
+
($result !== FALSE)
|
67
|
+
&& isset($result->success)
|
68
|
+
&& $result->success);
|
69
|
+
}
|
70
|
+
|
71
|
+
function send_mail ($name, $email, $message, $ip) {
|
72
|
+
return mail(
|
73
|
+
"{{ site.email }}",
|
74
|
+
"{{ page.mail.subject | default: 'Contact request' }}",
|
75
|
+
(
|
76
|
+
"{{ page.mail.intro | default: mail-intro }}<br>\r\n"
|
77
|
+
."Ip: ".$ip."<br>\r\n"
|
78
|
+
."Name: ".$name."<br>\r\n"
|
79
|
+
."Email: ".$email."<br>\r\n"
|
80
|
+
."Message: ".$message."<br>\r\n"),
|
81
|
+
(
|
82
|
+
"From: ".$name
|
83
|
+
." <".$email.">\r\n"
|
84
|
+
."MIME-Version: 1.0\r\n"
|
85
|
+
."Content-type: text/html\r\n"));
|
86
|
+
}
|
87
|
+
|
88
|
+
?>
|
89
|
+
|
data/_sass/libs/_vars.scss
CHANGED
@@ -27,7 +27,7 @@ $font: (
|
|
27
27
|
family-heading: ('Roboto Slab', serif),
|
28
28
|
family-fixed: ('Courier New', monospace),
|
29
29
|
weight: 400,
|
30
|
-
weight-bold:
|
30
|
+
weight-bold: 900,
|
31
31
|
weight-heading: 700,
|
32
32
|
weight-heading-alt: 400,
|
33
33
|
kerning-heading: 0.075em
|
@@ -40,7 +40,7 @@ $palette: (
|
|
40
40
|
bg-inverted: #6666ff,
|
41
41
|
bg-alt-inverted: #223344,
|
42
42
|
fg: #000000,
|
43
|
-
fg-bold: #
|
43
|
+
fg-bold: #000000,
|
44
44
|
fg-light: #9fa3a6,
|
45
45
|
fg-inverted: #ffffff,
|
46
46
|
fg-bold-inverted: #ffffff,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-theme-consulting
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Moodule
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08-
|
11
|
+
date: 2020-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -77,8 +77,8 @@ files:
|
|
77
77
|
- README.md
|
78
78
|
- _includes/banner.html
|
79
79
|
- _includes/contact.html
|
80
|
+
- _includes/contact_client_script.html
|
80
81
|
- _includes/contact_form.html
|
81
|
-
- _includes/contact_script.html
|
82
82
|
- _includes/date.html
|
83
83
|
- _includes/fact.html
|
84
84
|
- _includes/feature.html
|
@@ -98,6 +98,7 @@ files:
|
|
98
98
|
- _includes/toggle.html
|
99
99
|
- _includes/waves/bottom.html
|
100
100
|
- _includes/waves/top.html
|
101
|
+
- _layouts/contact.html
|
101
102
|
- _layouts/default.html
|
102
103
|
- _layouts/home.html
|
103
104
|
- _layouts/index.html
|