+ # Check if any input has been performed.
+ if ($input eq '') {
+ $errormessage = "$Lang::tr{'guardian empty input'}";
+ }
+
+ # Check if the given input is localhost (127.0.0.1).
+ elsif ($input eq "127.0.0.1") {
+ $errormessage = "$Lang::tr{'guardian blocking of this address is not allowed'}";
+ }
+
+ # Check if the given input is anywhere (0.0.0.0).
+ elsif ($input eq "0.0.0.0") {
+ $errormessage = "$Lang::tr{'guardian blocking of this address is not allowed'}";
+ }
+
+ # Check if the given input is one of the interface addresses or our gateway.
+ elsif ($input eq "$green" || $input eq "$blue" || $input eq "$orange" || $input eq "$red" || $input eq "$gateway") {
+ $errormessage = "$Lang::tr{'guardian blocking of this address is not allowed'}";
+ }
+
+ # Check if the given input is a valid IP address.
+ elsif (!&General::validip($input)) {
+ $errormessage = "$Lang::tr{'guardian invalid address or subnet'}";
+ }