Navigation Menu

Skip to content

Commit

Permalink
* Interchange has long been distributing the dump page. This is
Browse files Browse the repository at this point in the history
  somewhat insecure; it should be gated with a password. This is a
  change to pages/dump.html in the standard template. Makes the
  password be __SQLPASS__ or __ORDERS_TO__.

* Allow option to sort the keys of output in ::full_dump. Turn on that
  option by default in the standard dump page.
  • Loading branch information
Mike Heins committed Mar 23, 2014
1 parent 4816a70 commit a7d81f9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
20 changes: 19 additions & 1 deletion dist/standard/pages/dump.html
@@ -1 +1,19 @@
<xmp>[dump key="[cgi key]"]</xmp>
[calc]
$Tag->tmp('tmp_gate_dump');
$pass = $Variable->{SQLPASS} || $Variable->{ORDERS_TO} || $Config->{MailOrderTo} || 'bogus';
if($CGI->{password} eq $pass) {
$Scratch->{tmp_gate_dump} = 1;
}
$CGI->{sort} = 1 unless defined $CGI->{sort};
return;
[/calc]
[if scratch tmp_gate_dump]
<xmp>[dump key="[cgi key]" sort="[cgi sort]"]</xmp>
[else]
You must provide the password. It is usually the SQL server password, or the email address where orders go.
<form action="[process href=@@MV_PAGE@@ secure=1]" METHOD=post>
Password: <input type="text" name=password value="">
<input type="submit" value="Dump">
</form>
[/else]
[/if]
3 changes: 2 additions & 1 deletion lib/Vend/Error.pm
Expand Up @@ -129,7 +129,8 @@ sub full_dump {
}

$out = minidump();
local($Data::Dumper::Indent) = 2;
local($Data::Dumper::Indent) = $opt->{indent} || 2;
local($Data::Dumper::Sortkeys) = $opt->{sort};
unless ($opt->{no_env}) {
$out .= "###### ENVIRONMENT #####\n";
if(my $h = ::http()) {
Expand Down

0 comments on commit a7d81f9

Please sign in to comment.