blob: 9deae75d4b1b858f0c6156daa4a8d15ef2c4c442 (
plain)
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
|
<?php
require_once "config.php";
@$op = $_REQUEST["op"];
if ($op == "perform-login") {
$user = trim(mb_strtolower($_REQUEST["user"]));
$password = 'SHA256:' . hash('sha256', "$user:" . trim($_REQUEST["password"]));
require_once "db.php";
$dbh = Db::get();
$sth = $dbh->prepare("SELECT id FROM epube_users WHERE user = ? AND pass = ?");
$sth->execute([$user, $password]);
if ($line = $sth->fetch()) {
require_once "sessions.php";
$_SESSION["owner"] = $user;
header("Location: index.php");
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="lib/bootstrap/v3/css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="lib/bootstrap/v3/css/bootstrap-theme.min.css" rel="stylesheet" media="screen">
<link href="lib/qtip2/jquery.qtip.min.css" rel="stylesheet" media="screen">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="lib/bootstrap/v3/js/jquery.js"></script>
<script src="lib/bootstrap/v3/js/bootstrap.min.js"></script>
<script src="lib/holder.min.js"></script>
<script src="lib/localforage.min.js"></script>
<script src="lib/qtip2/jquery.qtip.min.js"></script>
<title>The Epube</title>
<link type="text/css" rel="stylesheet" media="screen" href="css/index.css" />
<link rel="shortcut icon" type="image/png" href="img/favicon.png" />
<link rel="icon" sizes="192x192" href="img/favicon_hires.png">
<link rel="manifest" href="manifest.json">
<meta name="mobile-web-app-capable" content="yes">
<script src="js/index.js"></script>
<script src="js/common.js"></script>
</head>
<body>
<div class="navbar navbar-default navbar-static-top">
<div class="container">
<div class="navbar-header">
<span class="navbar-brand"><a href="?">The Epube</a></span>
</div>
</div>
</div>
<div class="container">
<form method="post">
<input type="hidden" name="op" value="perform-login">
<div class="form-group">
<label>User</label>
<input class="form-control" required="true" name="user">
</div>
<div class="form-group">
<label>Password</label>
<input type="password" class="form-control" name="password" required="true">
</div>
<button type="submit" class="btn btn-default">Log in</button>
</form>
</div>
</body>
</html>
|