diff --git a/application/classes/modules/acl/ACL.class.php b/application/classes/modules/acl/ACL.class.php index 9bd60af2..04c3ff15 100644 --- a/application/classes/modules/acl/ACL.class.php +++ b/application/classes/modules/acl/ACL.class.php @@ -292,6 +292,12 @@ class ModuleACL extends Module if ($oTopicCommentVote = $that->Vote_GetVote($oComment->getId(), 'comment', $oUser->getId())) { return $that->Lang_Get('vote.notices.error_already_voted'); } + /** + * Разрешаем админу + */ + if ($oUser->isAdministrator()) { + return true; + } /** * Ограничение по рейтингу */ @@ -337,6 +343,12 @@ class ModuleACL extends Module if ($oTopicVote = $that->Vote_GetVote($oTopic->getId(), 'topic', $oUser->getId())) { return $that->Lang_Get('vote.notices.error_already_voted'); } + /** + * Разрешаем админу + */ + if ($oUser->isAdministrator()) { + return true; + } /** * Время голосования истекло? */ @@ -637,7 +649,8 @@ class ModuleACL extends Module * Проверяем права на просмотр топика */ if ((!$oTopic->getPublish() or $oTopic->getDatePublish() > date('Y-m-d H:i:s')) - and (!$oUser or ($oUser->getId() != $oTopic->getUserId() and !$oUser->isAdministrator()))) { + and (!$oUser or ($oUser->getId() != $oTopic->getUserId() and !$oUser->isAdministrator())) + ) { return false; } /** diff --git a/application/classes/modules/user/entity/User.entity.class.php b/application/classes/modules/user/entity/User.entity.class.php index 774319d7..d3173e5f 100644 --- a/application/classes/modules/user/entity/User.entity.class.php +++ b/application/classes/modules/user/entity/User.entity.class.php @@ -554,11 +554,11 @@ class ModuleUser_EntityUser extends Entity /** * Возвращает статус администратора сайта * - * @return bool|null + * @return bool */ public function isAdministrator() { - return $this->getAdmin(); + return (bool)$this->getAdmin(); } /**