mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 06:03:28 +00:00
Allow new DB template selection
This commit is contained in:
@@ -73,3 +73,4 @@ Added a history of previous commands to the Execute SQL page.
|
||||
Added greater than / less than selectors to the table data search form.
|
||||
---- Changes since 1.530 ----
|
||||
Added an option to the restore form to limit the restore to only certain tables.
|
||||
When creating a new database, a template database to copy from can now be selected.
|
||||
|
||||
@@ -218,6 +218,8 @@ newdb_epath=Missing database path
|
||||
newdb_user=Owned by user
|
||||
newdb_encoding=Character set encoding
|
||||
newdb_eencoding=Missing character set encoding
|
||||
newdb_template=Template database
|
||||
newdb_notemplate=None
|
||||
|
||||
user_title=PostgreSQL Users
|
||||
user_ecannot=You are not allowed to edit users
|
||||
|
||||
@@ -27,6 +27,9 @@ if (!$in{'encoding_def'} && &get_postgresql_version() >= 8) {
|
||||
$in{'encoding'} =~ /\S/ || &error($text{'newdb_eencoding'});
|
||||
$cmd .= " encoding = '$in{'encoding'}'";
|
||||
}
|
||||
if ($in{'template'}) {
|
||||
$cmd .= " template = $in{'template'}";
|
||||
}
|
||||
&execute_sql_logged($config{'basedb'}, $cmd);
|
||||
&webmin_log("create", "db", $in{'db'});
|
||||
if ($access{'dbs'} ne '*') {
|
||||
|
||||
@@ -34,6 +34,12 @@ if (&get_postgresql_version() >= 8) {
|
||||
print &ui_table_row($text{'newdb_path'},
|
||||
&ui_opt_textbox("path", undef, 40, $text{'default'}));
|
||||
|
||||
# Template DB
|
||||
print &ui_table_row($text{'newdb_template'},
|
||||
&ui_select("template", undef,
|
||||
[ [ undef, "<".$text{'newdb_notemplate'}.">" ],
|
||||
&list_databases() ]));
|
||||
|
||||
print &ui_table_end();
|
||||
print &ui_form_end([ [ undef, $text{'create'} ] ]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user