1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
|
<head>
<script>
require(["require.config"], function() {
require(["pages/enterprise"])
});
</script>
<link href="<?php echo get_template_directory_uri(); ?>/assets/css/pages/form.css?v=2" rel="stylesheet">
</head>
<section class="background generic-background second-menu">
<div class="container">
<div class="row">
<div class="col-md-6 topheader">
<h1><?php echo $l->t('Nextcloud Enterprise Quote');?></h1>
</div>
</div>
</div>
<div class="container-fluid menu" id="menuAnchor">
<div class="container buttons">
<a class="button button--blue" href="<?php echo home_url('faq') ?>"><?php echo $l->t('FAQ');?></a>
<a class="button button--blue" href="<?php echo home_url('enterprise/order') ?>"><?php echo $l->t('Order online');?></a>
<a class="button button--blue" href="<?php echo home_url('buy') ?>"><?php echo $l->t('get a quote');?></a>
<a class="button button--blue" href="<?php echo home_url('trial') ?>"><?php echo $l->t('Trial');?></a>
<a class="button button--blue" href="<?php echo home_url('pricing') ?>"><?php echo $l->t('pricing plans');?></a>
<a class="button button--blue" href="<?php echo home_url('enterprise') ?>"><?php echo $l->t('enterprise offering');?></a>
</div>
</div>
</section>
<section class="section--links">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="text-center">
<a class="button button--white button--small" href="<?php echo home_url('faq') ?>"><?php echo $l->t('FAQ');?></a>
<a class="button button--white button--small" href="<?php echo home_url('enterprise/order') ?>"><?php echo $l->t('Order online');?></a>
<a class="button button--white button--small" href="<?php echo home_url('trial') ?>"><?php echo $l->t('Trial');?></a>
<a class="button button--white button--small" href="<?php echo home_url('buy') ?>"><?php echo $l->t('get a quote');?></a>
<a class="button button--white button--small" href="<?php echo home_url('pricing') ?>"><?php echo $l->t('pricing plans');?></a>
<a class="button button--white button--small" href="<?php echo home_url('enterprise') ?>"><?php echo $l->t('enterprise offering');?></a>
</div>
</div>
</div>
</div>
</section>
<?php
require_once realpath(dirname(__FILE__)) . '/lib/ratelimiter.php';
require_once realpath(dirname(__FILE__)) . '/lib/captcha.php';
if(!canPerformLimitedAction("sales-submit-action", 5)) {
die("Too many requests. Please try again later.");
}
if(isset($_POST['email'])) {
function died($error) {
// error code goes here
?>
<section class="section--whitepaper">
<div class="container text-center">
<h3>Sorry, there was an error with the form you submitted</h3>
<p>Did you fill in all mandatory fields?<br />
The error(s) detected include:<br/>
<?php
echo $error . "<br />";
?>
</p>
<p>Use the back key to go to the previous page and fix the
issue!</p>
</div>
</section>
<?php
}
$error_message = "";
// validation expected data exists
if(!isset($_POST['yourname']) ||
!isset($_POST['email']) ||
!isset($_POST['organization']) ||
!isset($_POST['phone']) ||
!isset($_POST['users']) ||
!isset($_POST['comments'])) {
$error_message .= 'Did you fill in all the fields?'; }
$yourname = $_POST['yourname']; // required
$organization= $_POST['organization']; // required
$phone = $_POST['phone']; // required
$email_from = $_POST['email']; // required
$users = $_POST['users']; // required
$comments = $_POST['comments']; // required
$collabora = $_POST['collabora'];
$outlook = $_POST['outlook'];
$needsetuphelp = $_POST['need-setup-help'];
$webconferencing = $_POST['webconferencing'];
$gdprcheck = $_POST['gdprcheck'];
$SLA = $_POST['SLA'];
$email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,10}$/';
$foundnextcloud = $_POST['foundnextcloud'];
if(!IsValidCaptcha($_POST['captcha'])) {
$error_message .= 'The captcha result you entered does not appear to be correct.<br />';
}
if(!preg_match($email_exp,$email_from)) {
$error_message .= 'The email address you entered does not appear to be valid.<br />';
}
$string_exp = "/^[A-Za-z .'-]+$/";
// remove checking name
// if(!preg_match($string_exp,$yourname)) {
// $error_message .= 'The name you entered does not appear to be valid.<br />';
// }
if(!($gdprcheck=="gdprchecked")) {
$error_message .= 'You did not agree with our privacy policy so we would not be allowed to read and reply to your inquiry.<br />';
}
$string_exp = "/^((\+|00)\d{1,3})?(\d+|\s+)+\d$/";
// if(!preg_match($string_exp,$phone)) {
// $error_message .= 'The phone number you entered does not appear to be valid, did you add a country code like +49?<br />';
// }
if(strlen($error_message) > 0) {
died($error_message);
} else {
function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
$string = str_replace($bad,"",$string);
return htmlspecialchars($string);
}
// the app review mailing list address
$email_message = "Quote request form details below.\n\n";
$email_to = "sales@nextcloud.com";
// $email_to = "jos@nextcloud.com";
$email_subject = "Nextcloud Enterprise Subscription: ".clean_string($organization);
$email_message .= "Name: ".clean_string($yourname)."\n";
$email_message .= "Email: ".clean_string($email_from)."\n";
$email_message .= "Phone number: ".clean_string($phone)."\n";
$email_message .= "Organization: ".clean_string($organization)."\n";
$email_message .= "How many users do you expect in 12 months? ".clean_string($users)."\n";
$email_message .= "What SLA is needed? ".clean_string($SLA)."\n";
$email_message .= "Would you require assistance to set up the service or to design/review the architecture? ".clean_string($needsetuphelp)."\n";
$email_message .= "Would you be interested in editing office documents online? ".clean_string($collabora)."\n";
$email_message .= "Would you be interested in secure webconferencing and audio and video calls? ".clean_string($webconferencing)."\n";
$email_message .= "Would you be interested in our Secure Sharing add-in for Outlook? ".clean_string($outlook)."\n";
$email_message .= "How did you find out about Nextcloud? ".clean_string($foundnextcloud)."\n";
$email_message .= "Comments: ".clean_string($comments)."\n";
// create email headers
$headers = 'From: no-reply@nextcloud.com'."\r\n".
'Reply-To: '.$email_from."\r\n" .
'Content-Type: text/plain; charset=UTF-8'."\r\n" .
'Cc: '.$email_from;
// store in log
$data = [
'to' => $email_to,
'subject' => $email_subject,
'message' => $email_message,
'headers' => $headers,
];
file_put_contents('/var/log/sales-leads.txt', json_encode($data) . PHP_EOL, FILE_APPEND | LOCK_EX);
// Send the email to the list
@mail($email_to, $email_subject, $email_message, $headers);
// Second email to subscribe to the mailing list
// @mail("frank@nextcloud.org", "website form", "website form", $headers);
?>
<!-- success html here -->
<section class="section--whitepaper">
<div class="container text-center">
<div class="row">
<div class="col-md-8">
<h3 class="text-center">Thank you for contacting us</h3>
<p class="text-center">We received your message and will contact you on <?php echo($email_from); ?>,</p>
<p class="text-center">check your inbox for a reply in the next 2-3 working days.</p>
</div>
</div>
</div>
</section>
<?php
}
}
?>
|