connections admin
This commit is contained in:
@@ -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)
|
||||
// =========================
|
||||
|
||||
Reference in New Issue
Block a user