diff --git a/public/admin/ldap-test/index.php b/public/admin/ldap-test/index.php index 185f8692..322bee20 100644 --- a/public/admin/ldap-test/index.php +++ b/public/admin/ldap-test/index.php @@ -10,6 +10,7 @@ use App\LdapProvisioner; $projectRoot = dirname(__DIR__, 3); $config = ConfigLoader::load($projectRoot, 'registration'); $ldap = new LdapProvisioner($config); +$diagnostics = $ldap->diagnostics(); $serviceResult = $ldap->testServiceBind(); $messages = []; @@ -84,6 +85,20 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {

+
+ Verbindungsdaten + +
+
Ergebnis diff --git a/src/App/LdapProvisioner.php b/src/App/LdapProvisioner.php index 1ca05ece..41c96832 100644 --- a/src/App/LdapProvisioner.php +++ b/src/App/LdapProvisioner.php @@ -28,6 +28,23 @@ final class LdapProvisioner && function_exists('ldap_add'); } + /** + * @return array + */ + public function diagnostics(): array + { + return [ + 'host' => trim((string) ($this->config['ldap']['host'] ?? '')), + 'port' => (string) ((int) ($this->config['ldap']['port'] ?? 389)), + 'bind_dn' => trim((string) ($this->config['ldap']['bind_dn'] ?? '')), + 'users_dn' => trim((string) ($this->config['ldap']['users_dn'] ?? '')), + 'starttls' => ((bool) ($this->config['ldap']['use_starttls'] ?? false)) ? 'aktiv' : 'inaktiv', + 'group_assignment_mode' => trim((string) ($this->config['ldap']['group_assignment_mode'] ?? 'group_memberuid')), + 'group_member_attribute' => trim((string) ($this->config['ldap']['group_member_attribute'] ?? 'memberUid')), + 'ldap_extension' => $this->canUseLdap() ? 'verfügbar' : 'nicht verfügbar', + ]; + } + /** * @return array{success: bool, message: string} */