Fixed forum oversights.
This commit is contained in:
parent
78ba57750c
commit
331b159978
4 changed files with 5 additions and 5 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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']);
|
||||
|
|
|
@ -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']);
|
||||
|
|
Loading…
Add table
Reference in a new issue