Handle hostnames with upper-case letters
[webmin.git] / custom / sqlform.cgi
1 #!/usr/local/bin/perl
2 # sqlform.cgi
3 # Display the form for one SQL command on a page
4
5 require './custom-lib.pl';
6 &ReadParse();
7 $cmd = &get_command($in{'id'}, $in{'idx'});
8 &can_run_command($cmd) || &error($text{'form_ecannot'});
9
10 # Display form for command parameters
11 &ui_print_header(undef, $text{'form_title'}, "");
12 @a = @{$cmd->{'args'}};
13 ($up) = grep { $_->{'type'} == 10 } @a;
14 if ($up) {
15         print &ui_form_start("sql.cgi", "form-data");
16         }
17 elsif (@a) {
18         print &ui_form_start("sql.cgi", "post");
19         }
20 else {
21         print &ui_form_start("sql.cgi");
22         }
23 print &ui_hidden("id", $cmd->{'id'});
24 print &ui_table_start(&html_escape($cmd->{'desc'}), "width=100%", 4,
25                       [ "width=20%", "width=30%", "width=20%", "width=30%" ]);
26 print &ui_table_row(undef, $cmd->{'html'}, 4);
27
28 foreach $a (@{$cmd->{'args'}}) {
29         print &ui_table_row(&html_escape($a->{'desc'}),
30                 &show_parameter_input($a, 0));
31         }
32
33 print &ui_table_end();
34 print &ui_form_end([ [ undef, $text{'form_exec'} ] ]);
35
36 &ui_print_footer("", $text{'index_return'});
37