]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
firewall: Don't show rule activation checkbox when creating a rule.
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 17 Oct 2013 15:58:45 +0000 (17:58 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 17 Oct 2013 15:58:45 +0000 (17:58 +0200)
Almost certainly, the user wants the new rule to be active when
it is created. We should put as few input elements as possible
on the rule creation page.

html/cgi-bin/forwardfw.cgi

index 47bee0189b85ff18a8c2509c2b0ff5550de7acac..ef94db1453f0b20da59063018a934439e7fc40dc 100755 (executable)
@@ -1917,9 +1917,34 @@ END
                }
 
                print<<END;
-               </table><table width='100%'>
-               <tr><td width='1%'><input type='checkbox' name='ACTIVE' value='ON' $checked{'ACTIVE'}{'ON'}></td><td>$Lang::tr{'fwdfw rule activate'}</td></tr>
-               <tr><td width='1%'><input type='checkbox' name='LOG' value='ON'  $checked{'LOG'}{'ON'}  ></td><td>$Lang::tr{'fwdfw log rule'}</td></tr>
+               </table>
+               <table width='100%'>
+                       <tr>
+END
+
+               if ($fwdfwsettings{'updatefwrule'} eq 'on') {
+                       print <<END;
+                               <td>
+                                       <input type='checkbox' name='ACTIVE' $checked{'ACTIVE'}{'ON'}>
+                               </td>
+                               <td>$Lang::tr{'fwdfw rule activate'}</td>
+END
+               } else {
+                       print <<END;
+                               <td colspan="2">
+                                       <input type="hidden" name="ACTIVE" value="ON">
+                               </td>
+END
+               }
+
+               print <<END;
+                       </tr>
+                       <tr>
+                               <td>
+                                       <input type='checkbox' name='LOG' value='ON' $checked{'LOG'}{'ON'}>
+                               </td>
+                               <td>$Lang::tr{'fwdfw log rule'}</td>
+                       </tr>
                        <tr>
                                <td width='1%'>
                                        <input type='checkbox' name='TIME' id="USE_TIME_CONSTRAINTS" value='ON' $checked{'TIME'}{'ON'}>