mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-05-19 01:08:19 +03:00
fix #653
This commit is contained in:
parent
fd1946a995
commit
1482a17760
|
@ -1048,14 +1048,21 @@ class ActionBlog extends Action
|
|||
$aBlogAdministratorsResult = $this->Blog_GetBlogUsersByBlogId($oBlog->getId(),
|
||||
ModuleBlog::BLOG_USER_ROLE_ADMINISTRATOR);
|
||||
$aBlogAdministrators = $aBlogAdministratorsResult['collection'];
|
||||
/**
|
||||
* Для админов проекта получаем список блогов и передаем их во вьювер
|
||||
*/
|
||||
if ($this->oUserCurrent and $this->oUserCurrent->isAdministrator()) {
|
||||
$aBlogs = $this->Blog_GetBlogs();
|
||||
unset($aBlogs[$oBlog->getId()]);
|
||||
|
||||
$this->Viewer_Assign('blogs', $aBlogs);
|
||||
if ($this->oUserCurrent) {
|
||||
/**
|
||||
* Для админов проекта получаем список блогов и передаем их во вьювер
|
||||
*/
|
||||
if ($this->oUserCurrent->isAdministrator()) {
|
||||
$aBlogs = $this->Blog_GetBlogs();
|
||||
unset($aBlogs[$oBlog->getId()]);
|
||||
|
||||
$this->Viewer_Assign('blogs', $aBlogs);
|
||||
}
|
||||
/**
|
||||
* Текущая роль пользователя в блоге
|
||||
*/
|
||||
$this->Viewer_Assign('blogUserCurrent', $this->Blog_GetBlogUserByBlogIdAndUserId($oBlog->getId(), $this->oUserCurrent->getId()));
|
||||
}
|
||||
/**
|
||||
* Вызов хуков
|
||||
|
|
|
@ -67,6 +67,16 @@ class ModuleBlog_EntityBlogUser extends Entity
|
|||
return ($this->getUserRole() == ModuleBlog::BLOG_USER_ROLE_ADMINISTRATOR);
|
||||
}
|
||||
|
||||
/**
|
||||
* Возвращает статус бана пользователя
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getIsBanned()
|
||||
{
|
||||
return ($this->getUserRole() == ModuleBlog::BLOG_USER_ROLE_BAN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Возвращает текущую роль пользователя в блоге
|
||||
*
|
||||
|
|
|
@ -27,8 +27,7 @@
|
|||
{$smarty.block.parent}
|
||||
|
||||
{* Сообщение для забаненного пользователя *}
|
||||
{* TODO: Вывод сообщения о бане *}
|
||||
{if false}
|
||||
{if $blogUserCurrent and $blogUserCurrent->getIsBanned()}
|
||||
{component 'alert' text=$aLang.blog.alerts.banned mods='error'}
|
||||
{/if}
|
||||
|
||||
|
|
Loading…
Reference in a new issue