mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-06-16 14:50:48 +03:00
fix #724
This commit is contained in:
parent
a435efe7d3
commit
5a02559269
|
@ -57,13 +57,7 @@ class ModuleACL extends Module
|
|||
if (!$oUser) {
|
||||
return false;
|
||||
}
|
||||
if ($oUser->isAdministrator()) {
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* Проверяем хватает ли рейтинга юзеру чтоб создать блог
|
||||
*/
|
||||
if ($oUser->getRating() < Config::Get('acl.create.blog.rating')) {
|
||||
if (!$oUser->isAllowCreateBlog()) {
|
||||
return $that->Lang_Get('blog.add.alerts.acl');
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -633,6 +633,19 @@ class ModuleUser_EntityUser extends Entity
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Проверка на возможность создания блога юзером
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isAllowCreateBlog()
|
||||
{
|
||||
if ($this->isAdministrator() or $this->getRating() >= Config::Get('acl.create.blog.rating')) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Устанавливает ID пользователя
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
{if $oUserCurrent}
|
||||
{capture 'block_content'}
|
||||
{if $oUserCurrent && ($oUserCurrent->getRating() > Config::Get('acl.create.blog.rating') or $oUserCurrent->isAdministrator())}
|
||||
{if $oUserCurrent && $oUserCurrent->isAllowCreateBlog()}
|
||||
<p>{$aLang.blog.can_add}</p>
|
||||
|
||||
{component 'button' url="{router page='blog'}add/" mods='primary large' text=$aLang.blog.create_blog}
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit fce2a720edf08e411eee114c3de1712294a5a08e
|
||||
Subproject commit 6e84853becbd465cfbb2e9bc721ad808206eaff7
|
Loading…
Reference in a new issue