Fix that the ldap port does not change when updating the encryption to use

fixes #8958
This commit is contained in:
Johannes Meyer 2015-04-07 15:06:32 +02:00
parent dc4d1246a9
commit 62bb35a71e
1 changed files with 9 additions and 4 deletions

View File

@ -27,6 +27,10 @@ class LdapResourceForm extends Form
*/ */
public function createElements(array $formData) public function createElements(array $formData)
{ {
$defaultPort = ! array_key_exists('encryption', $formData) || $formData['encryption'] !== Connection::LDAPS
? 389
: 636;
$this->addElement( $this->addElement(
'text', 'text',
'name', 'name',
@ -53,9 +57,10 @@ class LdapResourceForm extends Form
'port', 'port',
array( array(
'required' => true, 'required' => true,
'preserveDefault' => true,
'label' => $this->translate('Port'), 'label' => $this->translate('Port'),
'description' => $this->translate('The port of the LDAP server to use for authentication'), 'description' => $this->translate('The port of the LDAP server to use for authentication'),
'value' => 389 'value' => $defaultPort
) )
); );
$this->addElement( $this->addElement(