Fixed forum oversights.

This commit is contained in:
flash 2020-06-11 20:30:19 +00:00
parent 78ba57750c
commit 331b159978
4 changed files with 5 additions and 5 deletions

View file

@ -29,7 +29,7 @@ if(!perms_check($perms, MSZ_FORUM_PERM_VIEW_FORUM)) {
return;
}
if($forumUser->hasActiveWarning())
if(isset($forumUser) && $forumUser->hasActiveWarning())
$perms &= ~MSZ_FORUM_PERM_SET_WRITE;
Template::set('forum_perms', $perms);

View file

@ -33,11 +33,11 @@ if(!empty($postMode) && !UserSession::hasCurrent()) {
$currentUser = User::getCurrent():
$currentUserId = $currentUser === null ? 0 : $currentUser->getId();
if($currentUser->isBanned()) {
if(isset($currentUser) && $currentUser->isBanned()) {
echo render_info_or_json($isXHR, 'You have been banned, check your profile for more information.', 403);
return;
}
if($currentUser->isSilenced()) {
if(isset($currentUser) && $currentUser->isSilenced()) {
echo render_info_or_json($isXHR, 'You have been silenced, check your profile for more information.', 403);
return;
}

View file

@ -23,7 +23,7 @@ $perms = $topic
? forum_perms_get_user($topic['forum_id'], $topicUserId)[MSZ_FORUM_PERMS_GENERAL]
: 0;
if($topicUser->hasActiveWarning())
if(isset($topicUser) && $topicUser->hasActiveWarning())
$perms &= ~MSZ_FORUM_PERM_SET_WRITE;
$topicIsDeleted = !empty($topic['topic_deleted']);

View file

@ -28,7 +28,7 @@ $perms = $topic
? forum_perms_get_user($topic['forum_id'], $topicUserId)[MSZ_FORUM_PERMS_GENERAL]
: 0;
if($topicUser->hasActiveWarning())
if(isset($topicUser) && $topicUser->hasActiveWarning())
$perms &= ~MSZ_FORUM_PERM_SET_WRITE;
$topicIsDeleted = !empty($topic['topic_deleted']);