forked from uakfdotb/uxpanel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
36 lines (29 loc) · 1.04 KB
/
index.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
<?php
include("include/common.php");
include("config.php");
include("include/session.php");
include("include/dbconnect.php");
include("include/auth.php");
if(isset($_SESSION['account_id'])) {
header("Location: panel/");
} else if(isset($_POST['email']) && isset($_POST['password'])) {
$result = authAccount($_POST['email'], $_POST['password']);
if($result === true) {
header("Location: panel/");
} else if($result === -1) {
header("Location: index.php?message=" . urlencode("Login failed: too many failed login attempts. Please wait a few seconds before trying again."));
} else if($result === -2) {
header("Location: index.php?message=" . urlencode("Login failed: invalid email address or password."));
} else {
header("Location: index.php?message=" . urlencode("Unknown error occurred."));
}
} else if($config['slave_enabled']) {
header("Location: " . $config['slave_master']);
} else {
$message = "";
if(isset($_REQUEST['message'])) {
$message = $_REQUEST['message'];
}
get_page("index", "main", array('message' => $message));
}
?>