UserController: Behave nicely when not any backend is available

This commit is contained in:
Johannes Meyer 2015-06-08 13:27:45 +02:00
parent 3600e1088c
commit 07041fafc8
2 changed files with 5 additions and 1 deletions

View File

@ -28,6 +28,10 @@ class UserController extends AuthBackendController
function ($b) { return $b->getName(); },
$this->loadUserBackends('Icinga\Data\Selectable')
);
if (empty($backendNames)) {
return;
}
$this->view->backendSelection = new Form();
$this->view->backendSelection->setAttrib('class', 'backend-selection');
$this->view->backendSelection->setUidDisabled();

View File

@ -18,7 +18,7 @@ if (! $this->compact): ?>
<div class="content users">
<?php
if ($backend === null) {
if (! isset($backend)) {
echo $this->translate('No backend found which is able to list users') . '</div>';
return;
} else {