mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03: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:login}' => $oAccount->Login(),
|
||||||
'{imap:host}' => $oAccount->DomainIncHost(),
|
'{imap:host}' => $oAccount->DomainIncHost(),
|
||||||
'{imap:port}' => $oAccount->DomainIncPort(),
|
'{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);
|
$oCon = @\ldap_connect($this->sHostName, $this->iHostPort);
|
||||||
if ($oCon)
|
if ($oCon)
|
||||||
{
|
{
|
||||||
if (!@\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');
|
$this->oLogger->Write(
|
||||||
}
|
'Failed to set LDAP Protocol version to 3, TLS not supported.',
|
||||||
else {
|
\MailSo\Log\Enumerations\Type::WARNING,
|
||||||
if (!ldap_start_tls($oCon)) {
|
'LDAP'
|
||||||
$this->oLogger->Write("Ldap_start_tls failed: ".$oCon,
|
);
|
||||||
\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))
|
if (!@\ldap_bind($oCon, $sUserDn, $sPrevPassword))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue