\n"; $need_unlink = 1; } else { # From local file -r $in{'file'} || &error($text{'exec_efile'}); $file = $in{'file'}; &ui_print_header(undef, $text{'exec_title'}, ""); print &text('exec_fileout', "$in{'file'}"),"
\n"; $need_unlink = 0; } # Un-compress file if needed $cf = &compression_format($file); $cmd = $cf == 1 ? "gunzip -c" : $cf == 2 ? "uncompress -C" : $cf == 3 ? "bunzip2 -c" : undef; if ($cmd) { ($prog, @args) = split(/\s+/, $cmd); &has_command($prog) || &error(&text('exec_ecompress', "$prog")); $tempfile = &transname(); $out = &backquote_command( "$cmd <".quotemeta($file)." 2>&1 >".quotemeta($tempfile)); if ($?) { &error(&text('exec_ecompress2', "
$out
"; ($ex, $out) = &execute_sql_file($in{'db'}, $file, undef, undef, $access{'buser'}); print &html_escape($out); $got++ if ($out =~ /\S/); print "$text{'exec_noout'}\n" if (!$got); print "
\n"; } } &webmin_log("execfile", undef, $in{'db'}, { 'mode' => $in{'mode'}, 'file' => $in{'file'} }); unlink($file) if ($need_unlink); &ui_print_footer("exec_form.cgi?db=$in{'db'}&mode=file", $text{'exec_return'}, "edit_dbase.cgi?db=$in{'db'}", $text{'dbase_return'}, &get_databases_return_link($in{'db'}), $text{'index_return'});