index: fix redirection issue without db config

This commit is contained in:
Thomas Gelf 2015-12-23 10:56:17 +01:00
parent c162eda1ad
commit 113ab61424
2 changed files with 4 additions and 4 deletions

View File

@ -20,15 +20,15 @@ class IndexController extends ActionController
'label' => $this->translate('Overview')
))->activate('overview');
if ($this->Config()->get('db', 'resource')) {
$this->addGlobalTypeTabs();
} else {
if (! $this->Config()->get('db', 'resource')) {
$this->view->errorMessage = sprintf(
$this->translate('No database resource has been configured yet. Please %s to complete your config'),
$this->view->qlink($this->translate('click here'), 'director/settings')
);
return;
}
$this->addGlobalTypeTabs();
$this->view->stats = $this->db()->getObjectSummary();
if ((int) $this->view->stats['apiuser']->cnt_total === 0) {
$this->view->form = $this->loadForm('kickstart')->setDb($this->db)->handleRequest();

View File

@ -9,7 +9,7 @@
<?php endif ?>
<?php
if ((int) $stats['apiuser']->cnt_total === 0) {
if ($this->stats && (int) $this->stats['apiuser']->cnt_total === 0) {
echo $this->form . "</div>\n";
return;
}