-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.php
177 lines (134 loc) · 5.85 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<?php
/*
* Copyright (c) 2020 Barchampas Gerasimos <makindosx@gmail.com>.
* inveniet is a program for locating computers tablets and mobile phones.
*
* inveniet is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
*
* inveniet is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
session_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title> inveniet </title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--===============================================================================================-->
<link rel="icon" type="image/png" href="assets_log/images/radar2.gif"/>
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="assets_log/vendor/bootstrap/css/bootstrap.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="assets_log/fonts/font-awesome-4.7.0/css/font-awesome.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="assets_log/fonts/Linearicons-Free-v1.0.0/icon-font.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="assets_log/vendor/animate/animate.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="assets_log/vendor/css-hamburgers/hamburgers.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="assets_log/vendor/select2/select2.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="assets_log/css/util.css">
<link rel="stylesheet" type="text/css" href="assets_log/css/main.css">
<!--===============================================================================================-->
</head>
<body>
<div class="limiter">
<div class="container-login100" style="background-image: url('');">
<div class="wrap-login100 p-t-190 p-b-30">
<form class="login100-form validate-form" action="" method="post">
<div class="login100-form-avatar">
<img src="assets_log/images/radar2.gif">
</div>
<span class="login100-form-title p-t-20 p-b-45">
inveniet V 2.0
</span>
<div class="wrap-input100 validate-input m-b-10" data-validate = "Username is required">
<input class="input100" type="text" name="username" placeholder="Username" required>
<span class="focus-input100"></span>
<span class="symbol-input100">
<i class="fa fa-user"></i>
</span>
</div>
<div class="wrap-input100 validate-input m-b-10" data-validate = "Password is required">
<input class="input100" type="password" name="password" placeholder="Password" required>
<span class="focus-input100"></span>
<span class="symbol-input100">
<i class="fa fa-lock"></i>
</span>
</div>
<div class="container-login100-form-btn p-t-10">
<button class="login100-form-btn" name="submit_log">
Login
</button>
</div>
<div class="text-center w-full p-t-25 p-b-230">
<a class="txt1" href="register.php">
Create new account
<i class="fa fa-long-arrow-right"></i>
</a>
</div>
</form>
</div>
</div>
</div>
<!--===============================================================================================-->
<script src="vendor/jquery/jquery-3.2.1.min.js"></script>
<!--===============================================================================================-->
<script src="vendor/bootstrap/js/popper.js"></script>
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
<!--===============================================================================================-->
<script src="vendor/select2/select2.min.js"></script>
<!--===============================================================================================-->
<script src="js/main.js"></script>
</body>
</html>
<?php
if (isset($_POST['submit_log']))
{
require('__ROOT__/class_cn.php');
require('__DEV__/function.php');
$obj = new security;
$host=$obj->connect[0];
$user=$obj->connect[1];
$pass=$obj->connect[2];
$db=$obj->connect[3];
$conn = new mysqli($host,$user,$pass,$db);
if($conn->connect_error)
{
die ("Cannot connect to server " .$conn->connect_error);
}
else
{
$username = input($_POST['username']);
$password = md5(input($_POST['password']));
$username = $conn->real_escape_string($username);
$password = $conn->real_escape_string($password);
$sql ="select username,password,verify from administrators
where binary username='$username' and password='$password' and verify='yes'";
$result=$conn->query($sql);
$rows = $result->num_rows;
if ($rows == 1)
{
session_start();
//all sessions
$_SESSION['login']=$username;
echo ("<script>location.href='home.php'</script>");
} // end id
}// end of else login
$conn->close();
} // end of isset submit
?>