return which AD server we (tried) to contact in error-messages

This commit is contained in:
ralf 2022-11-10 11:26:45 +01:00
parent 293cf669a0
commit f40d854592

View File

@ -1547,6 +1547,23 @@ class adLDAP extends \adLDAP
}
return $this->utilClass;
}
/**
* Get last error from Active Directory.
*
* Reimplemented to return which AD we're connecting.
*
* return string
*/
public function getLastError()
{
$url = $this->useTLS ? 'ldaps://' : 'ldap://';
if (!empty($this->adminUsername)) $url .= $this->adminUsername.'@'.$this->accountSuffix.'@';
$url .= implode(',', $this->domainControllers);
if (!empty($this->adPort)) $url .= ':'.$this->adPort;
return $url.': '.parent::getLastError();
}
}
/**