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') {
= htmlspecialchars((string) ($serviceResult['message'] ?? ''), ENT_QUOTES) ?>
+
+
Verbindungsdaten
+
+ - Host: = htmlspecialchars((string) ($diagnostics['host'] ?? ''), ENT_QUOTES) ?>
+ - Port: = htmlspecialchars((string) ($diagnostics['port'] ?? ''), ENT_QUOTES) ?>
+ - Bind-DN: = htmlspecialchars((string) ($diagnostics['bind_dn'] ?? ''), ENT_QUOTES) ?>
+ - Users-DN: = htmlspecialchars((string) ($diagnostics['users_dn'] ?? ''), ENT_QUOTES) ?>
+ - StartTLS: = htmlspecialchars((string) ($diagnostics['starttls'] ?? ''), ENT_QUOTES) ?>
+ - Gruppenmodus: = htmlspecialchars((string) ($diagnostics['group_assignment_mode'] ?? ''), ENT_QUOTES) ?>
+ - Gruppenattribut: = htmlspecialchars((string) ($diagnostics['group_member_attribute'] ?? ''), ENT_QUOTES) ?>
+ - PHP LDAP-Erweiterung: = htmlspecialchars((string) ($diagnostics['ldap_extension'] ?? ''), ENT_QUOTES) ?>
+
+
+
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}
*/