mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2025-06-27 21:21:56 +02:00
VNC-155 ConfigKey can have both type and validator
Type can check whether value is boolean or int, and validator can check whether another configuration key is defined, for example.
This commit is contained in:
parent
f12264c5ad
commit
0924817a76
@ -32,13 +32,6 @@ sub validate {
|
||||
|
||||
return if $self->isValueBlank();
|
||||
|
||||
if ($self->{validator}) {
|
||||
$self->resolveValidatorFromFunction() if (ref $self->{validator} eq "CODE");
|
||||
|
||||
$self->{validator}->validate($self);
|
||||
return;
|
||||
}
|
||||
|
||||
switch($self->{type}) {
|
||||
case INT {
|
||||
$self->validateInt();
|
||||
@ -47,6 +40,13 @@ sub validate {
|
||||
$self->validateBoolean();
|
||||
}
|
||||
}
|
||||
|
||||
if ($self->{validator}) {
|
||||
$self->resolveValidatorFromFunction() if (ref $self->{validator} eq "CODE");
|
||||
|
||||
$self->{validator}->validate($self);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
sub resolveValidatorFromFunction {
|
||||
|
Loading…
x
Reference in New Issue
Block a user