-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
70 lines (57 loc) · 2.16 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
61
62
63
64
65
66
67
68
69
70
<?php
session_start();
$PASSWORD_VERSION = 1; // Change this when changing password (also in php/api.php)
function isRemembered() {
if (isset($_COOKIE['toon_remember'])) {
$rememberedData = unserialize(file_get_contents('data/remember.dat'));
if (!is_array($rememberedData)) {
$rememberedData = array();
}
$rememberId = $_COOKIE['toon_remember'];
if (isset($rememberedData[$rememberId]) && $rememberedData[$rememberId] > $PASSWORD_VERSION) {
return true;
} else {
return false;
}
} else {
return false;
}
}
function isLoggedin() {
return (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == true) || isRemembered();
}
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Toon Controller</title>
<link type="text/css" rel="stylesheet" href="css/normalize.css">
<link rel="apple-touch-icon" href="img/app-icon.png">
<link rel="apple-touch-startup-image" href="img/app-splash.png">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="white">
<meta name="apple-mobile-web-app-title" content="Toon Controller">
<script type="text/javascript" src="js/jquery.js"></script>
<?php
// if (isLoggedin()) {
echo '<link type="text/css" rel="stylesheet" href="css/app.css"><script type="text/javascript" src="js/app.js"></script>';
// } else {
// echo '<link type="text/css" rel="stylesheet" href="css/login.css"><script type="text/javascript" src="js/login.js"></script>';
// }
?>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="icon" href="favicon.ico" type="image/x-icon"/>
</head>
<body>
<?php
// if (isLoggedin()) {
// Include app
include('pages/app.html');
// } else {
// Include login
// include('pages/login.html');
// }
?>
</body>
</html>