mirror of
https://github.com/webmin/webmin.git
synced 2025-07-20 16:48:46 +00:00
Start of work on SSL page
This commit is contained in:
BIN
gray-theme/mysql/images/ssl.gif
Normal file
BIN
gray-theme/mysql/images/ssl.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
52
mysql/edit_ssl.cgi
Normal file
52
mysql/edit_ssl.cgi
Normal file
@ -0,0 +1,52 @@
|
||||
#!/usr/local/bin/perl
|
||||
# Show a form to setup SSL
|
||||
|
||||
require './mysql-lib.pl';
|
||||
$access{'perms'} == 1 || &error($text{'cnf_ecannot'});
|
||||
&ui_print_header(undef, $text{'ssl_title'}, "", "ssl");
|
||||
|
||||
# Make sure config exists
|
||||
$conf = &get_mysql_config();
|
||||
if (!$conf) {
|
||||
print &text('cnf_efile', "<tt>$config{'my_cnf'}</tt>",
|
||||
"../config.cgi?$module_name"),"<p>\n";
|
||||
&ui_print_footer("", $text{'index_return'});
|
||||
exit;
|
||||
}
|
||||
($mysqld) = grep { $_->{'name'} eq 'mysqld' } @$conf;
|
||||
$mysqld || &error($text{'cnf_emysqld'});
|
||||
$mems = $mysqld->{'members'};
|
||||
|
||||
print &ui_form_start("save_ssl.cgi", "post");
|
||||
print &ui_table_start($text{'ssl_header'}, "width=100%", 2);
|
||||
|
||||
# SSL cert file
|
||||
$cert = &find_value("ssl_cert", $mems);
|
||||
print &ui_table_row($text{'ssl_cert'},
|
||||
&ui_opt_textbox("cert", $cert, 60, $text{'ssl_none'}));
|
||||
|
||||
# SSL key file
|
||||
$key = &find_value("ssl_key", $mems);
|
||||
print &ui_table_row($text{'ssl_key'},
|
||||
&ui_opt_textbox("key", $key, 60, $text{'ssl_none'}));
|
||||
|
||||
# SSL CA file
|
||||
$ca = &find_value("ssl_ca", $mems);
|
||||
print &ui_table_row($text{'ssl_ca'},
|
||||
&ui_opt_textbox("ca", $ca, 60, $text{'ssl_none'}));
|
||||
|
||||
# SSL mandatory?
|
||||
$req = &find_value("require_secure_transport", $mems);
|
||||
print &ui_table_row($text{'ssl_req'},
|
||||
&ui_yesno_radio("req", $req && lc($req) eq 'on'));
|
||||
|
||||
print &ui_table_end();
|
||||
my @buts = ( [ "save", $text{'save'} ] );
|
||||
if (!$cert && !$key) {
|
||||
push(@buts, [ "gen", $text{'ssl_gen'} ]);
|
||||
}
|
||||
print &ui_form_end(\@buts);
|
||||
|
||||
|
||||
&ui_print_footer("", $text{'index_return'});
|
||||
|
BIN
mysql/images/ssl.gif
Normal file
BIN
mysql/images/ssl.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 364 B |
@ -264,7 +264,7 @@ else {
|
||||
'list_tprivs.cgi', 'list_cprivs.cgi',
|
||||
'edit_cnf.cgi', 'edit_manual.cgi', 'list_procs.cgi',
|
||||
$canvars ? ( 'list_vars.cgi' ) : ( ),
|
||||
'root_form.cgi',
|
||||
'edit_ssl.cgi', 'root_form.cgi',
|
||||
);
|
||||
@titles = ( $text{'users_title'}, $text{'dbs_title'},
|
||||
$canhosts ? ( $text{'hosts_title'} ) : ( ),
|
||||
@ -272,7 +272,7 @@ else {
|
||||
$text{'cnf_title'}, $text{'manual_title'},
|
||||
$text{'procs_title'},
|
||||
$canvars ? ( $text{'vars_title'} ) : ( ),
|
||||
$text{'root_title'},
|
||||
$text{'ssl_title'}, $text{'root_title'},
|
||||
);
|
||||
@images = ( 'images/users.gif', 'images/dbs.gif',
|
||||
$canhosts ? ( 'images/hosts.gif' ) : ( ),
|
||||
@ -280,7 +280,7 @@ else {
|
||||
'images/cnf.gif', 'images/manual.gif',
|
||||
'images/procs.gif',
|
||||
$canvars ? ( 'images/vars.gif' ) : ( ),
|
||||
'images/root.gif',
|
||||
'images/ssl.gif', 'images/root.gif',
|
||||
);
|
||||
if ($access{'perms'} == 2) {
|
||||
# Remove my.cnf and database connections icons
|
||||
|
@ -871,4 +871,13 @@ mysqlpass_estartup=Startup failed : $1
|
||||
mysqlpass_echange=Password change failed : $1
|
||||
mysqlpass_echange_forcepass=Force override the given password, if lost or forgotten
|
||||
|
||||
ssl_title=SSL Certificate
|
||||
ssl_header=MySQL SSL options
|
||||
ssl_cert=SSL certificate file
|
||||
ssl_key=SSL key file
|
||||
ssl_ca=SSL CA certificate file
|
||||
ssl_req=Require clients use SSL?
|
||||
ssl_none=None set
|
||||
ssl_gen=Generate Certificate and Key
|
||||
|
||||
__norefs=1
|
||||
|
Reference in New Issue
Block a user