Skip to content

Commit

Permalink
Some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
simba77 committed Aug 7, 2021
1 parent 2465f30 commit 58c91c4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion system/src/Counters.php
Expand Up @@ -455,7 +455,7 @@ public function albumCounters(): array
file_put_contents($file, json_encode(['album' => $album, 'photo' => $photo, 'new' => $new, 'new_adm' => $new_adm]), LOCK_EX);
}

if ($this->user->rights >= 6 && $new_adm) {
if ($this->user?->isAdmin() && $new_adm) {
$newcount = $new_adm;
} elseif ($new) {
$newcount = $new;
Expand Down
2 changes: 1 addition & 1 deletion themes/default/templates/system/app/debug.phtml
@@ -1,4 +1,4 @@
<?php if (($user->rights >= 7 && DEBUG) || DEBUG_FOR_ALL): ?>
<?php if (($user?->isAdmin() && DEBUG) || DEBUG_FOR_ALL): ?>
<?php
$connection = \Illuminate\Database\Capsule\Manager::connection();
$query_log = $connection->getQueryLog();
Expand Down
4 changes: 2 additions & 2 deletions themes/default/templates/system/app/sidebar-main-menu.phtml
Expand Up @@ -122,8 +122,8 @@ $ads_array = $ads->getAds();
<span class="flex-grow-1"><?= d__('system', 'Information, FAQ') ?></span>
</a>
</li>
<?php if ($user->rights >= 1): ?>
<?php if ($user->rights >= 7): ?>
<?php if ($user?->hasAnyRole()): ?>
<?php if ($user?->isAdmin()): ?>
<li>
<div class="border-bottom mt-3 mb-3"></div>
<a href="/admin/">
Expand Down
4 changes: 2 additions & 2 deletions themes/default/templates/system/app/sidebar-user-menu.phtml
Expand Up @@ -2,7 +2,7 @@
/**
* @var string $locale
* @var Johncms\System\Legacy\Tools $tools
* @var Johncms\System\Users\User $user
* @var Johncms\Users\User $user
*/

?>
Expand All @@ -20,7 +20,7 @@
</div>
</div>
<div>
<?= ($user->id ? $user->name : d__('system', 'Log In')) ?>
<?= ($user ? $user->name : d__('system', 'Log In')) ?>
</div>
</div>
<div>
Expand Down

0 comments on commit 58c91c4

Please sign in to comment.