mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-12-31 03:52:01 +08:00
Small improvements
This commit is contained in:
parent
4235d95a39
commit
860ac47f6c
1 changed files with 13 additions and 11 deletions
|
@ -119,22 +119,24 @@ class ChangePasswordLdapDriver implements \RainLoop\Providers\ChangePassword\Cha
|
|||
'{imap:login}' => $oAccount->Login(),
|
||||
'{imap:host}' => $oAccount->DomainIncHost(),
|
||||
'{imap:port}' => $oAccount->DomainIncPort(),
|
||||
'{gecos}' => posix_getpwnam($oAccount->Login())
|
||||
'{gecos}' => function_exists('posix_getpwnam') ? posix_getpwnam($oAccount->Login()) : ''
|
||||
));
|
||||
|
||||
$oCon = @\ldap_connect($this->sHostName, $this->iHostPort);
|
||||
if ($oCon)
|
||||
{
|
||||
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_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))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue