-
Notifications
You must be signed in to change notification settings - Fork 4
/
join.php
189 lines (161 loc) · 7.06 KB
/
join.php
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
180
181
182
183
184
185
186
187
188
189
<?php
/*
Copyright 2020 FWBer.com
This file is part of FWBer.
FWBer is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
FWBer is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero Public License for more details.
You should have received a copy of the GNU Affero Public License
along with FWBer. If not, see <https://www.gnu.org/licenses/>.
*/
session_start();
//force https
if (empty($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] !== "on") {
header("Location: https://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);
exit();
}
//check cookie, see if user is logged in. if not, tell them to register.
if (
(isset($_COOKIE["email"]) && $_COOKIE["email"] != null && strlen($_COOKIE["email"]) > 0)
||
(isset($_SESSION["email"]) && $_SESSION["email"] != null && strlen($_SESSION["email"]) > 0)
)
{
require_once("_names.php");
header('Location: '.getSiteURL().'/matches');
exit();
}
?>
<!doctype html>
<html lang="en">
<head>
<title><?php require_once("_names.php");echo getSiteName(); ?><?php require_once("_names.php");echo getTitleTagline(); ?></title>
<?php include("head.php"); ?>
</head>
<body class="d-flex flex-column h-100">
<?php include("h.php"); ?>
<div class="col-sm-12 my-auto text-center">
<form class="form-signin" action="_makeAccount" method="POST" enctype="multipart/form-data"
name="joinFormName" id="joinFormID">
<fieldset style="text-align:left;">
<h1 class="h3 mb-3 font-weight-normal text-center"> Join Now</h1>
<label for="idEmail" class="sr-only">Email address</label>
<input type="email" id="idEmail" class="form-control required" placeholder="Email address" name="nameEmail" required autofocus>
<br>
<label for="idPassword" class="sr-only">Password</label>
<input type="password" id="idPassword" class="form-control required" placeholder="Password" name="namePassword" required>
<label for="idVerify" class="sr-only">Verify Password</label>
<input type="password" id="idVerify" class="form-control required" placeholder="Verify Password" name="nameVerify" required>
<div class="text-center">
<label class="section" for="captchaDiv"></label>
<div id="captchaDiv">
<div class="g-recaptcha" data-sitekey="6LfUldISAAAAAJjP3rj8cCd1CEmBrfdEMVE_51eZ" data-callback="reCaptchaCallback"></div>
</div>
<input type="hidden" class="hiddenRecaptcha required" name="hiddenRecaptcha" id="hiddenRecaptcha">
<br>
<div>
<label class="checkbox text-left">
<input type="checkbox" onclick="toggle(this)" name="nameAgreeLegalAge" class="required" required> I certify that I am of legal adult age in my country
</label>
</div>
<br>
<div>
<label class="checkbox text-left">
<input type="checkbox" onclick="toggle(this)" name="nameAgreeTOS" class="required" required> I agree to <?php echo getSiteName(); ?> <a href="/tos" target="_blank">Terms Of Service</a> and <a href="/privacy" target="_blank">Privacy Policy</a>
</label>
</div>
<br>
<br>
<br>
<br>
<button class="btn btn-lg btn-primary" type="submit" name="createAccountButtonName"
id="createAccountButtonID">Join Now
</button>
</div>
<br>
<div class="smallText">
<span style="color:#ff00a8; font-size:10pt; font-weight:normal;">You can completely delete your profile at any time.</span><br>
</div>
</fieldset>
</form>
</div>
<?php include("f.php");?>
<script src="/js/jquery-3.4.1.min.js"></script>
<script src="/bootstrap-4.3.1-dist/js/bootstrap.bundle.min.js"></script>
<script src="/js/jquery-validation-1.19.1/dist/jquery.validate.min.jss" type="text/javascript"></script>
<script src='https://kit.fontawesome.com/a076d05399.js'></script>
<script type="text/javascript">
var doSubmit = false;
$.validator.setDefaults({});
$().ready
(
function () {
// validate the comment form when it is submitted
$("#joinFormID").validate
({
errorElement: "div",
ignore: ".ignore", //needed for hiddenCaptcha input to validate captcha
rules:
{
nameEmail:
{
email: true
},
namePassword:
{
required: true,
minlength: 5
},
nameVerify:
{
equalTo: "#idPassword"
},
hiddenRecaptcha:
{
required: function () {
if (doSubmit == false) {
return true;
} else {
return false;
}
}
},
}
,
messages:
{
namePassword:
{
required: "Enter a password.",
minlength: "Your password must be at least 5 characters long"
},
nameEmail:
{
required: "We need your email address to send you matches."
},
nameVerify:
{
required: "Verify your password."
},
nameAgreeLegalAge: "You must be of legal age.",
nameAgreeTOS: "You must agree to the Terms Of Service and Privacy Policy to sign up.",
hiddenRecaptcha: "Please complete the captcha to continue."
}
,
});
}
);
function reCaptchaCallback(response)
{
if (response === document.querySelector('.g-recaptcha-response').value)doSubmit = true;
$('#hiddenRecaptcha').valid();
}
</script>
<script src='https://www.google.com/recaptcha/api.js' defer></script>
</body>
</html>