1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-08 09:24:25 +03:00

Merge branch 'master' of git://github.com/livestreet/livestreet

This commit is contained in:
kpoxas 2012-09-04 00:43:59 +03:00
commit 86e4d1881e
5 changed files with 39 additions and 13 deletions

View file

@ -509,8 +509,12 @@ class ActionSettings extends Action {
* Подтверждение смены емайла
*/
if (getRequest('mail') and getRequest('mail')!=$this->oUserCurrent->getMail()) {
if ($this->User_MakeUserChangemail($this->oUserCurrent,getRequest('mail'))) {
$this->Message_AddNotice($this->Lang_Get('settings_profile_mail_change_from_notice'));
if ($oChangemail=$this->User_MakeUserChangemail($this->oUserCurrent,getRequest('mail'))) {
if ($oChangemail->getMailFrom()) {
$this->Message_AddNotice($this->Lang_Get('settings_profile_mail_change_from_notice'));
} else {
$this->Message_AddNotice($this->Lang_Get('settings_profile_mail_change_to_notice'));
}
}
}

View file

@ -34,7 +34,7 @@ class BlockUserfeedBlogs extends Block {
/**
* Получаем список ID блогов, в которых состоит пользователь
*/
$aBlogsId = $this->Blog_getBlogUsersByUserId($oUserCurrent->getId(), array(ModuleBlog::BLOG_USER_ROLE_USER,ModuleBlog::BLOG_USER_ROLE_MODERATOR,ModuleBlog::BLOG_USER_ROLE_ADMINISTRATOR),true);
$aBlogsId = $this->Blog_GetBlogUsersByUserId($oUserCurrent->getId(), array(ModuleBlog::BLOG_USER_ROLE_USER,ModuleBlog::BLOG_USER_ROLE_MODERATOR,ModuleBlog::BLOG_USER_ROLE_ADMINISTRATOR),true);
/**
* Получаем список ID блогов, которые создал пользователь
*/

View file

@ -1520,6 +1520,8 @@ class ModuleUser extends Module {
return $this->oMapper->GetUserChangemailByCodeTo($sCode);
}
/**
* Формирование процесса смены емайла в профиле пользователя
*
* @param ModuleUser_EntityUser $oUser Объект пользователя
* @param string $sMailNew Новый емайл
* @return bool|ModuleUser_EntityChangemail
@ -1529,21 +1531,40 @@ class ModuleUser extends Module {
$oChangemail->setUserId($oUser->getId());
$oChangemail->setDateAdd(date("Y-m-d H:i:s"));
$oChangemail->setDateExpired(date("Y-m-d H:i:s",time()+3*24*60*60)); // 3 дня для смены емайла
$oChangemail->setMailFrom($oUser->getMail());
$oChangemail->setMailFrom($oUser->getMail() ? $oUser->getMail() : '');
$oChangemail->setMailTo($sMailNew);
$oChangemail->setCodeFrom(func_generator(32));
$oChangemail->setCodeTo(func_generator(32));
if ($this->AddUserChangemail($oChangemail)) {
/**
* Отправляем уведомление
* Если у пользователя раньше не было емайла, то сразу шлем подтверждение на новый емайл
*/
$this->Notify_Send($oUser,
'notify.user_changemail_from.tpl',
$this->Lang_Get('notify_subject_user_changemail'),
array(
'oUser' => $oUser,
'oChangemail' => $oChangemail,
));
if (!$oChangemail->getMailFrom()) {
$oChangemail->setConfirmFrom(1);
$this->User_UpdateUserChangemail($oChangemail);
/**
* Отправляем уведомление на новый емайл
*/
$this->Notify_Send($oChangemail->getMailTo(),
'notify.user_changemail_to.tpl',
$this->Lang_Get('notify_subject_user_changemail'),
array(
'oUser' => $oUser,
'oChangemail' => $oChangemail,
));
} else {
/**
* Отправляем уведомление на старый емайл
*/
$this->Notify_Send($oUser,
'notify.user_changemail_from.tpl',
$this->Lang_Get('notify_subject_user_changemail'),
array(
'oUser' => $oUser,
'oChangemail' => $oChangemail,
));
}
return $oChangemail;
}
return false;

View file

@ -68,6 +68,7 @@ class PluginExample extends Plugin {
/*
$this->ExportSQL(dirname(__FILE__).'/deinstall.sql'); // Выполнить деактивационный sql, если надо.
*/
return true;
}

View file

@ -628,7 +628,7 @@ return array(
'settings_profile_mail_error_used' => 'Этот емайл уже занят',
'settings_profile_mail_notice' => 'Ваш реальный почтовый адрес, на него будут приходить уведомления',
'settings_profile_mail_change_from_notice' => 'На вашу старую почту отправлено подтверждение для смены емайла',
'settings_profile_mail_change_to_notice' => 'Спасибо! <br/> На ваш новый емайл адрес отправлено еще одно подтверждение.',
'settings_profile_mail_change_to_notice' => 'Спасибо! <br/> На ваш новый емайл адрес отправлено подтверждение для смены старого емайла.',
'settings_profile_mail_change_ok' => 'Ваш емайл изменен на <b>%%mail%%</b>',
'settings_profile_sex' => 'Пол',
'settings_profile_sex_man' => 'мужской',