-
Notifications
You must be signed in to change notification settings - Fork 14
/
index.php
81 lines (70 loc) · 1.8 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
71
72
73
74
75
76
77
78
79
80
81
<?php
// Users Array
// Each line follows the structure of:
// 'username' => 'password'
$users = array(
'admin' => 'pass',
'username' => 'password'
);
/*
* Uncomment the following
* To enable password protection
*/
/* // <== remove
session_start();
$_SESSION['auth'] = false;
if (authenticate($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'])) {
$_SESSION['auth'] = true;
pass;
} else if (!isset($_SERVER['PHP_AUTH_USER']) || !$_SESSION['auth']) {
header('WWW-Authenticate: Basic realm="Forgetmenot"');
header('HTTP/1.0 401 Unauthorized');
echo 'Wrong credentials! Try again!';
exit;
} else {
echo 'Wrong credentials! Try again!';
exit;
}
function authenticate($user, $pass) {
global $users;
foreach ($users as $u => $p) {
if($user == $u && $pass == $p) {
return true;
} else {
return false;
}
}
}
*/ // <== remove
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<title>forgetmenot - a todo list</title>
<link rel="stylesheet" href="css/forgetmenot.css"/>
<script data-main="js/main" src="js/libs/require.js"></script>
</head>
<body>
<div class="container" id="app">
<header class="clearfix">
<h1>forgetmenot - a todo list</h1>
<img src="images/new.png" value="Create New" id="createNew" class="createNew" />
<nav id="stats" class="clearfix">
<!-- stats go here -->
</nav>
</header>
<ul class="todoList fmn-todos" id="todoItemsList">
<!-- #app items go here -->
<script type="text/javascript">
var json = <?php require_once('api.php'); ?>;
</script>
</ul>
<footer>
</footer>
</div>
</body>
</html>