Commit 559aa156 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:ambulance: fix(config): Allow SASL method as default hash

This allows to use SASL as default hash before filling SASL settings.
This means it can be selected from setup as well.
The admin won’t be able to save if he selects SASL as default hash but
 does not fill SASL settings.

closes #5589
Showing with 12 additions and 0 deletions
+12 -0
...@@ -455,6 +455,9 @@ class configInLdap extends simplePlugin ...@@ -455,6 +455,9 @@ class configInLdap extends simplePlugin
/* Password methods */ /* Password methods */
$methods = passwordMethod::get_available_methods(); $methods = passwordMethod::get_available_methods();
$methods = $methods['name']; $methods = $methods['name'];
if (!in_array('sasl', $methods)) {
$methods[] = 'sasl';
}
$attributesInfo['password']['attrs'][0]->setChoices($methods); $attributesInfo['password']['attrs'][0]->setChoices($methods);
$groupsAndRoles = array_merge( $groupsAndRoles = array_merge(
...@@ -569,6 +572,15 @@ class configInLdap extends simplePlugin ...@@ -569,6 +572,15 @@ class configInLdap extends simplePlugin
return $this->dn; return $this->dn;
} }
function check()
{
$messages = parent::check();
if (($this->fdPasswordDefaultHash == 'sasl') && ($this->fdSaslRealm == '') && ($this->fdSaslExop == '')) {
$messages[] = _('You need to fill saslRealm or saslExop in the configuration screen in order to use SASL');
}
return $messages;
}
static function get_themes() static function get_themes()
{ {
$themesdir = '../ihtml/themes/'; $themesdir = '../ihtml/themes/';
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment