mirror of
https://github.com/webmin/webmin.git
synced 2026-10-29 14:40:39 +00:00
This fixes missing permission checks in the MySQL manual configuration editor, with both read and write endpoints now require full configuration permissions to match the existing checks used by the configuration editor.
34 lines
1013 B
Perl
Executable File
34 lines
1013 B
Perl
Executable File
#!/usr/local/bin/perl
|
|
# Show a config file for manual editing
|
|
|
|
require './mysql-lib.pl';
|
|
$access{'perms'} == 1 || &error($text{'cnf_ecannot'});
|
|
&ReadParse();
|
|
&ui_print_header($header_subtext, $text{'manual_title'}, "");
|
|
|
|
$conf = &get_mysql_config();
|
|
@files = &unique(map { $_->{'file'} } @$conf);
|
|
$in{'manual'} ||= $files[0];
|
|
&indexof($in{'manual'}, @files) >= 0 ||
|
|
&error($text{'manual_efile'});
|
|
|
|
# File selector
|
|
print &ui_form_start("edit_manual.cgi");
|
|
print $form_hiddens;
|
|
print "<b>$text{'manual_file'}</b>\n",
|
|
&ui_select("manual", $in{'manual'}, \@files),"\n",
|
|
&ui_submit('Edit');
|
|
print &ui_form_end();
|
|
|
|
# Config editor
|
|
print &ui_form_start("save_manual.cgi", "form-data");
|
|
print $form_hiddens;
|
|
print &ui_hidden("manual", $in{'manual'});
|
|
print &ui_table_start(undef, undef, 2);
|
|
print &ui_table_row(undef,
|
|
&ui_textarea("data", &read_file_contents($in{'manual'}), 20, 80), 2);
|
|
print &ui_table_end();
|
|
print &ui_form_end([ [ undef, $text{'save'} ] ]);
|
|
|
|
&ui_print_footer("", $text{'index_return'});
|