-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.php
More file actions
49 lines (46 loc) · 1.07 KB
/
index.php
File metadata and controls
49 lines (46 loc) · 1.07 KB
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
<?php
include('./includes/loader.php');
if($LoggedIn === true)
{
header("Location: main.php");
die();
}
else
{
if(empty($_GET['id']) || $_GET['id'] == 'login')
{
if(isset($_POST['submit']))
{
/* Form was submitted. */
if((!empty($_POST['username'])) && (!empty($_POST['password'])))
{
$sErrorMessage = User::login($_POST['username'], $_POST['password']);
}
else
{
$sErrorMessage = "Username or password not specified.";
}
}
else
{
$sErrorMessage = "";
}
$sPageContents = Templater::AdvancedParse('/blue_default/login', $locale->strings, array(
'ErrorMessage' => $sErrorMessage,
'RegistrationEnabled' => $sRegistrationEnabled->sValue,
'ForgotPasswordEnabled' => $sForgotPasswordEnabled->sValue
));
}
else
{
/* TODO: create a proper template for this. */
$sPageContents = "Page not found";
$sPageTitle = "Not found";
}
echo(Templater::AdvancedParse('blue_default/master.login', $locale->strings, array(
'PanelTitle' => $sPanelTitle->sValue,
'PageTitle' => "Login",
'contents' => $sPageContents
)));
}
?>