Completed
Push — master ( 4f23d4...a4c187 )
by Patrick
02:03
created

register.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
ini_set('display_errors', 1);
3
error_reporting(E_ALL);
4
//Redirect users to https
5 View Code Duplication
if($_SERVER["HTTPS"] != "on")
6
{
7
    header("Location: https://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]);
8
    exit();
9
}
10 View Code Duplication
if(strpos($_SERVER['REQUEST_URI'], '//') !== false)
0 ignored issues
show
This code seems to be duplicated across your project.

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.

Loading history...
11
{
12
    $uri = str_replace('//', '/', $_SERVER['REQUEST_URI']);
13
    header("Location: https://".$_SERVER["HTTP_HOST"].$uri);
14
    exit();
15
}
16
require_once('class.FlipsideCAPTCHA.php');
17
require_once('class.ProfilesPage.php');
18
$page = new ProfilesPage('Burning Flipside Profiles Registration');
19
$page->addJSByURI('/js/zxcvbn-async.js');
20
$page->addJSByURI('/js/register.js');
21
22
$captcha = new FlipsideCAPTCHA();
23
FlipSession::setVar('captcha', $captcha);
24
25 View Code Duplication
if(isset($_GET['return']))
26
{
27
    $return = '<input type="hidden" name="return" value="'.$_GET['return'].'"/>';
28
}
29
else
30
{
31
    $return = '';
32
}
33
34
if(FlipSession::isLoggedIn())
35
{
36
    $page->addNotification('You are currently logged in to the system. Are you sure you want to register another account?');
37
}
38
39
$page->body .= '
40
<div id="content">
41
    <form name="form" id="form" role="form">
42
        <fieldset>
43
            <legend>Burning Flipside Profile Registration</legend>
44
        </fieldset>
45
        <div class="form-group">
46
            <label for="email" class="col-sm-2 control-label">Email:</label>
47
            <div class="col-sm-10">
48
                <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/>
49
            </div>
50
        </div>
51
        <div class="clearfix visible-sm visible-md visible-lg"></div>
52
        <div class="row" style="min-height: 15px;"></div>
53
        <div class="form-group">
54
            <label for="uid" class="col-sm-2 control-label">Username:</label>
55
            <div class="col-sm-10">
56
                <input class="form-control" type="text" name="uid" id="uid" required/>
57
            </div>
58
        </div>
59
        <div class="clearfix visible-sm visible-md visible-lg"></div>
60
        <div class="row" style="min-height: 15px;"></div>
61
        <div class="form-group">
62
            <label for="password" class="col-sm-2 control-label">Password:</label>
63
            <div class="col-sm-10">
64
                <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/>
65
            </div>
66
        </div>
67
        <div class="clearfix visible-sm visible-md visible-lg"></div>
68
        <div class="row" style="min-height: 15px;"></div>
69
        <div class="form-group">
70
            <label for="password2" class="col-sm-2 control-label">Confirm Password:</label>
71
            <div class="col-sm-10">
72
                <input class="form-control" type="password" name="password2" id="password2" required/>
73
            </div>
74
        </div>
75
        <div class="clearfix visible-sm visible-md visible-lg"></div>
76
        <div class="row" style="min-height: 15px;"></div>
77
        <div class="form-group">
78
            '.$captcha->draw_captcha(true, true).'
79
        </div>
80
        <div class="clearfix visible-sm visible-md visible-lg"></div>
81
        '.$return.'
82
        <div class="form-group">
83
            <div class="col-sm-2">
84
            <button id="submit" type="submit" name="submit" class="btn btn-default">Register</button>
85
            </div>
86
        </div>
87
    </form>
88
</div>';
89
90
$page->printPage();
91
// vim: set tabstop=4 shiftwidth=4 expandtab:
92
?>
93
94
95