Completed
Push — master ( d0bd11...fbf230 )
by
unknown
10s
created

login.php (1 issue)

Labels
Severity

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
require_once('class.ProfilesPage.php');
11
$page = new ProfilesPage('Burning Flipside Profiles Login');
12
if($page->user !== false && $page->user !== null)
13
{
14
    if(isset($_GET['return']))
15
    {
16
        header('Location: '.$_GET['return']);
17
    }
18
    else
19
    {
20
        header('Location: /index.php');
21
    }
22
}
23
24 View Code Duplication
if(isset($_GET['return']))
25
{
26
    $return = '<input type="hidden" name="return" value="'.$_GET['return'].'"/>';
27
}
28
else
29
{
30
    $return = '';
31
}
32
if(isset($_GET['failed']))
33
{
34
    $page->addNotification('Login Failed! <a href="'.$page->resetUrl.'" class="alert-link">Click here to reset your password.</a>', $page::NOTIFICATION_FAILED);
0 ignored issues
show
The property resetUrl does not seem to exist in ProfilesPage.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
35
}
36
37
$auth = \AuthProvider::getInstance();
38
$auth_links = $auth->getSupplementaryLinks();
39
$auth_links_str = '';
40
$count = count($auth_links);
41
for($i = 0; $i < $count; $i++)
42
{
43
    $auth_links_str .= $auth_links[$i];
44
}
45
46
$page->body = '
47
<div id="content" class="container">
48
    <div class="login-container">
49
    <h3>Burning Flipside Profile Login</h3>
50
    <form id="login_main_form" role="form">
51
        <input class="form-control" type="text" name="username" placeholder="Username or Email" required autofocus/>
52
        <input class="form-control" type="password" name="password" placeholder="Password" required/>
53
        '.$return.'
54
        <button class="btn btn-lg btn-primary btn-block" type="submit">Login</button>
55
    </form>
56
    '.$auth_links_str.'
57
    </div>
58
</div>';
59
60
$page->printPage();
61
// vim: set tabstop=4 shiftwidth=4 expandtab:
62
?>
63