Skip to content
Snippets Groups Projects
Commit 9aac5357 authored by pimka's avatar pimka
Browse files

authentication timeout modal window

parent f855afa8
Branches
Tags
No related merge requests found
......@@ -124,5 +124,31 @@
</div>
</div>
<div class="popup_overlay">
<div class="popup">
<form action="sign" method='POST' id='signin_f'>
<div class="session_info">Пожалуйста, авторизируйтесь заново</div>
<div class='auth_error'>Неправильный логин/E-Mail или пароль</div>
<div class='inputs'>
<div class="auth_form">
<input type="text" id="login" name="login" placeholder="Логин или E-Mail">
</div>
<div class="auth_form">
<input type="text" id="password" name="password" placeholder="Пароль">
</div>
</div>
<!-- {{ sign.input('signin_b', 'button', 'Войти') }} -->
<div class="auth_form">
<input type="button" id="signin_b" name="button" value="Войти">
</div>
</form>
<div class='actiongrid'>
{# {{ HTML.anchor('remind', 'Забыли пароль?')|raw }} | #}
{{ HTML.anchor('sign/up', 'Активировать аккаунт')|raw }} | {{ HTML.anchor('remind', 'Забыли пароль?')|raw }}
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
......@@ -299,8 +299,99 @@ h2.BlueTitle{
/*---------------- модальное окно -------------------*/
.session_info {
font: 9pt;
color: #aaaaaa;
}
.auth_form
{
padding: 3px;
margin: 0 auto;
text-align: center;
}
.auth_form input
{
margin: 0 auto;
margin: 1px 0;
border: 1px solid;
border-radius: 3px;
}
.auth_form input[type=text], .auth_form input[type=password]
{
font-size: 9pt;
width: 90%;
border-color: #aaaaaa;
overflow: hidden;
padding: 7px;
}
.auth_form input[type=button], .auth_form input[type=submit]
{
margin: 0 auto;
width: 95%;
overflow: hidden;
padding: 7px;
background-color: #009933;
border: none;
color: #ffffff;
}
.auth_form input[type=button]:hover, .auth_form input[type=submit]:hover
{
cursor: pointer;
background-color: #009000;
}
.popup_overlay {
z-index: 9999;
display: none;
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: rgba(0,0,0,.7);
text-align: center;
}
.popup_overlay:after {
display: inline-block;
height: 100%;
width: 0;
vertical-align: middle;
content: '';
}
.popup {
display: inline-block;
position: relative;
max-width: 300px;
padding: 20px;
border: 3px solid #fff;
border-radius: 10px;
box-shadow: inset 0 1px 2px 1px rgba(0,0,0,.4);
background: #fff;
vertical-align: middle
}
.auth_error {
display: none;
}
.inputs {
margin: 0 auto;
margin-top: 5px;
}
.actiongrid {
margin-top: 5px;
}
/*----------------------------------------------------*/
......@@ -34,10 +34,15 @@ $(function()
function closeSession() {
$.ajax({
type: "POST",
url: URLdir + "handler/Session/closeSession",
success: function(data) {window.location.replace(URLdir);}
success: function(data) {
$('.popup_overlay').css('display', 'block');
}
});
}
......@@ -52,7 +57,7 @@ $(function()
data = $.parseJSON(data);
wait = parseInt(data, 10);
if (wait <= 10) {
closeSession(wait);
closeSession();
return;
} else {
setSessionTimer(wait-10);
......@@ -63,33 +68,5 @@ $(function()
}
setSessionTimer(1);
// $(document).bind('mousemove keydown scroll', function(){
// clearTimeout(timer); // отменяем прежний временной отрезок
// timer = setTimeout(function(){
// // Действия на отсутствие пользователя
// $.ajax({
// type: "POST",
// url: URLdir + "handler/Sign2/getSessionTime",
// success: function(data)
// {
// data = $.parseJSON(data);
// wait2 = data.duration;
// }
// });
// if (wait < 10) {
// alert("Простите, но Вы были неактивны более " + wait/(60 * 1000) + " минут. \n\
// Если Вы хотите продолжить работу, снова войдите в систему на странице авторизации.");
// document.location.href = URLdir + "/sign/out";
// }
// }, wait);
// });
//$("body").trigger("mousemove"); // сгенерируем ложное событие, для запуска скрипта
});
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment