2 require 'fdisk-lib.pl';
4 # acl_security_form(&options)
5 # Output HTML for editing security options for the fdisk module
8 local @dlist = &list_disks_partitions();
10 map { $dcan{$_}++ } split(/\s+/, $_[0]->{'disks'});
11 print "<tr> <td valign=top><b>$text{'acl_disks'}</b></td> <td>\n";
12 printf "<input type=radio name=disks_def value=1 %s> %s\n",
13 $_[0]->{'disks'} eq '*' ? 'checked' : '', $text{'acl_dall'};
14 printf "<input type=radio name=disks_def value=0 %s> %s<br>\n",
15 $_[0]->{'disks'} eq '*' ? '' : 'checked', $text{'acl_dsel'};
16 print "<select name=disks size=4 multiple>\n";
18 printf "<option value='%s' %s>%s\n",
20 $dcan{$d->{'device'}} ? "selected" : "",
21 &text('select_device', uc($d->{'type'}), uc(substr($d->{'device'}, -1))).($d->{'model'} ? " ($d->{'model'})" : "");
23 print "</select></td> </tr>\n";
25 print "<tr> <td><b>$text{'acl_view'}</b></td>\n";
26 printf "<td><input type=radio name=view value=1 %s> %s\n",
27 $_[0]->{'view'} ? 'checked' : '', $text{'yes'};
28 printf "<input type=radio name=view value=0 %s> %s</td> </tr>\n",
29 $_[0]->{'view'} ? '' : 'checked', $text{'no'};
32 # acl_security_save(&options)
33 # Parse the form for security options for the fdisk module
36 if ($in{'disks_def'}) {
37 $_[0]->{'disks'} = "*";
40 $_[0]->{'disks'} = join(" ", split(/\0/, $in{'disks'}));
42 $_[0]->{'view'} = $in{'view'};