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