Fixed ACL labels
authorJamie Cameron <jcameron@webmin.com>
Fri, 4 Apr 2008 19:48:48 +0000 (19:48 +0000)
committerJamie Cameron <jcameron@webmin.com>
Fri, 4 Apr 2008 19:48:48 +0000 (19:48 +0000)
pptp-server/acl_security.pl
pptp-server/lang/en

index 786989f..e2d6b59 100644 (file)
@@ -1,61 +1,22 @@
 
 require 'pptp-server-lib.pl';
+@acl_options = ("conf", "options", "secrets", "conns", "stop", "apply");
 
 # acl_security_form(&options)
 # Output HTML for editing security options for the pptp-server module
 sub acl_security_form
 {
-print "<tr><td valign=top><b>$text{'acl_conf'}</b></td>\n";
-print "<td valign=top>\n";
-printf "<input type=radio name=conf value=1 %s> $text{'yes'}\n",
-          $_[0]->{'conf'} ? "checked" : "";
-printf "<input type=radio name=conf value=0 %s> $text{'no'}</td></tr>\n",
-        $_[0]->{'conf'} ? "" : "checked";
-
-print "<tr><td valign=top><b>$text{'acl_options'}</b></td>\n";
-print "<td valign=top>\n";
-printf "<input type=radio name=options value=1 %s> $text{'yes'}\n",
-          $_[0]->{'options'} ? "checked" : "";
-printf "<input type=radio name=options value=0 %s> $text{'no'}</td></tr>\n",
-        $_[0]->{'options'} ? "" : "checked";
-
-print "<tr><td valign=top><b>$text{'acl_secrets'}</b></td>\n";
-print "<td valign=top>\n";
-printf "<input type=radio name=secrets value=1 %s> $text{'yes'}\n",
-          $_[0]->{'secrets'} ? "checked" : "";
-printf "<input type=radio name=secrets value=0 %s> $text{'no'}</td></tr>\n",
-        $_[0]->{'secrets'} ? "" : "checked";
-
-print "<tr><td valign=top><b>$text{'acl_conns'}</b></td>\n";
-print "<td valign=top>\n";
-printf "<input type=radio name=conns value=1 %s> $text{'yes'}\n",
-          $_[0]->{'conns'} ? "checked" : "";
-printf "<input type=radio name=conns value=0 %s> $text{'no'}</td></tr>\n",
-        $_[0]->{'conns'} ? "" : "checked";
-
-print "<tr><td valign=top><b>$text{'acl_stop'}</b></td>\n";
-print "<td valign=top>\n";
-printf "<input type=radio name=stop value=1 %s> $text{'yes'}\n",
-          $_[0]->{'stop'} ? "checked" : "";
-printf "<input type=radio name=stop value=0 %s> $text{'no'}</td></tr>\n",
-        $_[0]->{'stop'} ? "" : "checked";
-
-print "<tr><td valign=top><b>$text{'acl_apply'}</b></td>\n";
-print "<td valign=top>\n";
-printf "<input type=radio name=apply value=1 %s> $text{'yes'}\n",
-          $_[0]->{'apply'} ? "checked" : "";
-printf "<input type=radio name=apply value=0 %s> $text{'no'}</td></tr>\n",
-        $_[0]->{'apply'} ? "" : "checked";
+foreach my $a (@acl_options) {
+       print &ui_table_row($text{'acl_'.$a},
+               &ui_yesno_radio($a, $_[0]->{$a}));
+       }
 }
 
 # acl_security_save(&options)
 # Parse the form for security options for the pptp-server module
 sub acl_security_save
 {
-$_[0]->{'conf'} = $in{'conf'};
-$_[0]->{'options'} = $in{'options'};
-$_[0]->{'secrets'} = $in{'secrets'};
-$_[0]->{'conns'} = $in{'conns'};
-$_[0]->{'stop'} = $in{'stop'};
-$_[0]->{'apply'} = $in{'apply'};
+foreach my $a (@acl_options) {
+       $_[0]->{$a} = $in{$a};
+       }
 }
index b7199f3..487cd73 100644 (file)
@@ -143,3 +143,10 @@ log_disc=Disconnected client $1
 log_start=Started PPTP server
 log_stop=Stopped PPTP server
 log_apply=Applied PPTP server configuration
+
+acl_conf=Can edit configuration?
+acl_options=Can edit options?
+acl_secrets=Can manage PPTP accounts?
+acl_conns=Can view connections?
+acl_stop=Can stop and start PPTP server?
+acl_apply=Can apply configuration?