|
1
|
|
|
<?php |
|
2
|
|
|
ini_set('display_errors', 1); |
|
3
|
|
|
error_reporting(E_ALL); |
|
4
|
|
|
|
|
5
|
|
|
//Redirect users to https |
|
6
|
|
|
if($_SERVER["HTTPS"] != "on") |
|
7
|
|
|
{ |
|
8
|
|
|
header("Location: https://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]); |
|
9
|
|
|
exit(); |
|
10
|
|
|
} |
|
11
|
|
View Code Duplication |
if(strpos($_SERVER['REQUEST_URI'], '//') !== false) |
|
|
|
|
|
|
12
|
|
|
{ |
|
13
|
|
|
$uri = str_replace('//', '/', $_SERVER['REQUEST_URI']); |
|
14
|
|
|
header("Location: https://".$_SERVER["HTTP_HOST"].$uri); |
|
15
|
|
|
exit(); |
|
16
|
|
|
} |
|
17
|
|
|
|
|
18
|
|
|
require_once('FlipsideCAPTCHA.php'); |
|
19
|
|
|
require_once('class.ProfilesPage.php'); |
|
20
|
|
|
$page = new ProfilesPage('Burning Flipside Profiles Registration'); |
|
21
|
|
|
$page->addJS('/js/zxcvbn-async.js'); |
|
22
|
|
|
$page->addJS('js/register.js'); |
|
23
|
|
|
|
|
24
|
|
|
$captcha = new \Flipside\FlipsideCAPTCHA(); |
|
25
|
|
|
\Flipside\FlipSession::setVar('captcha', $captcha); |
|
26
|
|
|
|
|
27
|
|
View Code Duplication |
if(isset($_GET['return'])) |
|
|
|
|
|
|
28
|
|
|
{ |
|
29
|
|
|
$return = '<input type="hidden" name="return" value="'.$_GET['return'].'"/>'; |
|
30
|
|
|
} |
|
31
|
|
|
else |
|
32
|
|
|
{ |
|
33
|
|
|
$return = ''; |
|
34
|
|
|
} |
|
35
|
|
|
|
|
36
|
|
|
if(\Flipside\FlipSession::isLoggedIn()) |
|
37
|
|
|
{ |
|
38
|
|
|
$page->addNotification('You are currently logged in to the system. Are you sure you want to register another account?'); |
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
|
|
$page->body .= ' |
|
42
|
|
|
<div id="content"> |
|
43
|
|
|
<form name="form" id="form" role="form"> |
|
44
|
|
|
<fieldset> |
|
45
|
|
|
<legend>Burning Flipside Profile Registration</legend> |
|
46
|
|
|
</fieldset> |
|
47
|
|
|
<div class="form-group"> |
|
48
|
|
|
<label for="email" class="col-sm-2 control-label">Email:</label> |
|
49
|
|
|
<div class="col-sm-10"> |
|
50
|
|
|
<input class="form-control" type="email" name="mail" id="email" data-toggle="tooltip" data-placement="top" title="The email to use for this account. NOTE: You must be able to verify you own this email address by responding to an email." required/> |
|
51
|
|
|
</div> |
|
52
|
|
|
</div> |
|
53
|
|
|
<div class="clearfix visible-sm visible-md visible-lg"></div> |
|
54
|
|
|
<div class="row" style="min-height: 15px;"></div> |
|
55
|
|
|
<div class="form-group"> |
|
56
|
|
|
<label for="uid" class="col-sm-2 control-label">Username:</label> |
|
57
|
|
|
<div class="col-sm-10"> |
|
58
|
|
|
<input class="form-control" type="text" name="uid" id="uid" required/> |
|
59
|
|
|
</div> |
|
60
|
|
|
</div> |
|
61
|
|
|
<div class="clearfix visible-sm visible-md visible-lg"></div> |
|
62
|
|
|
<div class="row" style="min-height: 15px;"></div> |
|
63
|
|
|
<div class="form-group"> |
|
64
|
|
|
<label for="password" class="col-sm-2 control-label">Password:</label> |
|
65
|
|
|
<div class="col-sm-10"> |
|
66
|
|
|
<input type="password" name="password" id="password" class="pass form-control" data-toggle="tooltip" data-placement="top" title="Your password must be at least 4 characters long, contain a lower case letter, uppercase letter, and a number." required/> |
|
67
|
|
|
</div> |
|
68
|
|
|
</div> |
|
69
|
|
|
<div class="clearfix visible-sm visible-md visible-lg"></div> |
|
70
|
|
|
<div class="row" style="min-height: 15px;"></div> |
|
71
|
|
|
<div class="form-group"> |
|
72
|
|
|
<label for="password2" class="col-sm-2 control-label">Confirm Password:</label> |
|
73
|
|
|
<div class="col-sm-10"> |
|
74
|
|
|
<input class="form-control" type="password" name="password2" id="password2" required/> |
|
75
|
|
|
</div> |
|
76
|
|
|
</div> |
|
77
|
|
|
<div class="clearfix visible-sm visible-md visible-lg"></div> |
|
78
|
|
|
<div class="row" style="min-height: 15px;"></div> |
|
79
|
|
|
<div class="form-group"> |
|
80
|
|
|
'.$captcha->draw_captcha(true, true).' |
|
81
|
|
|
</div> |
|
82
|
|
|
<div class="clearfix visible-sm visible-md visible-lg"></div> |
|
83
|
|
|
'.$return.' |
|
84
|
|
|
<div class="form-group"> |
|
85
|
|
|
<div class="col-sm-2"> |
|
86
|
|
|
<button id="submit" type="submit" name="submit" class="btn btn-default">Register</button> |
|
87
|
|
|
</div> |
|
88
|
|
|
</div> |
|
89
|
|
|
</form> |
|
90
|
|
|
</div>'; |
|
91
|
|
|
|
|
92
|
|
|
$page->printPage(); |
|
93
|
|
|
// vim: set tabstop=4 shiftwidth=4 expandtab: |
|
94
|
|
|
|
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.