Handle hostnames with upper-case letters
[webmin.git] / burner / index.cgi
1 #!/usr/local/bin/perl
2 # index.cgi
3 # Display burn profiles and icons for global options
4
5 require './burner-lib.pl';
6 &ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1, 0,
7         &help_search_link("cdrecord mkisofs", "man", "doc"));
8
9 if (!&has_command($config{'cdrecord'})) {
10         print "<p>",&text('index_ecdrecord', "<tt>$config{'cdrecord'}</tt>",
11                           "$gconfig{'webprefix'}/config.cgi?$module_name"),"<p>\n";
12         &ui_print_footer("/", $text{"index"});
13         exit;
14         }
15
16 print &ui_subheading($text{'index_profiles'});
17 @allprofiles = &list_profiles();
18 @profiles = grep { &can_use_profile($_) } @allprofiles;
19 if (@profiles) {
20         #&show_button();
21         @tds = ( "width=5" );
22         print &ui_form_start("delete_profiles.cgi", "post");
23         @links = ( &select_all_link("d", 1),
24                    &select_invert_link("d", 1) );
25         print &ui_links_row(\@links);
26         print &ui_columns_start([ "",
27                                   $text{'index_name'},
28                                   $text{'index_type'},
29                                   $text{'index_files'} ], 100, 0, \@tds);
30         foreach $p (@profiles) {
31                 local @cols;
32                 push(@cols, "<a href='edit_profile.cgi?id=$p->{'id'}'>".
33                             "$p->{'name'}</a>");
34                 push(@cols, $text{'index_type'.$p->{'type'}});
35                 if ($p->{'type'} == 1) {
36                         push(@cols, $p->{'iso'});
37                         }
38                 elsif ($p->{'type'} == 4) {
39                         push(@cols, $p->{'sdesc'});
40                         }
41                 else {
42                         $sources = "";
43                         for($i=0; defined($p->{"source_$i"}); $i++) {
44                                 $sources .= "&nbsp;|&nbsp;\n" if ($i);
45                                 $sources .= $p->{"source_$i"};
46                                 }
47                         push(@cols, $sources);
48                         }
49                 print &ui_checked_columns_row(\@cols, \@tds, "d", $p->{'id'});
50                 }
51         print &ui_columns_end();
52         print &ui_links_row(\@links);
53         print &ui_form_end([ [ "delete", $text{'index_delete'} ] ]);
54         }
55 elsif (@allprofiles) {
56         print "<b>$text{'index_noaccess'}</b><p>\n";
57         }
58 else {
59         print "<b>$text{'index_none'}</b><p>\n";
60         }
61 &show_button();
62
63 if ($access{'global'}) {
64         print &ui_hr();
65         @links = ( "edit_mkisofs.cgi", "edit_dev.cgi" );
66         @titles = ( $text{'mkisofs_title'}, $text{'dev_title'} );
67         @icons = ( "images/mkisofs.gif", "images/dev.gif" );
68         &icons_table(\@links, \@titles, \@icons);
69         }
70
71 &ui_print_footer("/", $text{'index'});
72
73 sub show_button
74 {
75 if ($access{'create'}) {
76         print "<form action=edit_profile.cgi>\n";
77         print "<input type=submit value='$text{'index_add'}'>\n";
78         print "<select name=type>\n";
79         print "<option value=1 checked> $text{'index_type1'}\n";
80         print "<option value=2> $text{'index_type2'}\n";
81         print "<option value=3> $text{'index_type3'}\n";
82         print "<option value=4> $text{'index_type4'}\n";
83         print "</select></form>\n";
84         }
85 }
86