Fix problems displaying error page if no valid $active_user

This commit is contained in:
Thomas Pike
2018-04-17 17:37:10 +02:00
parent 40ba15610e
commit 3fbe50fd97
2 changed files with 4 additions and 4 deletions

View File

@@ -32,10 +32,10 @@ class PageSection {
$this->data->menu_items['/users'] = 'Users';
$this->data->menu_items['/groups'] = 'Groups';
$this->data->menu_items['/pubkeys'] = 'Public keys';
if($active_user->admin || count($active_user->list_admined_servers()) > 0) {
if($active_user && ($active_user->admin || count($active_user->list_admined_servers()) > 0)) {
$this->data->menu_items['/activity'] = 'Activity';
}
if($active_user->admin) {
if($active_user && $active_user->admin) {
$this->data->menu_items['/tools'] = 'Tools';
}
$this->data->menu_items['/help'] = 'Help';
@@ -43,7 +43,7 @@ class PageSection {
$this->data->active_user = $active_user;
$this->data->web_config = $config['web'];
$this->data->email_config = $config['email'];
if($active_user->developer) {
if($active_user && $active_user->developer) {
$this->data->database = $database;
}
}

View File

@@ -66,7 +66,7 @@ header("Content-Security-Policy: default-src 'self'");
<div id="footer">
<div class="container">
<p class="text-muted credit"><?php out($web_config['footer'], ESC_NONE)?></p>
<?php if($this->get('active_user')->developer) { ?>
<?php if($this->get('active_user') && $this->get('active_user')->developer) { ?>
<?php } ?>
</div>
</div>