1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-26 03:30:48 +03:00

reactivation

This commit is contained in:
Igor Khohlov 2012-06-13 11:46:40 +03:00
parent 7c3afec126
commit 869bd577fa
9 changed files with 242 additions and 84 deletions

View file

@ -44,9 +44,11 @@ class ActionLogin extends Action {
$this->AddEvent('index','EventLogin');
$this->AddEvent('exit','EventExit');
$this->AddEvent('reminder','EventReminder');
$this->AddEvent('reactivation','EventReactivation');
$this->AddEvent('ajax-login','EventAjaxLogin');
$this->AddEvent('ajax-reminder','EventAjaxReminder');
$this->AddEvent('ajax-reactivation','EventAjaxReactivation');
}
/**
* Ajax авторизация
@ -70,7 +72,12 @@ class ActionLogin extends Action {
/**
* Сверяем хеши паролей и проверяем активен ли юзер
*/
if ($oUser->getPassword()==func_encrypt(getRequest('password')) and $oUser->getActivate()) {
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;
}
$bRemember=getRequest('remember',false) ? true : false;
/**
* Авторизуем
@ -89,7 +96,45 @@ class ActionLogin extends Action {
}
$this->Message_AddErrorSingle($this->Lang_Get('user_login_bad'));
}
/**
/**
* Повторный запрос активации
*/
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()
{
$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'));
}
/**
* Обрабатываем процесс залогинивания
* По факту только отображение шаблона, дальше вступает в дело Ajax
*

View file

@ -32,7 +32,7 @@ class ModuleNotify extends Module {
protected $oViewerLocal=null;
/**
* Массив заданий на удаленную публикацию
*
*
* @var array
*/
protected $aTask=array();
@ -48,14 +48,14 @@ class ModuleNotify extends Module {
* Момент довольно спорный, но позволяет избавить основной шаблон от мусора уведомлений
*
*/
public function Init() {
public function Init() {
if (!class_exists('ModuleViewer')) {
require_once(Config::Get('path.root.engine')."/modules/viewer/Viewer.class.php");
}
$this->oViewerLocal=$this->Viewer_GetLocalViewer();
$this->oMapper=Engine::GetMapper(__CLASS__);
}
/**
* Отправляет юзеру уведомление о новом комментарии в его топике
*
@ -82,15 +82,15 @@ class ModuleNotify extends Module {
* Формируем шаблон
*/
$sBody=$this->oViewerLocal->Fetch($this->GetTemplatePath('notify.comment_new.tpl'));
/**
* Если в конфигураторе указан отложенный метод отправки,
* Если в конфигураторе указан отложенный метод отправки,
* то добавляем задание в массив. В противном случае,
* сразу отсылаем на email
*/
if(Config::Get('module.notify.delayed')) {
$oNotifyTask=Engine::GetEntity(
'Notify_Task',
'Notify_Task',
array(
'user_mail' => $oUserTo->getMail(),
'user_login' => $oUserTo->getLogin(),
@ -114,9 +114,9 @@ class ModuleNotify extends Module {
$this->Mail_SetBody($sBody);
$this->Mail_setHTML();
$this->Mail_Send();
}
}
}
/**
* Отправляет юзеру уведомление об ответе на его комментарий
*
@ -144,13 +144,13 @@ class ModuleNotify extends Module {
*/
$sBody=$this->oViewerLocal->Fetch($this->GetTemplatePath('notify.comment_reply.tpl'));
/**
* Если в конфигураторе указан отложенный метод отправки,
* Если в конфигураторе указан отложенный метод отправки,
* то добавляем задание в массив. В противном случае,
* сразу отсылаем на email
*/
if(Config::Get('module.notify.delayed')) {
$oNotifyTask=Engine::GetEntity(
'Notify_Task',
'Notify_Task',
array(
'user_mail' => $oUserTo->getMail(),
'user_login' => $oUserTo->getLogin(),
@ -176,7 +176,7 @@ class ModuleNotify extends Module {
$this->Mail_Send();
}
}
/**
* Отправляет юзеру уведомление о новом топике в блоге, в котором он состоит
*
@ -204,13 +204,13 @@ class ModuleNotify extends Module {
*/
$sBody=$this->oViewerLocal->Fetch($this->GetTemplatePath('notify.topic_new.tpl'));
/**
* Если в конфигураторе указан отложенный метод отправки,
* Если в конфигураторе указан отложенный метод отправки,
* то добавляем задание в массив. В противном случае,
* сразу отсылаем на email
*/
if(Config::Get('module.notify.delayed')) {
$oNotifyTask=Engine::GetEntity(
'Notify_Task',
'Notify_Task',
array(
'user_mail' => $oUserTo->getMail(),
'user_login' => $oUserTo->getLogin(),
@ -225,7 +225,7 @@ class ModuleNotify extends Module {
} else {
$this->oMapper->AddTask($oNotifyTask);
}
} else {
} else {
/**
* Отправляем мыло
*/
@ -236,24 +236,48 @@ class ModuleNotify extends Module {
$this->Mail_Send();
}
}
/**
* Отправляет уведомление с новым линком активации
*
* @param ModuleUser_EntityUser $oUser
*/
public function SendReactivationCode(ModuleUser_EntityUser $oUser) {
/**
* Передаём в шаблон переменные
*/
$this->oViewerLocal->Assign('oUser',$oUser);
/**
* Формируем шаблон
*/
$sBody=$this->oViewerLocal->Fetch($this->GetTemplatePath('notify.reactivation.tpl'));
/**
* Отправляем мыло
*/
$this->Mail_SetAdress($oUser->getMail(),$oUser->getLogin());
$this->Mail_SetSubject($this->Lang_Get('notify_subject_reactvation'));
$this->Mail_SetBody($sBody);
$this->Mail_setHTML();
$this->Mail_Send();
}
/**
* Отправляет уведомление при регистрации с активацией
*
* @param ModuleUser_EntityUser $oUser
* @param string $sPassword
*/
public function SendRegistrationActivate(ModuleUser_EntityUser $oUser,$sPassword) {
public function SendRegistrationActivate(ModuleUser_EntityUser $oUser,$sPassword) {
/**
* Передаём в шаблон переменные
*/
$this->oViewerLocal->Assign('oUser',$oUser);
$this->oViewerLocal->Assign('oUser',$oUser);
$this->oViewerLocal->Assign('sPassword',$sPassword);
/**
* Формируем шаблон
*/
$sBody=$this->oViewerLocal->Fetch($this->GetTemplatePath('notify.registration_activate.tpl'));
/**
* Отправляем мыло
*/
@ -263,24 +287,24 @@ class ModuleNotify extends Module {
$this->Mail_setHTML();
$this->Mail_Send();
}
/**
* Отправляет уведомление о регистрации
*
* @param ModuleUser_EntityUser $oUser
* @param string $sPassword
*/
public function SendRegistration(ModuleUser_EntityUser $oUser,$sPassword) {
public function SendRegistration(ModuleUser_EntityUser $oUser,$sPassword) {
/**
* Передаём в шаблон переменные
*/
$this->oViewerLocal->Assign('oUser',$oUser);
$this->oViewerLocal->Assign('oUser',$oUser);
$this->oViewerLocal->Assign('sPassword',$sPassword);
/**
* Формируем шаблон
*/
$sBody=$this->oViewerLocal->Fetch($this->GetTemplatePath('notify.registration.tpl'));
/**
* Отправляем мыло
*/
@ -290,7 +314,7 @@ class ModuleNotify extends Module {
$this->Mail_setHTML();
$this->Mail_Send();
}
/**
* Отправляет инвайт
*
@ -298,25 +322,25 @@ class ModuleNotify extends Module {
* @param string $sMailTo
* @param ModuleUser_EntityInvite $oInvite
*/
public function SendInvite(ModuleUser_EntityUser $oUserFrom,$sMailTo,ModuleUser_EntityInvite $oInvite) {
public function SendInvite(ModuleUser_EntityUser $oUserFrom,$sMailTo,ModuleUser_EntityInvite $oInvite) {
/**
* Передаём в шаблон переменные
*/
$this->oViewerLocal->Assign('oUserFrom',$oUserFrom);
$this->oViewerLocal->Assign('sMailTo',$sMailTo);
$this->oViewerLocal->Assign('oUserFrom',$oUserFrom);
$this->oViewerLocal->Assign('sMailTo',$sMailTo);
$this->oViewerLocal->Assign('oInvite',$oInvite);
/**
* Формируем шаблон
*/
$sBody=$this->oViewerLocal->Fetch('notify/'.$this->Lang_GetLang()."/notify.invite.tpl");
/**
* Если в конфигураторе указан отложенный метод отправки,
* Если в конфигураторе указан отложенный метод отправки,
* то добавляем задание в массив. В противном случае,
* сразу отсылаем на email
*/
if(Config::Get('module.notify.delayed')) {
$oNotifyTask=Engine::GetEntity(
'Notify_Task',
'Notify_Task',
array(
'user_mail' => $sMailTo,
'user_login' => null,
@ -331,7 +355,7 @@ class ModuleNotify extends Module {
} else {
$this->oMapper->AddTask($oNotifyTask);
}
} else {
} else {
/**
* Отправляем мыло
*/
@ -342,7 +366,7 @@ class ModuleNotify extends Module {
$this->Mail_Send();
}
}
/**
* Отправляет уведомление при новом личном сообщении
*
@ -361,20 +385,20 @@ class ModuleNotify extends Module {
* Передаём в шаблон переменные
*/
$this->oViewerLocal->Assign('oUserTo',$oUserTo);
$this->oViewerLocal->Assign('oUserFrom',$oUserFrom);
$this->oViewerLocal->Assign('oUserFrom',$oUserFrom);
$this->oViewerLocal->Assign('oTalk',$oTalk);
/**
* Формируем шаблон
*/
$sBody=$this->oViewerLocal->Fetch($this->GetTemplatePath('notify.talk_new.tpl'));
/**
* Если в конфигураторе указан отложенный метод отправки,
* Если в конфигураторе указан отложенный метод отправки,
* то добавляем задание в массив. В противном случае,
* сразу отсылаем на email
*/
if(Config::Get('module.notify.delayed')) {
$oNotifyTask=Engine::GetEntity(
'Notify_Task',
'Notify_Task',
array(
'user_mail' => $oUserTo->getMail(),
'user_login' => $oUserTo->getLogin(),
@ -389,7 +413,7 @@ class ModuleNotify extends Module {
} else {
$this->oMapper->AddTask($oNotifyTask);
}
} else {
} else {
/**
* Отправляем мыло
*/
@ -400,7 +424,7 @@ class ModuleNotify extends Module {
$this->Mail_Send();
}
}
public function SendTalkCommentNew(ModuleUser_EntityUser $oUserTo,ModuleUser_EntityUser $oUserFrom,ModuleTalk_EntityTalk $oTalk,ModuleComment_EntityComment $oTalkComment) {
/**
* Проверяем можно ли юзеру рассылать уведомление
@ -412,7 +436,7 @@ class ModuleNotify extends Module {
* Передаём в шаблон переменные
*/
$this->oViewerLocal->Assign('oUserTo',$oUserTo);
$this->oViewerLocal->Assign('oUserFrom',$oUserFrom);
$this->oViewerLocal->Assign('oUserFrom',$oUserFrom);
$this->oViewerLocal->Assign('oTalk',$oTalk);
$this->oViewerLocal->Assign('oTalkComment',$oTalkComment);
/**
@ -420,13 +444,13 @@ class ModuleNotify extends Module {
*/
$sBody=$this->oViewerLocal->Fetch($this->GetTemplatePath('notify.talk_comment_new.tpl'));
/**
* Если в конфигураторе указан отложенный метод отправки,
* Если в конфигураторе указан отложенный метод отправки,
* то добавляем задание в массив. В противном случае,
* сразу отсылаем на email
*/
if(Config::Get('module.notify.delayed')) {
$oNotifyTask=Engine::GetEntity(
'Notify_Task',
'Notify_Task',
array(
'user_mail' => $oUserTo->getMail(),
'user_login' => $oUserTo->getLogin(),
@ -441,7 +465,7 @@ class ModuleNotify extends Module {
} else {
$this->oMapper->AddTask($oNotifyTask);
}
} else {
} else {
/**
* Отправляем мыло
*/
@ -452,14 +476,14 @@ class ModuleNotify extends Module {
$this->Mail_Send();
}
}
/**
* Отправляет пользователю сообщение о добавлении его в друзья
*
* @param ModuleUser_EntityUser $oUserTo
* @param ModuleUser_EntityUser $oUserFrom
*/
public function SendUserFriendNew(ModuleUser_EntityUser $oUserTo,ModuleUser_EntityUser $oUserFrom, $sText,$sPath) {
public function SendUserFriendNew(ModuleUser_EntityUser $oUserTo,ModuleUser_EntityUser $oUserFrom, $sText,$sPath) {
/**
* Проверяем можно ли юзеру рассылать уведомление
*/
@ -470,22 +494,22 @@ class ModuleNotify extends Module {
* Передаём в шаблон переменные
*/
$this->oViewerLocal->Assign('oUserTo',$oUserTo);
$this->oViewerLocal->Assign('oUserFrom',$oUserFrom);
$this->oViewerLocal->Assign('oUserFrom',$oUserFrom);
$this->oViewerLocal->Assign('sText',$sText);
$this->oViewerLocal->Assign('sPath',$sPath);
/**
* Формируем шаблон
*/
$sBody=$this->oViewerLocal->Fetch($this->GetTemplatePath('notify.user_friend_new.tpl'));
/**
* Если в конфигураторе указан отложенный метод отправки,
* Если в конфигураторе указан отложенный метод отправки,
* то добавляем задание в массив. В противном случае,
* сразу отсылаем на email
*/
if(Config::Get('module.notify.delayed')) {
$oNotifyTask=Engine::GetEntity(
'Notify_Task',
'Notify_Task',
array(
'user_mail' => $oUserTo->getMail(),
'user_login' => $oUserTo->getLogin(),
@ -500,7 +524,7 @@ class ModuleNotify extends Module {
} else {
$this->oMapper->AddTask($oNotifyTask);
}
} else {
} else {
/**
* Отправляем мыло
*/
@ -518,27 +542,27 @@ class ModuleNotify extends Module {
* @param ModuleUser_EntityUser $oUserTo
* @param ModuleUser_EntityUser $oUserFrom
*/
public function SendBlogUserInvite(ModuleUser_EntityUser $oUserTo,ModuleUser_EntityUser $oUserFrom, ModuleBlog_EntityBlog $oBlog,$sPath) {
public function SendBlogUserInvite(ModuleUser_EntityUser $oUserTo,ModuleUser_EntityUser $oUserFrom, ModuleBlog_EntityBlog $oBlog,$sPath) {
/**
* Передаём в шаблон переменные
*/
$this->oViewerLocal->Assign('oUserTo',$oUserTo);
$this->oViewerLocal->Assign('oUserFrom',$oUserFrom);
$this->oViewerLocal->Assign('oUserFrom',$oUserFrom);
$this->oViewerLocal->Assign('oBlog',$oBlog);
$this->oViewerLocal->Assign('sPath',$sPath);
/**
* Формируем шаблон
*/
$sBody=$this->oViewerLocal->Fetch($this->GetTemplatePath('notify.blog_invite_new.tpl'));
/**
* Если в конфигураторе указан отложенный метод отправки,
* Если в конфигураторе указан отложенный метод отправки,
* то добавляем задание в массив. В противном случае,
* сразу отсылаем на email
*/
if(Config::Get('module.notify.delayed')) {
$oNotifyTask=Engine::GetEntity(
'Notify_Task',
'Notify_Task',
array(
'user_mail' => $oUserTo->getMail(),
'user_login' => $oUserTo->getLogin(),
@ -553,7 +577,7 @@ class ModuleNotify extends Module {
} else {
$this->oMapper->AddTask($oNotifyTask);
}
} else {
} else {
/**
* Отправляем мыло
*/
@ -563,19 +587,19 @@ class ModuleNotify extends Module {
$this->Mail_setHTML();
$this->Mail_Send();
}
}
}
/**
* Уведомление при восстановлении пароля
*
* @param ModuleUser_EntityUser $oUser
* @param ModuleUser_EntityReminder $oReminder
*/
public function SendReminderCode(ModuleUser_EntityUser $oUser,ModuleUser_EntityReminder $oReminder) {
public function SendReminderCode(ModuleUser_EntityUser $oUser,ModuleUser_EntityReminder $oReminder) {
/**
* Передаём в шаблон переменные
*/
$this->oViewerLocal->Assign('oUser',$oUser);
$this->oViewerLocal->Assign('oUser',$oUser);
$this->oViewerLocal->Assign('oReminder',$oReminder);
/**
* Формируем шаблон
@ -597,11 +621,11 @@ class ModuleNotify extends Module {
* @param ModuleUser_EntityUser $oUser
* @param unknown_type $sNewPassword
*/
public function SendReminderPassword(ModuleUser_EntityUser $oUser,$sNewPassword) {
public function SendReminderPassword(ModuleUser_EntityUser $oUser,$sNewPassword) {
/**
* Передаём в шаблон переменные
*/
$this->oViewerLocal->Assign('oUser',$oUser);
$this->oViewerLocal->Assign('oUser',$oUser);
$this->oViewerLocal->Assign('sNewPassword',$sNewPassword);
/**
* Формируем шаблон
@ -669,7 +693,7 @@ class ModuleNotify extends Module {
* @param unknown_type $aAssign - ассоциативный массив для загрузки переменных в шаблон письма
* @param unknown_type $sPluginName - плагин из которого происходит отправка
*/
public function Send($oUserTo,$sTemplate,$sSubject,$aAssign=array(),$sPluginName=null) {
public function Send($oUserTo,$sTemplate,$sSubject,$aAssign=array(),$sPluginName=null) {
if ($oUserTo instanceof ModuleUser_EntityUser) {
$sMail=$oUserTo->getMail();
$sName=$oUserTo->getLogin();
@ -682,19 +706,19 @@ class ModuleNotify extends Module {
*/
foreach ($aAssign as $k=>$v) {
$this->oViewerLocal->Assign($k,$v);
}
}
/**
* Формируем шаблон
*/
$sBody=$this->oViewerLocal->Fetch($this->GetTemplatePath($sTemplate,$sPluginName));
/**
* Если в конфигураторе указан отложенный метод отправки,
* Если в конфигураторе указан отложенный метод отправки,
* то добавляем задание в массив. В противном случае,
* сразу отсылаем на email
*/
if(Config::Get('module.notify.delayed')) {
$oNotifyTask=Engine::GetEntity(
'Notify_Task',
'Notify_Task',
array(
'user_mail' => $sMail,
'user_login' => $sName,
@ -709,7 +733,7 @@ class ModuleNotify extends Module {
} else {
$this->oMapper->AddTask($oNotifyTask);
}
} else {
} else {
/**
* Отправляем мыло
*/
@ -720,22 +744,22 @@ class ModuleNotify extends Module {
$this->Mail_Send();
}
}
/**
* При завершении работы модуля проверяем наличие
* При завершении работы модуля проверяем наличие
* отложенных заданий в массиве и при необходимости
* передаем их в меппер
*/
*/
public function Shutdown() {
if(!empty($this->aTask) && Config::Get('module.notify.delayed')) {
$this->oMapper->AddTaskArray($this->aTask);
$this->aTask=array();
}
}
/**
* Получает массив заданий на публикацию из базы
* Получает массив заданий на публикацию из базы
* с указанным количественным ограничением (выборка FIFO)
*
* @param int $iLimit
@ -747,7 +771,7 @@ class ModuleNotify extends Module {
: array();
}
/**
* Отправляет на e-mail
* Отправляет на e-mail
*
* @param ModuleNotify_EntityTask $oTask
*/
@ -771,12 +795,12 @@ class ModuleNotify extends Module {
* Удаляет отложенные Notify-задания по списку идентификаторов
*
* @param array $aArrayId
* @return bool
* @return bool
*/
public function DeleteTaskByArrayId($aArrayId) {
return $this->oMapper->DeleteTaskByArrayId($aArrayId);
}
/**
* Возвращает путь к шаблону по переданному имени
*
@ -784,12 +808,12 @@ class ModuleNotify extends Module {
* @param string $sPluginName
* @return string
*/
public function GetTemplatePath($sName,$sPluginName=null) {
public function GetTemplatePath($sName,$sPluginName=null) {
if ($sPluginName) {
$sPluginName = preg_match('/^Plugin([\w]+)(_[\w]+)?$/Ui',$sPluginName,$aMatches)
? strtolower($aMatches[1])
: strtolower($sPluginName);
$sLangDir=Plugin::GetTemplatePath($sPluginName).'notify/'.$this->Lang_GetLang();
if(is_dir($sLangDir)) {
return $sLangDir.'/'.$sName;

View file

@ -51,6 +51,7 @@ class ModuleUser_MapperUser extends Mapper {
user_rating = ? ,
user_count_vote = ? ,
user_activate = ? ,
user_activate_key = ? ,
user_profile_name = ? ,
user_profile_sex = ? ,
user_profile_country = ? ,
@ -76,6 +77,7 @@ class ModuleUser_MapperUser extends Mapper {
$oUser->getRating(),
$oUser->getCountVote(),
$oUser->getActivate(),
$oUser->getActivateKey(),
$oUser->getProfileName(),
$oUser->getProfileSex(),
$oUser->getProfileCountry(),
@ -676,8 +678,8 @@ class ModuleUser_MapperUser extends Mapper {
public function getUserFieldValueByName($iUserId, $sName) {
$sql = 'SELECT value FROM '.Config::Get('db.table.user_field_value').' WHERE
user_id = ?d
AND
user_id = ?d
AND
field_id = (SELECT id FROM '.Config::Get('db.table.user_field').' WHERE name =?)';
$ret = $this->oDb->selectCol($sql, $iUserId, $sName);
return $ret[0];

View file

@ -24,9 +24,9 @@ ls.user = (function ($) {
} else {
var url = aRouter.profile+'ajaxfriendadd/';
}
var params = {idUser: idUser, userText: sText};
ls.hook.marker('addFriendBefore');
ls.ajax(url, params, function(result){
$('#add_friend_form').children().each(function(i, item){$(item).removeAttr('disabled')});
@ -52,7 +52,7 @@ ls.user = (function ($) {
this.removeFriend = function(obj,idUser,sAction) {
var url = aRouter.profile+'ajaxfrienddelete/';
var params = {idUser: idUser,sAction: sAction};
ls.hook.marker('removeFriendBefore');
ls.ajax(url, params, function(result) {
if (result.bStateError) {
@ -423,6 +423,35 @@ ls.user = (function ($) {
});
};
/**
* Ajax запрос на ссылку активации
* @param form
*/
this.reminder = function(form) {
var url = aRouter.login+'ajax-reactivation/';
ls.hook.marker('reactivationBefore');
ls.ajaxSubmit(url, form, function(result) {
if (typeof(form)=='string') {
form=$('#'+form);
}
form.find('.validate-error-show').removeClass('validate-error-show').addClass('validate-error-hide');
if (result.bStateError) {
form.find('.validate-error-reactivation').removeClass('validate-error-hide').addClass('validate-error-show').text(result.sMsg);
} else {
form.find('input').val('');
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]);
}
});
};
/**
* Поиск пользователей
*/
@ -475,13 +504,13 @@ ls.user = (function ($) {
* Подписка
*/
this.followToggle = function(obj, iUserId) {
if ($(obj).hasClass('followed')) {
if ($(obj).hasClass('followed')) {
ls.stream.unsubscribe(iUserId);
$(obj).toggleClass('followed').text(ls.lang.get('profile_user_follow'));
} else {
} else {
ls.stream.subscribe(iUserId);
$(obj).toggleClass('followed').text(ls.lang.get('profile_user_unfollow'));
}
}
return false;
};

View file

@ -412,6 +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_password' => 'Password',
'user_password_reminder' => 'Password reminder',
'user_exit_notice' => 'Please come again.',
@ -499,6 +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.",
/**
* Vote for users
*/
@ -959,6 +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',
/**
* Админка
*/

View file

@ -412,6 +412,7 @@ return array(
'user_login_submit' => 'Войти',
'user_login_remember' => 'Запомнить меня',
'user_login_bad' => 'Что-то не так! Вероятно, неправильно указан логин (e-mail) или пароль.',
'user_not_activated' => 'Вы не активировали вашу учетную запись. <br/> <a href="%%reactivation_path%%">Повторный запрос активации</a>',
'user_password' => 'Пароль',
'user_password_reminder' => 'Напомнить пароль',
'user_exit_notice' => 'Обязательно приходите еще.',
@ -499,6 +500,14 @@ return array(
'registration_captcha_error' => 'Неверный код',
'registration_submit' => 'Зарегистрироваться',
'registration_ok' => 'Поздравляем! Регистрация прошла успешно',
/**
* Повторный запрос активации
*/
"reactivation" => "Повторный запрос активации",
"reactivation_submit" => "Получить ссылку на активацию",
"reactivation_send_link" => "Ссылка для активации отправлена на ваш адрес электронной почты.",
/**
* Голосование за пользователя
*/
@ -959,6 +968,7 @@ return array(
'notify_subject_reminder_password' => 'Новый пароль',
'notify_subject_wall_reply' => 'Ответ на ваше сообщение на стене',
'notify_subject_wall_new' => 'Новое сообщение на вашей стене',
'notify_subject_reactvation' => 'Повторный запрос активации',
/**
* Админка
*/

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.reminder('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>