-
Notifications
You must be signed in to change notification settings - Fork 2
/
auth.php
120 lines (103 loc) · 4.49 KB
/
auth.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
<?php
header('Content-type: text/html; charset=utf-8');
session_start();
//error_reporting(E_ALL);
include('include/db_connect.php');//подкл к БД
if (isset($_GET['action'])){
if($_GET['action'] == "logout"){
session_unset();
session_destroy(); // разрушаем сессию
}
};
if (!isset($_SESSION['user_login'])) { //Проверка на доступ к странице
?>
<html>
<head>
<meta charset="utf-8" />
<title>Стена сообщений - Вход</title>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="bootstrapValidator.min.css">
<link rel="stylesheet" href="mystyles.css">
</head>
<body>
<!-- подкл Меню сайта -->
<?php
require_once 'include/head.php';
?>
<div class="container">
<!-- main div -->
<div class="row">
<div class="container">
<div class="container">
<!-- Место для заголовка страницы -->
</div>
</div>
<div class="container">
<div class="row ">
<div class="col-lg-3 col-md-3 col-sm-2 hidden-xs">
</div>
<div class="col-lg-6 col-md-6 col-sm-8 col-sx-12">
<div class="panel panel-default">
<div class="panel-heading">
<h4><b>Авторизация</b></h4>
</div>
<div class="panel-body">
<!-- Сообщение об ошибке -->
<div class="alert alert-danger alert-dismissible collapse" role="alert" id="authMessage">
<button class="close" type="button" onclick="$('.alert').hide()">
<span >×</span>
</button>
<strong>Ошибка!</strong> Вход в систему с указанными данными невозможен.
</div>
<!-- Форма авторизации -->
<form class="form-horisontal" id="authForm" method="POST" onSubmit="return false;">
<div class="form-group ">
<label class=" control-label" for="login">Логин</label>
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-user fa-fw"></i></span>
<input name="login" id="login" class="form-control " type="text" placeholder="Логин" value="">
</div>
</div>
<div class="form-group ">
<label class=" control-label" for="pass">Пароль</label>
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-key fa-fw"></i></span>
<input name="pass" id="pass" class="form-control " type="password" placeholder="Пароль" value="">
</div>
</div>
<button type="submit" id="login_button" class="btn btn-primary">
<i class="fa fa-sign-in"></i> ВОЙТИ
</button>
<button class="btn btn-default " type="reset" onClick="resetForm();">
<i class="fa fa-times"></i> Очистить
</button>
</form>
</div>
</div>
</div>
<div class="col-lg-3 col-md-3 col-sm-2 hidden-xs">
</div>
</div>
</div>
<hr>
</div>
<!-- main block -->
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="js/maskedinput.min.js"></script>
<script src="js/bootstrapValidator.min.js"></script>
<script src="js/main.js"></script>
</body>
</html>
<?php
}
else{
die(header("Location: index.php")); //Редирект на главную, если нет доступа
};
?>