mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-05-19 17:28:23 +03:00
vote fix #700
This commit is contained in:
parent
6a0efd8191
commit
7a8305ed09
|
@ -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;
|
||||
}
|
||||
/**
|
||||
|
|
|
@ -554,11 +554,11 @@ class ModuleUser_EntityUser extends Entity
|
|||
/**
|
||||
* Возвращает статус администратора сайта
|
||||
*
|
||||
* @return bool|null
|
||||
* @return bool
|
||||
*/
|
||||
public function isAdministrator()
|
||||
{
|
||||
return $this->getAdmin();
|
||||
return (bool)$this->getAdmin();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue