Access backend information by using getValue() instead of getConfig()

refs #5525
This commit is contained in:
Johannes Meyer 2014-08-11 10:46:08 +02:00
parent 5203f82b80
commit f0a99274e6

View File

@ -113,25 +113,6 @@ class LdapBackendForm extends BaseBackendForm
); );
} }
/**
* Return the ldap authentication backend configuration for this form
*
* @return array
*
* @see BaseBackendForm::getConfig()
*/
public function getConfig()
{
return array(
$this->getValue('name') => array(
'backend' => 'ldap',
'resource' => $this->getValue('resource'),
'user_class' => $this->getValue('user_class'),
'user_name_attribute' => $this->getValue('user_name_attribute')
)
);
}
/** /**
* Validate the current configuration by connecting to a backend and requesting the user count * Validate the current configuration by connecting to a backend and requesting the user count
* *
@ -149,13 +130,13 @@ class LdapBackendForm extends BaseBackendForm
} }
try { try {
$cfg = $this->getConfig(); $backend = ResourceFactory::createResource(
$backendConfig = new Zend_Config($cfg[$this->getValue('name')]); ResourceFactory::getResourceConfig($this->getValue('resource'))
$backend = ResourceFactory::createResource(ResourceFactory::getResourceConfig($backendConfig->resource)); );
$testConn = new LdapUserBackend( $testConn = new LdapUserBackend(
$backend, $backend,
$backendConfig->user_class, $this->getValue('user_class'),
$backendConfig->user_name_attribute $this->getValue('user_name_attribute')
); );
$testConn->assertAuthenticationPossible(); $testConn->assertAuthenticationPossible();
} catch (Exception $exc) { } catch (Exception $exc) {