index: fix redirection issue without db config
This commit is contained in:
parent
c162eda1ad
commit
113ab61424
|
@ -20,15 +20,15 @@ class IndexController extends ActionController
|
||||||
'label' => $this->translate('Overview')
|
'label' => $this->translate('Overview')
|
||||||
))->activate('overview');
|
))->activate('overview');
|
||||||
|
|
||||||
if ($this->Config()->get('db', 'resource')) {
|
if (! $this->Config()->get('db', 'resource')) {
|
||||||
$this->addGlobalTypeTabs();
|
|
||||||
} else {
|
|
||||||
$this->view->errorMessage = sprintf(
|
$this->view->errorMessage = sprintf(
|
||||||
$this->translate('No database resource has been configured yet. Please %s to complete your config'),
|
$this->translate('No database resource has been configured yet. Please %s to complete your config'),
|
||||||
$this->view->qlink($this->translate('click here'), 'director/settings')
|
$this->view->qlink($this->translate('click here'), 'director/settings')
|
||||||
);
|
);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->addGlobalTypeTabs();
|
||||||
$this->view->stats = $this->db()->getObjectSummary();
|
$this->view->stats = $this->db()->getObjectSummary();
|
||||||
if ((int) $this->view->stats['apiuser']->cnt_total === 0) {
|
if ((int) $this->view->stats['apiuser']->cnt_total === 0) {
|
||||||
$this->view->form = $this->loadForm('kickstart')->setDb($this->db)->handleRequest();
|
$this->view->form = $this->loadForm('kickstart')->setDb($this->db)->handleRequest();
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if ((int) $stats['apiuser']->cnt_total === 0) {
|
if ($this->stats && (int) $this->stats['apiuser']->cnt_total === 0) {
|
||||||
echo $this->form . "</div>\n";
|
echo $this->form . "</div>\n";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue