]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
ids.cgi: Correctly use "enabled" for checked checkboxes.
authorStefan Schantl <stefan.schantl@ipfire.org>
Tue, 23 Mar 2021 16:38:26 +0000 (17:38 +0100)
committerStefan Schantl <stefan.schantl@ipfire.org>
Sun, 19 Dec 2021 12:22:59 +0000 (13:22 +0100)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
html/cgi-bin/ids.cgi

index 668dc7bcbd94140b79c0087bd59f69d8a0208022..f97970cf79d335c68a7864df9c2e5fe12a39be27 100644 (file)
@@ -675,7 +675,14 @@ if ($cgiparams{'RULESET'} eq $Lang::tr{'save'}) {
        # Assign some nice human-readable values.
        my $provider = $cgiparams{'PROVIDER'};
        my $subscription_code = $cgiparams{'SUBSCRIPTION_CODE'};
-       my $status_autoupdate = $cgiparams{'ENABLE_AUTOUPDATE'};
+       my $status_autoupdate;
+
+       # Handle autoupdate checkbox.
+       if ($cgiparams{'ENABLE_AUTOUPDATE'} eq "on") {
+               $status_autoupdate = "enabled";
+       } else {
+               $status_autoupdate = "disabled";
+       }
 
        # Check if we are going to add a new provider.
        if ($cgiparams{'PROVIDERS'} eq "$Lang::tr{'add'}") {
@@ -1464,7 +1471,7 @@ END
        # Check if an existing provider should be edited.
        if($cgiparams{'PROVIDERS'} eq "$Lang::tr{'edit'}") {
                # Check if autoupdate is enabled for this provider.
-               if ($used_providers{$cgiparams{'ID'}}[2] eq "on") {
+               if ($used_providers{$cgiparams{'ID'}}[2] eq "enabled") {
                        # Set the checkbox to be checked.
                        $checked{'ENABLE_AUTOUPDATE'} = "checked='checked'";
                }