-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
60 lines (46 loc) · 1.47 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
include_once "includes/config.php";
include_once "includes/Auth.php";
# new auth object
$auth = new Auth($_POST["username"], $_POST["password"]);
$auth->checkNetwork();
# if not local redirect to https, else to http
$netBool = $auth->checkNetwork();
if($_SERVER["HTTPS"] != "on" && !$netBool) {
header("Location: https://".$_SERVER["HTTP_HOST"]);
}elseif($_SERVER["HTTPS"] == "on" && $netBool){
header("Location: http://".$_SERVER["HTTP_HOST"]);
}
if($_GET["logout"] == "1")
{
$auth->logout();
}
if($auth->check() === true && !$_GET["groupblocked"])
{
if(isset($_COOKIE["cid"]) && ($_COOKIE["cid"] === "-1" || $_COOKIE["cid"] === "-2")){
$auth->registerAddress();
header("Location: monitoring/");
}elseif(isset($_COOKIE["cid"]) && $_COOKIE["cid"] === "0"){
$auth->registerAddress();
header("Location: admin/");
}elseif(isset($_COOKIE["cid"])){
header("Location: streams/speed.php");
}else{
header("Location: /");
}
}elseif($auth->check() === false && $auth->errorTxt){
$errBool = true;
$class = ("error");
$errorTxt = $auth->errorTxt;
}elseif($_GET["expired"]){
$errBool = true;
$class = ("error");
$errorTxt = "Uw sessie is verlopen. Log opnieuw in.";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="nl">
<?
include("styles/".style_name."/includes/index.inc");
?>
</html>