mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-06-30 21:45:01 +03:00
форма авторизации
This commit is contained in:
parent
5864b7560c
commit
f6acd0e3c9
|
@ -53,10 +53,11 @@ class ActionLogin extends Action {
|
|||
* Сверяем хеши паролей и проверяем активен ли юзер
|
||||
*/
|
||||
if ($oUser->getPassword()==func_encrypt(getRequest('password')) and $oUser->getActivate()) {
|
||||
$bRemember=getRequest('remember',false) ? true : false;
|
||||
/**
|
||||
* Авторизуем
|
||||
*/
|
||||
$this->User_Authorization($oUser);
|
||||
$this->User_Authorization($oUser,$bRemember);
|
||||
/**
|
||||
* Перенаправляем на страницу с которой произошла авторизация
|
||||
*/
|
||||
|
|
|
@ -153,7 +153,7 @@ class User extends Module {
|
|||
* @param UserEntity_User $oUser
|
||||
* @return unknown
|
||||
*/
|
||||
public function Authorization(UserEntity_User $oUser) {
|
||||
public function Authorization(UserEntity_User $oUser,$bRemember=true) {
|
||||
if (!$oUser->getId() or !$oUser->getActivate()) {
|
||||
return false;
|
||||
}
|
||||
|
@ -171,7 +171,9 @@ class User extends Module {
|
|||
/**
|
||||
* Ставим куку
|
||||
*/
|
||||
setcookie('key',$sKey,time()+60*60*24*3,SYS_COOKIE_PATH,SYS_COOKIE_HOST);
|
||||
if ($bRemember) {
|
||||
setcookie('key',$sKey,time()+60*60*24*3,SYS_COOKIE_PATH,SYS_COOKIE_HOST);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Автоматическое заллогинивание по ключу из куков
|
||||
|
|
|
@ -680,9 +680,9 @@ select { width: 99%; }
|
|||
.lite-note { overflow: hidden; zoom: 1; color: #888; }
|
||||
.lite-note a { float: right; font-size: 11px; }
|
||||
|
||||
.overlay { position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; background: url(data:image/png;base64,iVBORw0KGg...); background:rgba(0, 0, 0, 0.5); z-index: 50; }
|
||||
.overlay { position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; background: url(data:image/png;base64,iVBORw0KGg...); background:rgba(0, 0, 0, 0.5); z-index: 50; display: none;}
|
||||
|
||||
.login-popup { z-index: 100; width: 492px; margin-left: -246px; }
|
||||
.login-popup { z-index: 100; width: 492px; margin-left: -246px; display: none;}
|
||||
.login-popup .input-text { width: 412px; }
|
||||
.login-popup .content { background: #fafafa url(../images/login-popup-bg.gif); padding: 15px 40px; }
|
||||
.login-popup .login-popup-top { height: 14px; background: url(../images/login-popup-top.gif) no-repeat; width: 492px; position: relative; }
|
||||
|
|
|
@ -45,6 +45,7 @@ var BLOG_USE_TINYMCE='{$BLOG_USE_TINYMCE}';
|
|||
<script type="text/javascript" src="{$DIR_STATIC_SKIN}/js/friend.js"></script>
|
||||
<script type="text/javascript" src="{$DIR_STATIC_SKIN}/js/blog.js"></script>
|
||||
<script type="text/javascript" src="{$DIR_STATIC_SKIN}/js/other.js"></script>
|
||||
<script type="text/javascript" src="{$DIR_STATIC_SKIN}/js/login.js"></script>
|
||||
|
||||
|
||||
{literal}
|
||||
|
@ -72,6 +73,25 @@ var msgNoticeBox=new Roar({
|
|||
<div id="container">
|
||||
|
||||
|
||||
<div class="overlay"></div>
|
||||
{if !$oUserCurrent}
|
||||
<div class="lite-center login-popup" id="login-form">
|
||||
<div class="login-popup-top"><a href="#" class="close-block" onclick="hideLoginForm(); return false;"></a></div>
|
||||
<div class="content">
|
||||
<form action="{$DIR_WEB_ROOT}/login/" method="POST">
|
||||
<h3>Авторизация</h3>
|
||||
<div class="lite-note"><a href="{$DIR_WEB_ROOT}/{$ROUTE_PAGE_REGISTRATION}/">Зарегистрироваться</a><label for="">Логин или эл. почта</label></div>
|
||||
<p><input type="text" class="input-text" name="login" tabindex="1" id="login-input"/></p>
|
||||
<div class="lite-note"><a href="{$DIR_WEB_ROOT}/{$ROUTE_PAGE_LOGIN}/reminder/" tabindex="-1">Напомнить пароль</a><label for="">Пароль</label></div>
|
||||
<p><input type="password" name="password" class="input-text" tabindex="2" /></p>
|
||||
<div class="lite-note"><input type="image" src="{$DIR_STATIC_SKIN}/images/login-button.gif" class="input-button" tabindex="4" /><label for="" class="input-checkbox"><input type="checkbox" name="remember" checked tabindex="3" > Запомнить меня</label></div>
|
||||
<input type="hidden" name="submit_login">
|
||||
</form>
|
||||
</div>
|
||||
<div class="login-popup-bottom"></div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<!-- Header -->
|
||||
<div id="header">
|
||||
<h1><a href="{$DIR_WEB_ROOT}"><strong>Live</strong>Street</a></h1>
|
||||
|
@ -99,6 +119,8 @@ var msgNoticeBox=new Roar({
|
|||
<li>{$aLang.user_rating} <strong>{$oUserCurrent->getRating()}</strong></li>
|
||||
</ul>
|
||||
</div>
|
||||
{else}
|
||||
<a href="#" onclick="showLoginForm(); return false;">Войти</a>
|
||||
{/if}
|
||||
|
||||
|
||||
|
|
14
templates/skin/new/js/login.js
Normal file
14
templates/skin/new/js/login.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
function showLoginForm() {
|
||||
var divOverlay=$$('.overlay')[0];
|
||||
var divLoginForm=$('login-form');
|
||||
divOverlay.setStyle('display','block');
|
||||
divLoginForm.setStyle('display','block');
|
||||
$('login-input').focus();
|
||||
}
|
||||
|
||||
function hideLoginForm() {
|
||||
var divOverlay=$$('.overlay')[0];
|
||||
var divLoginForm=$('login-form');
|
||||
divOverlay.setStyle('display','none');
|
||||
divLoginForm.setStyle('display','none');
|
||||
}
|
Loading…
Reference in a new issue