mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-02 21:12:02 +08:00
commit
4235d95a39
2 changed files with 13 additions and 3 deletions
|
@ -118,13 +118,23 @@ class ChangePasswordLdapDriver implements \RainLoop\Providers\ChangePassword\Cha
|
|||
'{login}' => $oAccount->Login(),
|
||||
'{imap:login}' => $oAccount->Login(),
|
||||
'{imap:host}' => $oAccount->DomainIncHost(),
|
||||
'{imap:port}' => $oAccount->DomainIncPort()
|
||||
'{imap:port}' => $oAccount->DomainIncPort(),
|
||||
'{gecos}' => posix_getpwnam($oAccount->Login())
|
||||
));
|
||||
|
||||
$oCon = @\ldap_connect($this->sHostName, $this->iHostPort);
|
||||
if ($oCon)
|
||||
{
|
||||
@\ldap_set_option($oCon, LDAP_OPT_PROTOCOL_VERSION, 3);
|
||||
if (!@\ldap_set_option($oCon, LDAP_OPT_PROTOCOL_VERSION, 3)) {
|
||||
$this->oLogger->Write("Failed to set LDAP Protocol version to 3, TLS not supported.",
|
||||
\MailSo\Log\Enumerations\Type::WARNING, 'LDAP');
|
||||
}
|
||||
else {
|
||||
if (!ldap_start_tls($oCon)) {
|
||||
$this->oLogger->Write("Ldap_start_tls failed: ".$oCon,
|
||||
\MailSo\Log\Enumerations\Type::WARNING, 'LDAP');
|
||||
}
|
||||
}
|
||||
|
||||
if (!@\ldap_bind($oCon, $sUserDn, $sPrevPassword))
|
||||
{
|
||||
|
|
|
@ -64,7 +64,7 @@ class LdapChangePasswordPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
->SetType(\RainLoop\Enumerations\PluginPropertyType::INT)
|
||||
->SetDefaultValue(389),
|
||||
\RainLoop\Plugins\Property::NewInstance('user_dn_format')->SetLabel('User DN format')
|
||||
->SetDescription('LDAP user dn format. Supported tokens: {email}, {email:user}, {email:domain}, {login}, {domain}, {domain:dc}, {imap:login}, {imap:host}, {imap:port}')
|
||||
->SetDescription('LDAP user dn format. Supported tokens: {email}, {email:user}, {email:domain}, {login}, {domain}, {domain:dc}, {imap:login}, {imap:host}, {imap:port}, {gecos}')
|
||||
->SetDefaultValue('uid={imap:login},ou=Users,{domain:dc}'),
|
||||
\RainLoop\Plugins\Property::NewInstance('password_field')->SetLabel('Password field')
|
||||
->SetDefaultValue('userPassword'),
|
||||
|
|
Loading…
Reference in a new issue