connections admin

This commit is contained in:
2026-02-16 09:33:38 +01:00
parent 531320b408
commit 3f1e5aacc9
3 changed files with 146 additions and 25 deletions

View File

@@ -23,6 +23,25 @@ $portBId = (int)($_POST['port_b_id'] ?? 0);
$vlanConfig = $_POST['vlan_config'] ?? '';
$comment = trim($_POST['comment'] ?? '');
$normalizePortType = static function (string $value): string {
$map = [
'device' => 'device',
'device_ports' => 'device',
'module' => 'module',
'module_ports' => 'module',
'outlet' => 'outlet',
'network_outlet_ports' => 'outlet',
'patchpanel' => 'patchpanel',
'floor_patchpanel' => 'patchpanel',
'floor_patchpanel_ports' => 'patchpanel',
];
$key = strtolower(trim($value));
return $map[$key] ?? $key;
};
$portAType = $normalizePortType((string)$portAType);
$portBType = $normalizePortType((string)$portBType);
// =========================
// Validierung (einfach)
// =========================