Skip to content

Commit

Permalink
Fix that the ldap port does not change when updating the encryption t…
Browse files Browse the repository at this point in the history
…o use

fixes #8958
  • Loading branch information
Johannes Meyer committed Apr 7, 2015
1 parent dc4d124 commit 62bb35a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions application/forms/Config/Resource/LdapResourceForm.php
Expand Up @@ -27,6 +27,10 @@ public function init()
*/
public function createElements(array $formData)
{
$defaultPort = ! array_key_exists('encryption', $formData) || $formData['encryption'] !== Connection::LDAPS
? 389
: 636;

$this->addElement(
'text',
'name',
Expand All @@ -52,10 +56,11 @@ public function createElements(array $formData)
'number',
'port',
array(
'required' => true,
'label' => $this->translate('Port'),
'description' => $this->translate('The port of the LDAP server to use for authentication'),
'value' => 389
'required' => true,
'preserveDefault' => true,
'label' => $this->translate('Port'),
'description' => $this->translate('The port of the LDAP server to use for authentication'),
'value' => $defaultPort
)
);
$this->addElement(
Expand Down

0 comments on commit 62bb35a

Please sign in to comment.