feat: LDAP-Test zeigt User-Tabelle mit Univention-UCS-Support
Nach erfolgreichem Verbindungstest werden bis zu 50 Benutzer (UID, Name, E-Mail) in einer scrollbaren Tabelle angezeigt. Unterstützt mailPrimaryAddress (Univention UCS) als Fallback für mail sowie inetOrgPerson objectClass. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+62
-8
@@ -2195,7 +2195,7 @@ export default function AdminPage() {
|
||||
{/* Test result */}
|
||||
{ldapTestResult && (
|
||||
<Card>
|
||||
<CardContent className="pt-4 space-y-2">
|
||||
<CardContent className="pt-4 space-y-3">
|
||||
<div className="flex items-center gap-2">
|
||||
<Badge variant={ldapTestResult.ok ? "default" : "destructive"}>
|
||||
{ldapTestResult.ok ? "Verbunden" : "Fehler"}
|
||||
@@ -2208,12 +2208,39 @@ export default function AdminPage() {
|
||||
{ldapTestResult.server_info && (
|
||||
<p className="text-xs text-muted-foreground font-mono">{ldapTestResult.server_info}</p>
|
||||
)}
|
||||
{ldapTestResult.users_found > 0 && (
|
||||
<p className="text-sm">{ldapTestResult.users_found} Benutzer gefunden</p>
|
||||
)}
|
||||
{ldapTestResult.error_detail && (
|
||||
<p className="text-xs text-destructive font-mono">{ldapTestResult.error_detail}</p>
|
||||
)}
|
||||
{ldapTestResult.ok && ldapTestResult.users_found > 0 && (
|
||||
<div className="space-y-1">
|
||||
<p className="text-sm font-medium">
|
||||
{ldapTestResult.users_found} Benutzer gefunden
|
||||
{ldapTestResult.users?.length < ldapTestResult.users_found && (
|
||||
<span className="text-muted-foreground font-normal"> (Vorschau: {ldapTestResult.users?.length})</span>
|
||||
)}
|
||||
</p>
|
||||
<div className="rounded border overflow-auto max-h-64">
|
||||
<table className="w-full text-xs">
|
||||
<thead className="bg-muted sticky top-0">
|
||||
<tr>
|
||||
<th className="text-left px-2 py-1 font-medium">UID</th>
|
||||
<th className="text-left px-2 py-1 font-medium">Name</th>
|
||||
<th className="text-left px-2 py-1 font-medium">E-Mail</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{ldapTestResult.users?.map((u, i) => (
|
||||
<tr key={i} className="border-t">
|
||||
<td className="px-2 py-1 font-mono">{u.uid || "–"}</td>
|
||||
<td className="px-2 py-1">{u.display_name || "–"}</td>
|
||||
<td className="px-2 py-1 text-muted-foreground">{u.mail || "–"}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
)}
|
||||
@@ -2458,7 +2485,7 @@ export default function AdminPage() {
|
||||
{/* Test result */}
|
||||
{tenantLdapTestResult && (
|
||||
<Card>
|
||||
<CardContent className="pt-4 space-y-2">
|
||||
<CardContent className="pt-4 space-y-3">
|
||||
<div className="flex items-center gap-2">
|
||||
<Badge variant={tenantLdapTestResult.ok ? "default" : "destructive"}>
|
||||
{tenantLdapTestResult.ok ? "Verbunden" : "Fehler"}
|
||||
@@ -2471,12 +2498,39 @@ export default function AdminPage() {
|
||||
{tenantLdapTestResult.server_info && (
|
||||
<p className="text-xs text-muted-foreground font-mono">{tenantLdapTestResult.server_info}</p>
|
||||
)}
|
||||
{tenantLdapTestResult.users_found > 0 && (
|
||||
<p className="text-sm">{tenantLdapTestResult.users_found} Benutzer gefunden</p>
|
||||
)}
|
||||
{tenantLdapTestResult.error_detail && (
|
||||
<p className="text-xs text-destructive font-mono">{tenantLdapTestResult.error_detail}</p>
|
||||
)}
|
||||
{tenantLdapTestResult.ok && tenantLdapTestResult.users_found > 0 && (
|
||||
<div className="space-y-1">
|
||||
<p className="text-sm font-medium">
|
||||
{tenantLdapTestResult.users_found} Benutzer gefunden
|
||||
{tenantLdapTestResult.users?.length < tenantLdapTestResult.users_found && (
|
||||
<span className="text-muted-foreground font-normal"> (Vorschau: {tenantLdapTestResult.users?.length})</span>
|
||||
)}
|
||||
</p>
|
||||
<div className="rounded border overflow-auto max-h-64">
|
||||
<table className="w-full text-xs">
|
||||
<thead className="bg-muted sticky top-0">
|
||||
<tr>
|
||||
<th className="text-left px-2 py-1 font-medium">UID</th>
|
||||
<th className="text-left px-2 py-1 font-medium">Name</th>
|
||||
<th className="text-left px-2 py-1 font-medium">E-Mail</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{tenantLdapTestResult.users?.map((u, i) => (
|
||||
<tr key={i} className="border-t">
|
||||
<td className="px-2 py-1 font-mono">{u.uid || "–"}</td>
|
||||
<td className="px-2 py-1">{u.display_name || "–"}</td>
|
||||
<td className="px-2 py-1 text-muted-foreground">{u.mail || "–"}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user