diff --git a/mysql/lang/en b/mysql/lang/en index 961df575c..5da26f287 100644 --- a/mysql/lang/en +++ b/mysql/lang/en @@ -243,7 +243,8 @@ users_anon=Anonymous users_none=None users_return=user list users_sync=The options below configure synchronization between Unix users created through Webmin and MySQL users. -users_sync_create=Add a new MySQL user when a Unix user is added, with permissions ... +users_syncwhen=When to synchronize +users_sync_create=Add a new MySQL user when a Unix user is added users_sync_modify=Update a MySQL user when the matching Unix user is modified. users_sync_delete=Delete a MySQL user when the matching Unix user is deleted. users_sync_privs=Permissions for new users diff --git a/mysql/list_users.cgi b/mysql/list_users.cgi index 9507b9bc8..dfa9dd897 100755 --- a/mysql/list_users.cgi +++ b/mysql/list_users.cgi @@ -41,34 +41,36 @@ print &ui_columns_end(); print &ui_links_row(\@rowlinks); print &ui_form_end([ [ "delete", $text{'users_delete'} ] ]); +# Unix / MySQL user syncing print &ui_hr(); -print "
\n"; +print &ui_form_start("save_sync.cgi"); print "$text{'users_sync'}

\n"; -print "\n"; -print "\n", - $config{'sync_host'}; -print "
\n"; -printf " %s
\n", - $config{'sync_create'} ? "checked" : "", $text{'users_sync_create'}; -printf " %s
\n", - $config{'sync_modify'} ? "checked" : "", $text{'users_sync_modify'}; -printf " %s
\n", - $config{'sync_delete'} ? "checked" : "", $text{'users_sync_delete'}; +print &ui_table_start(undef, undef, 2); -map { $priv{$_}++ } split(/\s+/, $config{'sync_privs'}); -print "
$text{'users_sync_host'}\n"; -printf " %s\n", - $config{'sync_host'} ? "" : "checked", $text{'users_sync_def'}; -printf " %s\n", - $config{'sync_host'} ? "checked" : "", $text{'users_sync_sel'}; -printf "
\n"; -print "

\n"; +# When to sync +print &ui_table_row($text{'users_syncwhen'}, + &ui_checkbox("sync_create", 1, $text{'users_sync_create'}, + $config{'sync_create'})."
\n". + &ui_checkbox("sync_modify", 1, $text{'users_sync_modify'}, + $config{'sync_modify'})."
\n". + &ui_checkbox("sync_delete", 1, $text{'users_sync_delete'}, + $config{'sync_delete'})); + +# Privs for new users +print &ui_table_row($text{'users_sync_privs'}, + &ui_select("sync_privs", + [ split(/\s+/, $config{'sync_privs'}) ], + [ map { [ $_, $text{"user_priv$_"} ] } + ( 3 .. &user_priv_cols()+3-1 ) ], + 5, 1)); + +# Hosts for new users +print &ui_table_row($text{'users_sync_host'}, + &ui_opt_textbox("host", $config{'sync_host'}, 30, + $text{'users_sync_def'}, $text{'users_sync_sel'})); + +print &ui_table_end(); +print &ui_form_end([ [ undef, $text{'save'} ] ]); &ui_print_footer("", $text{'index_return'});