1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-26 03:30:48 +03:00
This commit is contained in:
Mzhelskiy Maxim 2015-09-09 10:17:25 +07:00
parent 6a0efd8191
commit 7a8305ed09
2 changed files with 16 additions and 3 deletions

View file

@ -292,6 +292,12 @@ class ModuleACL extends Module
if ($oTopicCommentVote = $that->Vote_GetVote($oComment->getId(), 'comment', $oUser->getId())) { if ($oTopicCommentVote = $that->Vote_GetVote($oComment->getId(), 'comment', $oUser->getId())) {
return $that->Lang_Get('vote.notices.error_already_voted'); 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())) { if ($oTopicVote = $that->Vote_GetVote($oTopic->getId(), 'topic', $oUser->getId())) {
return $that->Lang_Get('vote.notices.error_already_voted'); 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')) 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; return false;
} }
/** /**

View file

@ -554,11 +554,11 @@ class ModuleUser_EntityUser extends Entity
/** /**
* Возвращает статус администратора сайта * Возвращает статус администратора сайта
* *
* @return bool|null * @return bool
*/ */
public function isAdministrator() public function isAdministrator()
{ {
return $this->getAdmin(); return (bool)$this->getAdmin();
} }
/** /**