forked from shidec/line_bot_framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
64 lines (60 loc) · 1.54 KB
/
Copy pathindex.php
File metadata and controls
64 lines (60 loc) · 1.54 KB
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
<?php
if(!file_exists('includes/config.php')){
header('Location: install.php');
exit;
}
session_start();
if(isset($_SESSION['logged']) && $_SESSION['logged']){
header('Location: page.php');
}
if(isset($_POST['login'])){
require_once 'includes/config.php';
require_once 'classes/Database.php';
require_once 'classes/Option.php';
$option = new Option();
if($_POST['username'] == $option->get('admin_name') && md5($_POST['userpasswd']) == $option->get('admin_passwd')){
$_SESSION['logged'] = 1;
header('Location: page.php');
}else{
$error = 'Login failed';
}
}
?>
<html>
<head>
<title>Bot Framework - Login</title>
<link rel="stylesheet" href="assets/css/style.css">
<script src="assets/js/jquery-3.2.0.min.js"></script>
</head>
<body>
<br/><br/>
<?php
if(isset($_GET['installed'])){
?>
<div class="msg">instalation complete. It's better to remove 'install' directory.</div>
<?php
}
?>
<br/><br/><br/>
<div align="center">
<?php echo (isset($error) ? '<div class="error">' . $error . '</div>' : ''); ?><br/>
<form name="formLogin" id="formLogin" method="post" action="index.php">
<table width="400">
<tr>
<td>Username</td>
<td><input type="text" name="username" id="username"/></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="userpasswd" id="userpasswd"/></td>
</tr>
<tr>
<td colspan="2">
<input type="submit" name="login" id="login" value="Login" class="button"/>
</td>
</tr>
</table>
</form>
</div>
</body>
</head>