1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-28 20:45:00 +03:00
This commit is contained in:
Mzhelskiy Maxim 2012-06-16 03:43:47 +04:00
parent 738f8b5d55
commit f3c947f111
9 changed files with 100 additions and 69 deletions

View file

@ -96,25 +96,20 @@ class ActionLogin extends Action {
}
$this->Message_AddErrorSingle($this->Lang_Get('user_login_bad'));
}
/**
* Повторный запрос активации
*/
protected function EventReactivation()
{
protected function EventReactivation() {
if($this->User_GetUserCurrent()) {
Router::Location(Config::Get('path.root.web').'/');
}
$this->Viewer_AddHtmlTitle($this->Lang_Get('reactivation'));
}
/**
* Ajax повторной активации
*/
protected function EventAjaxReactivation()
{
protected function EventAjaxReactivation() {
$this->Viewer_SetResponseAjax('json');
if ((func_check(getRequest('mail'), 'mail') and $oUser = $this->User_GetUserByMail(getRequest('mail')))) {
@ -133,7 +128,6 @@ class ActionLogin extends Action {
$this->Message_AddErrorSingle($this->Lang_Get('password_reminder_bad_email'));
}
/**
* Обрабатываем процесс залогинивания
* По факту только отображение шаблона, дальше вступает в дело Ajax

View file

@ -1,8 +1,8 @@
var ls = ls || {};
/**
* Управление пользователями
*/
* Управление пользователями
*/
ls.user = (function ($) {
this.jcropAvatar=null;
@ -381,7 +381,7 @@ ls.user = (function ($) {
form.find('.validate-error-show').removeClass('validate-error-show').addClass('validate-error-hide');
if (result.bStateError) {
form.find('.validate-error-login').removeClass('validate-error-hide').addClass('validate-error-show').text(result.sMsg);
form.find('.validate-error-login').removeClass('validate-error-hide').addClass('validate-error-show').html(result.sMsg);
} else {
if (result.sMsg) {
ls.msg.notice(null,result.sMsg);
@ -427,7 +427,7 @@ ls.user = (function ($) {
* Ajax запрос на ссылку активации
* @param form
*/
this.reminder = function(form) {
this.reactivation = function(form) {
var url = aRouter.login+'ajax-reactivation/';
ls.hook.marker('reactivationBefore');
@ -444,9 +444,6 @@ ls.user = (function ($) {
if (result.sMsg) {
ls.msg.notice(null,result.sMsg);
}
if (result.sUrlRedirect) {
window.location=result.sUrlRedirect;
}
ls.hook.run('ls_user_reactivation_after', [form, result]);
}
});

View file

@ -0,0 +1,26 @@
{assign var="noSidebar" value=true}
{include file='header.tpl'}
<script type="text/javascript">
jQuery(document).ready(function($){
$('#reactivation-form').bind('submit',function(){
ls.user.reactivation('reactivation-form');
return false;
});
$('#reactivation-form-submit').attr('disabled',false);
});
</script>
<h2 class="page-header">{$aLang.reactivation}</h2>
<form action="{router page='login'}reactivation/" method="POST" id="reactivation-form">
<p><label for="reactivation-mail">{$aLang.password_reminder_email}</label>
<input type="text" name="mail" id="reactivation-mail" class="input-text input-width-200" />
<small class="validate-error-hide validate-error-reactivation"></small></p>
<button type="submit" name="submit_reactivation" class="button button-primary" id="reactivation-form-submit" disabled="disabled">{$aLang.reactivation_submit}</button>
</form>
{include file='footer.tpl'}

View file

@ -0,0 +1,7 @@
You have requested re-activation on the site <a href="{cfg name='path.root.web'}">{cfg name='view.name'}</a><br>
Link to the account activation:
<a href="{router page='registration'}activate/{$oUser->getActivateKey()}/">{router page='registration'}activate/{$oUser->getActivateKey()}/</a>
<br><br>
Best regards, site administration <a href="{cfg name='path.root.web'}">{cfg name='view.name'}</a>

View file

@ -0,0 +1,7 @@
Вы запросили повторную активацию на сайте <a href="{cfg name='path.root.web'}">{cfg name='view.name'}</a><br>
Ссылка на активацию аккаунта:
<a href="{router page='registration'}activate/{$oUser->getActivateKey()}/">{router page='registration'}activate/{$oUser->getActivateKey()}/</a>
<br><br>
С уважением, администрация сайта <a href="{cfg name='path.root.web'}">{cfg name='view.name'}</a>

View file

@ -4,7 +4,7 @@
<script type="text/javascript">
jQuery(document).ready(function($){
$('#reactivation-form').bind('submit',function(){
ls.user.reminder('reactivation-form');
ls.user.reactivation('reactivation-form');
return false;
});
$('#reactivation-form-submit').attr('disabled',false);