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 47a48b386f
commit d768cc7d94

View File

@ -1456,6 +1456,23 @@ class adLDAP extends \adLDAP
} }
return $this->utilClass; 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();
}
} }
/** /**