",&text('database_rusure', $in{'name'}),"\n";
	print &ui_form_start("save_database.cgi", "post");
	foreach $i ("dom", "name", "type", "delete") {
		print &ui_hidden($i, $in{$i}),"\n";
		}
	print &ui_submit($text{'database_ok'}, "confirm"),"
\n";
	print &ui_form_end();
	}
elsif ($in{'delete'}) {
	# Delete now
	if ($in{'name'} eq $d->{'db'} && !&can_edit_database_name()) {
		# Not allowed according to nodbname
		&error($text{'database_edbdef'});
		}
	&ui_print_header(&domain_in($d), $text{'database_title3'}, "");
	if (&indexof($in{'type'}, &list_database_plugins()) >= 0) {
		&plugin_call($in{'type'}, "database_delete", $d, $in{'name'});
		}
	else {
		$dfunc = "delete_".$in{'type'}."_database";
		&$dfunc($d, $in{'name'});
		}
	&save_domain_print($d);
	&refresh_webmin_user($d);
	&run_post_actions();
	&webmin_log("delete", "database", $in{'name'},
		    { 'type' => $in{'type'}, 'dom' => $d->{'dom'} });
	}
elsif ($in{'disc'}) {
	# Remove from server's list
	&ui_print_header(&domain_in($d), $text{'database_title4'}, "");
	@dbs = split(/\s+/, $d->{'db_'.$in{'type'}});
	@dbs = grep { $_ ne $in{'name'} } @dbs;
	$d->{'db_'.$in{'type'}} = join(" ", @dbs);
	# Call the revoke function to actually remove access
	$gfunc = "revoke_".$in{'type'}."_database";
	if (defined(&$gfunc)) {
		&$gfunc($d, $in{'name'});
		}
	&save_domain_print($d);
	&refresh_webmin_user($d);
	&run_post_actions();
	&webmin_log("export", "database", $in{'name'},
		    { 'type' => $in{'type'}, 'dom' => $d->{'dom'} });
	}
elsif ($in{'manage'}) {
	# Just redirect to module to manage
	($db) = grep { $_->{'name'} eq $in{'name'} &&
		       $_->{'type'} eq $in{'type'} } &domain_databases($d);
	&redirect($db->{'link'});
	exit;
	}
&ui_print_footer("list_databases.cgi?dom=$in{'dom'}", $text{'databases_return'},
		 &domain_footer_link($d),
		 "", $text{'index_return'});
sub save_domain_print
{
&$first_print($text{'setup_save'});
&save_domain($_[0]);
&$second_print($text{'setup_done'});
}