Fix usage of wrong variable and add validation for n+1 port
This commit is contained in:
parent
d586f1f221
commit
a57cdf48c3
|
@ -335,11 +335,11 @@ class Configuration
|
|||
$backend_config = (array)$row['backend_config'];
|
||||
|
||||
if (!empty($backend_config['dj_port'])) {
|
||||
$port = (int)$frontend_config['dj_port'];
|
||||
$port = (int)$backend_config['dj_port'];
|
||||
$used_ports[$port] = $station_reference;
|
||||
}
|
||||
if (!empty($backend_config['telnet_port'])) {
|
||||
$port = (int)$frontend_config['telnet_port'];
|
||||
$port = (int)$backend_config['telnet_port'];
|
||||
$used_ports[$port] = $station_reference;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,6 +53,12 @@ class StationPortCheckerValidator extends ConstraintValidator
|
|||
->setParameter('{{ port }}', $port)
|
||||
->addViolation();
|
||||
}
|
||||
|
||||
if ($port_path === 'backend_config_dj_port' && isset($used_ports[$port+1])) {
|
||||
$this->context->buildViolation($constraint->message)
|
||||
->setParameter('{{ port }}', sprintf('%s (%s + 1)', $port+1, $port))
|
||||
->addViolation();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue