-
Notifications
You must be signed in to change notification settings - Fork 9
/
_login.php
58 lines (54 loc) · 2.08 KB
/
_login.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
<?
// ===================================================================
// Sim Roulette -> Authorization
// License: GPL v3 (https://www.gnu.org/licenses/gpl.html)
// Copyright (c) 2016-2021 Xzero Systems, https://sim-roulette.com
// Author: Nikita Zabelin
// ===================================================================
if ($_POST['login'])
{
if ($_POST['login']!=$GLOBALS['set_data']['admin_login'] || $_POST['pass']!=$GLOBALS['set_data']['admin_pass'])
{
$qry="SELECT `login` FROM `staff` WHERE `login`='".$_POST['login']."' AND md5(`pass`) = '".MD5($_POST['pass'])."'";
if ($result = mysqli_query($db, $qry))
{
if ($row = mysqli_fetch_array($result))
{
SetCookie("srlogin", $_POST['login'], time()+86400*365, "/");
SetCookie("srpass", md5($_POST['pass']), time()+86400*365, "/");
header('location:online.php');
exit();
}
}
$msg = "<div class=\"login_error\">Неверный пароль или логин</div>";
}
else
{
SetCookie("srlogin", $_POST['login'], time()+86400*365, "/");
SetCookie("srpass", md5($_POST['pass']), time()+86400*365, "/");
header('location:index.php');
exit();
}
}
?><html>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
<meta content="width=device-width, initial-scale=1.0, user-scalable=no" name="viewport">
<meta content="width=800, initial-scale=1.0, user-scalable=no" name="viewport">
<meta name="viewport" content="width=800">
<meta name="theme-color" content="#2b60b7">
<title>SR Navigator</title>
<link rel="stylesheet" type="text/css" href="sr/style.css" />
<link rel="stylesheet" type="text/css" href="sr/font.css" />
<body>
<table height="100%" width="100%" class="login_table">
<tr><td align="center" colspan="4" height="99%">
<div class="login_div">
<img src="sr/logo.gif" width="150" border="0">
<?=$msg?><form method='POST'>
<br><input type='text' name='login' value="<?=$_POST['login']?>" placeholder='Логин'><br>
<br><input type='password' name='pass' placeholder='Пароль'><br>
<br><input type='submit' name='SUBMIT' value='Авторизоваться'></form>
</div>
<?
sr_footer();
?>