Fix old constructor syntax being called in DbBackendForm

refs #4641
This commit is contained in:
Jannis Moßhammer 2013-08-30 16:28:13 +02:00
parent 446da85a88
commit feab57e790

View File

@ -31,6 +31,7 @@ namespace Icinga\Form\Config\Authentication;
use \Icinga\Authentication\Backend\DbUserBackend; use \Icinga\Authentication\Backend\DbUserBackend;
use \Icinga\Application\DbAdapterFactory; use \Icinga\Application\DbAdapterFactory;
use \Zend_Config;
/** /**
* Form class for adding/modifying database authentication backends * Form class for adding/modifying database authentication backends
@ -126,10 +127,13 @@ class DbBackendForm extends BaseBackendForm
{ {
try { try {
$name = $this->getBackendName(); $name = $this->getBackendName();
$db = DbAdapterFactory::getDbAdapter( $dbBackend = new DbUserBackend(new Zend_Config(
$this->getValue('backend_' . $this->filterName($name) . '_' . 'resource') array(
); 'backend' => 'db',
$dbBackend = new DbUserBackend($db); 'target' => 'user',
'resource' => $this->getValue('backend_' . $this->filterName($name) . '_resource'),
)
));
if ($dbBackend->getUserCount() < 1) { if ($dbBackend->getUserCount() < 1) {
$this->addErrorMessage("No users found under the specified database backend"); $this->addErrorMessage("No users found under the specified database backend");
return false; return false;