mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-06-26 03:30:48 +03:00
fix #132
This commit is contained in:
parent
738f8b5d55
commit
f3c947f111
|
@ -74,10 +74,10 @@ class ActionLogin extends Action {
|
|||
*/
|
||||
|
||||
if ($oUser->getPassword()==func_encrypt(getRequest('password'))) {
|
||||
if (!$oUser->getActivate()) {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('user_not_activated', array('reactivation_path' => Router::GetPath('login') . 'reactivation')));
|
||||
return;
|
||||
}
|
||||
if (!$oUser->getActivate()) {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('user_not_activated', array('reactivation_path' => Router::GetPath('login') . 'reactivation')));
|
||||
return;
|
||||
}
|
||||
$bRemember=getRequest('remember',false) ? true : false;
|
||||
/**
|
||||
* Авторизуем
|
||||
|
@ -96,45 +96,39 @@ class ActionLogin extends Action {
|
|||
}
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('user_login_bad'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Повторный запрос активации
|
||||
*/
|
||||
protected function EventReactivation()
|
||||
{
|
||||
if($this->User_GetUserCurrent()) {
|
||||
/**
|
||||
* Повторный запрос активации
|
||||
*/
|
||||
protected function EventReactivation() {
|
||||
if($this->User_GetUserCurrent()) {
|
||||
Router::Location(Config::Get('path.root.web').'/');
|
||||
}
|
||||
|
||||
$this->Viewer_AddHtmlTitle($this->Lang_Get('reactivation'));
|
||||
$this->Viewer_AddHtmlTitle($this->Lang_Get('reactivation'));
|
||||
}
|
||||
/**
|
||||
* Ajax повторной активации
|
||||
*/
|
||||
protected function EventAjaxReactivation() {
|
||||
$this->Viewer_SetResponseAjax('json');
|
||||
|
||||
}
|
||||
if ((func_check(getRequest('mail'), 'mail') and $oUser = $this->User_GetUserByMail(getRequest('mail')))) {
|
||||
if ($oUser->getActivate()) {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('registration_activate_error_reactivate'));
|
||||
return;
|
||||
} else {
|
||||
$oUser->setActivateKey(md5(func_generator() . time()));
|
||||
if ($this->User_Update($oUser)) {
|
||||
$this->Message_AddNotice($this->Lang_Get('reactivation_send_link'));
|
||||
$this->Notify_SendReactivationCode($oUser);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajax повторной активации
|
||||
*/
|
||||
protected function EventAjaxReactivation()
|
||||
{
|
||||
$this->Viewer_SetResponseAjax('json');
|
||||
|
||||
if ((func_check(getRequest('mail'), 'mail') and $oUser = $this->User_GetUserByMail(getRequest('mail')))) {
|
||||
if ($oUser->getActivate()) {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('registration_activate_error_reactivate'));
|
||||
return;
|
||||
} else {
|
||||
$oUser->setActivateKey(md5(func_generator() . time()));
|
||||
if ($this->User_Update($oUser)) {
|
||||
$this->Message_AddNotice($this->Lang_Get('reactivation_send_link'));
|
||||
$this->Notify_SendReactivationCode($oUser);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('password_reminder_bad_email'));
|
||||
}
|
||||
|
||||
/**
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('password_reminder_bad_email'));
|
||||
}
|
||||
/**
|
||||
* Обрабатываем процесс залогинивания
|
||||
* По факту только отображение шаблона, дальше вступает в дело Ajax
|
||||
*
|
||||
|
|
|
@ -811,8 +811,8 @@ class ModuleNotify extends Module {
|
|||
public function GetTemplatePath($sName,$sPluginName=null) {
|
||||
if ($sPluginName) {
|
||||
$sPluginName = preg_match('/^Plugin([\w]+)(_[\w]+)?$/Ui',$sPluginName,$aMatches)
|
||||
? strtolower($aMatches[1])
|
||||
: strtolower($sPluginName);
|
||||
? strtolower($aMatches[1])
|
||||
: strtolower($sPluginName);
|
||||
|
||||
$sLangDir=Plugin::GetTemplatePath($sPluginName).'notify/'.$this->Lang_GetLang();
|
||||
if(is_dir($sLangDir)) {
|
||||
|
@ -822,9 +822,9 @@ class ModuleNotify extends Module {
|
|||
} else {
|
||||
$sLangDir = 'notify/'.$this->Lang_GetLang();
|
||||
/**
|
||||
* Если директория с сообщениями на текущем языке отсутствует,
|
||||
* используем язык по умолчанию
|
||||
*/
|
||||
* Если директория с сообщениями на текущем языке отсутствует,
|
||||
* используем язык по умолчанию
|
||||
*/
|
||||
if(is_dir(rtrim(Config::Get('path.smarty.template'),'/').'/'.$sLangDir)) {
|
||||
return $sLangDir.'/'.$sName;
|
||||
}
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
var ls = ls || {};
|
||||
|
||||
/**
|
||||
* Управление пользователями
|
||||
*/
|
||||
* Управление пользователями
|
||||
*/
|
||||
ls.user = (function ($) {
|
||||
|
||||
this.jcropAvatar=null;
|
||||
this.jcropFoto=null;
|
||||
|
||||
/**
|
||||
* Добавление в друзья
|
||||
*/
|
||||
* Добавление в друзья
|
||||
*/
|
||||
this.addFriend = function(obj, idUser, sAction){
|
||||
if(sAction != 'link' && sAction != 'accept') {
|
||||
var sText = $('#add_friend_text').val();
|
||||
|
@ -47,8 +47,8 @@ ls.user = (function ($) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Удаление из друзей
|
||||
*/
|
||||
* Удаление из друзей
|
||||
*/
|
||||
this.removeFriend = function(obj,idUser,sAction) {
|
||||
var url = aRouter.profile+'ajaxfrienddelete/';
|
||||
var params = {idUser: idUser,sAction: sAction};
|
||||
|
@ -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]);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -412,7 +412,7 @@ return array(
|
|||
'user_login_submit' => 'Login',
|
||||
'user_login_remember' => 'Remember me',
|
||||
'user_login_bad' => 'Something is wrong! Wrong login (e-mail) or password?.',
|
||||
'user_not_activated' => 'You have not activated your account. <br/> <a href="%%reactivation_path%%">Re-activation request</a>',
|
||||
'user_not_activated' => 'You have not activated your account. <br/> <a href="%%reactivation_path%%">Re-activation request</a>',
|
||||
'user_password' => 'Password',
|
||||
'user_password_reminder' => 'Password reminder',
|
||||
'user_exit_notice' => 'Please come again.',
|
||||
|
@ -500,12 +500,12 @@ return array(
|
|||
'registration_captcha_error' => 'Wrong code',
|
||||
'registration_submit' => 'Submit registration',
|
||||
'registration_ok' => 'Congratulation with successful registration!',
|
||||
/**
|
||||
* Re-activation
|
||||
*/
|
||||
"reactivation" => "Re-activation request",
|
||||
"reactivation_submit" => "Get a link to the activation",
|
||||
"reactivation_send_link" => "Activation link is sent to your e-mail.",
|
||||
/**
|
||||
* Re-activation
|
||||
*/
|
||||
"reactivation" => "Re-activation request",
|
||||
"reactivation_submit" => "Get a link to the activation",
|
||||
"reactivation_send_link" => "Activation link is sent to your e-mail.",
|
||||
/**
|
||||
* Vote for users
|
||||
*/
|
||||
|
@ -966,7 +966,7 @@ return array(
|
|||
'notify_subject_reminder_password' => 'New password',
|
||||
'notify_subject_wall_reply' => 'You\'ve recieved reply to your post on wall',
|
||||
'notify_subject_wall_new' => 'You\'ve recieved new post on your wall',
|
||||
'notify_subject_reactvation' => 'Re-activation request',
|
||||
'notify_subject_reactvation' => 'Re-activation request',
|
||||
/**
|
||||
* Админка
|
||||
*/
|
||||
|
|
|
@ -501,12 +501,12 @@ return array(
|
|||
'registration_submit' => 'Зарегистрироваться',
|
||||
'registration_ok' => 'Поздравляем! Регистрация прошла успешно',
|
||||
|
||||
/**
|
||||
* Повторный запрос активации
|
||||
*/
|
||||
"reactivation" => "Повторный запрос активации",
|
||||
"reactivation_submit" => "Получить ссылку на активацию",
|
||||
"reactivation_send_link" => "Ссылка для активации отправлена на ваш адрес электронной почты.",
|
||||
/**
|
||||
* Повторный запрос активации
|
||||
*/
|
||||
"reactivation" => "Повторный запрос активации",
|
||||
"reactivation_submit" => "Получить ссылку на активацию",
|
||||
"reactivation_send_link" => "Ссылка для активации отправлена на ваш адрес электронной почты.",
|
||||
|
||||
/**
|
||||
* Голосование за пользователя
|
||||
|
|
|
@ -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'}
|
|
@ -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>
|
|
@ -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>
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue