mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-06-16 23:00:51 +03:00
Доработка жалоб - уведомление админу на емайл
This commit is contained in:
parent
e49afcb41f
commit
f510d16d3c
|
@ -150,11 +150,17 @@ class ActionProfile extends Action {
|
|||
*/
|
||||
$oComplaint->setText(htmlspecialchars($oComplaint->getText()));
|
||||
if ($this->User_AddComplaint($oComplaint)) {
|
||||
$this->Message_AddNotice($this->Lang_Get('user_complaint_submit_result'),$this->Lang_Get('attention'));
|
||||
/**
|
||||
* Убиваем каптчу
|
||||
*/
|
||||
$this->Message_AddNotice($this->Lang_Get('user_complaint_submit_result'),$this->Lang_Get('attention'));
|
||||
unset($_SESSION['captcha_keystring_complaint_user']);
|
||||
/**
|
||||
* Отправляем уведомление админу
|
||||
*/
|
||||
if (Config::Get('module.user.complaint_notify_by_mail')) {
|
||||
$this->Notify_SendUserComplaint($oComplaint);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
$this->Message_AddError($this->Lang_Get('user_note_save_error'),$this->Lang_Get('error'));
|
||||
|
|
|
@ -406,6 +406,23 @@ class ModuleNotify extends Module {
|
|||
)
|
||||
);
|
||||
}
|
||||
/**
|
||||
* Уведомление администрации о новой жалобе
|
||||
*
|
||||
* @param $oComplaint
|
||||
*/
|
||||
public function SendUserComplaint($oComplaint) {
|
||||
$this->Send(
|
||||
Config::Get('general.admin_mail'),
|
||||
$this->sPrefix.'.user_complaint.tpl',
|
||||
$this->Lang_Get('notify_subject_user_complaint'),
|
||||
array(
|
||||
'oUserTarget' => $oComplaint->getTargetUser(),
|
||||
'oUserFrom' => $oComplaint->getUser(),
|
||||
'oComplaint' => $oComplaint,
|
||||
)
|
||||
);
|
||||
}
|
||||
/**
|
||||
* Универсальный метод отправки уведомлений на email
|
||||
*
|
||||
|
|
|
@ -70,4 +70,22 @@ class ModuleUser_EntityComplaint extends Entity {
|
|||
return $this->Lang_Get('user_complaint_type_error');
|
||||
}
|
||||
|
||||
|
||||
public function getUser() {
|
||||
if (!$this->_getDataOne('user')) {
|
||||
$this->_aData['user']=$this->User_GetUserById($this->getUserId());
|
||||
}
|
||||
return $this->_getDataOne('user');
|
||||
}
|
||||
|
||||
public function getTargetUser() {
|
||||
if (!$this->_getDataOne('target_user')) {
|
||||
$this->_aData['target_user']=$this->User_GetUserById($this->getTargetUserId());
|
||||
}
|
||||
return $this->_getDataOne('target_user');
|
||||
}
|
||||
|
||||
public function getTypeTitle() {
|
||||
return $this->Lang_Get('user_complaint_type_list.'.$this->getType());
|
||||
}
|
||||
}
|
|
@ -71,6 +71,7 @@ $config['general']['rss_editor_mail'] = '___sys.mail.from_email___'; // мыл
|
|||
$config['general']['reg']['invite'] = false; // использовать режим регистрации по приглашению или нет. Если использовать, то регистрация будет доступна ТОЛЬКО по приглашениям!
|
||||
$config['general']['reg']['activation'] = false; // использовать активацию при регистрации или нет
|
||||
$config['general']['login']['captcha'] = false; // использовать каптчу при входе или нет
|
||||
$config['general']['admin_mail'] = 'admin@admin.adm'; // email администратора
|
||||
|
||||
/**
|
||||
* Настройки ACL(Access Control List — список контроля доступа)
|
||||
|
|
|
@ -1164,6 +1164,7 @@ return array(
|
|||
'notify_subject_wall_new' => 'Новое сообщение на вашей стене',
|
||||
'notify_subject_reactvation' => 'Повторный запрос активации',
|
||||
'notify_subject_user_changemail' => 'Подтверждение смены емайла',
|
||||
'notify_subject_user_complaint' => 'Жалоба на пользователя',
|
||||
'notify_regards' => 'С уважением, администрация сайта',
|
||||
/**
|
||||
* Админка
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
{extends file='emails/email.base.tpl'}
|
||||
|
||||
{block name='content'}
|
||||
User «<a href="{$oUserFrom->getUserWebPath()}">{$oUserFrom->getDisplayName()}</a>» complain on the user «<a href="{$oUserTarget->getUserWebPath()}">{$oUserTarget->getDisplayName()}</a>».
|
||||
<br>
|
||||
<br>
|
||||
<b>Reason:</b> {$oComplaint->getTypeTitle()}<br/>
|
||||
{if $oComplaint->getText()}
|
||||
<b>Details:</b> {$oComplaint->getText()}<br/>
|
||||
{/if}
|
||||
{/block}
|
|
@ -0,0 +1,11 @@
|
|||
{extends file='emails/email.base.tpl'}
|
||||
|
||||
{block name='content'}
|
||||
Пользователь «<a href="{$oUserFrom->getUserWebPath()}">{$oUserFrom->getDisplayName()}</a>» пожаловался на пользователя «<a href="{$oUserTarget->getUserWebPath()}">{$oUserTarget->getDisplayName()}</a>».
|
||||
<br>
|
||||
<br>
|
||||
<b>Причина:</b> {$oComplaint->getTypeTitle()}<br/>
|
||||
{if $oComplaint->getText()}
|
||||
<b>Подробнее:</b> {$oComplaint->getText()}<br/>
|
||||
{/if}
|
||||
{/block}
|
Loading…
Reference in a new issue