WARNING: untranslated string: wg invalid name = Invalid name (Only letters, numbers, space and hyphen are allowed)
WARNING: untranslated string: wg invalid public key = Invalid public key
WARNING: untranslated string: wg invalid remote subnet = Invalid remote subnet
+WARNING: untranslated string: wg name is already used = The name is already in use
WARNING: untranslated string: wg no local subnets = No local subnets given
WARNING: untranslated string: wg no remote subnets = No remote subnets given
WARNING: untranslated string: winbind daemon = Winbind Daemon
WARNING: untranslated string: wg invalid name = Invalid name (Only letters, numbers, space and hyphen are allowed)
WARNING: untranslated string: wg invalid public key = Invalid public key
WARNING: untranslated string: wg invalid remote subnet = Invalid remote subnet
+WARNING: untranslated string: wg name is already used = The name is already in use
WARNING: untranslated string: wg no local subnets = No local subnets given
WARNING: untranslated string: wg no remote subnets = No remote subnets given
WARNING: untranslated string: whitelisted = Whitelisted
WARNING: untranslated string: wg invalid name = Invalid name (Only letters, numbers, space and hyphen are allowed)
WARNING: untranslated string: wg invalid public key = Invalid public key
WARNING: untranslated string: wg invalid remote subnet = Invalid remote subnet
+WARNING: untranslated string: wg name is already used = The name is already in use
WARNING: untranslated string: wg no local subnets = No local subnets given
WARNING: untranslated string: wg no remote subnets = No remote subnets given
WARNING: untranslated string: whitelisted = Whitelisted
WARNING: untranslated string: wg invalid name = Invalid name (Only letters, numbers, space and hyphen are allowed)
WARNING: untranslated string: wg invalid public key = Invalid public key
WARNING: untranslated string: wg invalid remote subnet = Invalid remote subnet
+WARNING: untranslated string: wg name is already used = The name is already in use
WARNING: untranslated string: wg no local subnets = No local subnets given
WARNING: untranslated string: wg no remote subnets = No remote subnets given
WARNING: untranslated string: whitelisted = Whitelisted
WARNING: untranslated string: wg invalid name = Invalid name (Only letters, numbers, space and hyphen are allowed)
WARNING: untranslated string: wg invalid public key = Invalid public key
WARNING: untranslated string: wg invalid remote subnet = Invalid remote subnet
+WARNING: untranslated string: wg name is already used = The name is already in use
WARNING: untranslated string: wg no local subnets = No local subnets given
WARNING: untranslated string: wg no remote subnets = No remote subnets given
WARNING: untranslated string: whitelisted = Whitelisted
WARNING: untranslated string: wg invalid name = Invalid name (Only letters, numbers, space and hyphen are allowed)
WARNING: untranslated string: wg invalid public key = Invalid public key
WARNING: untranslated string: wg invalid remote subnet = Invalid remote subnet
+WARNING: untranslated string: wg name is already used = The name is already in use
WARNING: untranslated string: wg no local subnets = No local subnets given
WARNING: untranslated string: wg no remote subnets = No remote subnets given
WARNING: untranslated string: whitelisted = Whitelisted
WARNING: untranslated string: wg invalid name = Invalid name (Only letters, numbers, space and hyphen are allowed)
WARNING: untranslated string: wg invalid public key = Invalid public key
WARNING: untranslated string: wg invalid remote subnet = Invalid remote subnet
+WARNING: untranslated string: wg name is already used = The name is already in use
WARNING: untranslated string: wg no local subnets = No local subnets given
WARNING: untranslated string: wg no remote subnets = No remote subnets given
WARNING: untranslated string: whitelisted = Whitelisted
WARNING: untranslated string: wg invalid name = Invalid name (Only letters, numbers, space and hyphen are allowed)
WARNING: untranslated string: wg invalid public key = Invalid public key
WARNING: untranslated string: wg invalid remote subnet = Invalid remote subnet
+WARNING: untranslated string: wg name is already used = The name is already in use
WARNING: untranslated string: wg no local subnets = No local subnets given
WARNING: untranslated string: wg no remote subnets = No remote subnets given
WARNING: untranslated string: whitelisted = Whitelisted
WARNING: untranslated string: wg invalid name = Invalid name (Only letters, numbers, space and hyphen are allowed)
WARNING: untranslated string: wg invalid public key = Invalid public key
WARNING: untranslated string: wg invalid remote subnet = Invalid remote subnet
+WARNING: untranslated string: wg name is already used = The name is already in use
WARNING: untranslated string: wg no local subnets = No local subnets given
WARNING: untranslated string: wg no remote subnets = No remote subnets given
WARNING: untranslated string: whitelisted = Whitelisted
< wg invalid name
< wg invalid public key
< wg invalid remote subnet
+< wg name is already used
< wg no local subnets
< wg no remote subnets
< winbind daemon
< wg invalid name
< wg invalid public key
< wg invalid remote subnet
+< wg name is already used
< wg no local subnets
< wg no remote subnets
< whitelisted
< wg invalid name
< wg invalid public key
< wg invalid remote subnet
+< wg name is already used
< wg no local subnets
< wg no remote subnets
< whitelisted
< wg invalid name
< wg invalid public key
< wg invalid remote subnet
+< wg name is already used
< wg no local subnets
< wg no remote subnets
< whitelisted
< wg invalid name
< wg invalid public key
< wg invalid remote subnet
+< wg name is already used
< wg no local subnets
< wg no remote subnets
< whitelisted
< wg invalid name
< wg invalid public key
< wg invalid remote subnet
+< wg name is already used
< wg no local subnets
< wg no remote subnets
< whitelisted
< wg invalid name
< wg invalid public key
< wg invalid remote subnet
+< wg name is already used
< wg no local subnets
< wg no remote subnets
< whitelisted
< wg invalid name
< wg invalid public key
< wg invalid remote subnet
+< wg name is already used
< wg no local subnets
< wg no remote subnets
< whitelisted
push(@errormessages, $Lang::tr{'wg invalid name'});
}
+ # Check if the name is free
+ unless (&name_is_free($cgiparams{"NAME"}, $key)) {
+ push(@errormessages, $Lang::tr{'wg name is already used'});
+ }
+
# Check the public key
unless (&publickey_is_valid($cgiparams{'PUBLIC_KEY'})) {
push(@errormessages, $Lang::tr{'wg invalid public key'});
return 1;
}
+sub name_is_free($) {
+ my $name = shift;
+ my $key = shift || 0;
+
+ foreach my $i (keys %peers) {
+ # Skip the connection with ID
+ next if ($key eq $i);
+
+ # Return if we found a match
+ return 0 if ($peers{$i}[2] eq $name);
+ }
+
+ return 1;
+}
+
sub publickey_is_valid($) {
my $key = shift;
'wg invalid name' => 'Invalid name (Only letters, numbers, space and hyphen are allowed)',
'wg invalid public key' => 'Invalid public key',
'wg invalid remote subnet' => 'Invalid remote subnet',
+'wg name is already used' => 'The name is already in use',
'wg no local subnets' => 'No local subnets given',
'wg no remote subnets' => 'No remote subnets given',
'whitelisted' => 'Whitelisted',