From d3bb4db1c30aae019cf2a5f52fdbc44bca6a5e15 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 18 Jan 2013 19:08:53 +0000 Subject: [PATCH 1/1] provide new debug hook --- cgi-auth-flexible.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cgi-auth-flexible.pm b/cgi-auth-flexible.pm index a959cba..eab1fe1 100644 --- a/cgi-auth-flexible.pm +++ b/cgi-auth-flexible.pm @@ -226,6 +226,7 @@ sub new_verifier { gen_postmainpage_form => \&gen_postmainpage_form, gettext => sub { gettext($_[2]); }, print => sub { print $_[2] or die $!; }, + debug => sub { }, # like print; msgs contain trailing \n }, Dbh => undef, }; @@ -357,6 +358,11 @@ sub _rp ($$@) { my $p = scalar $r->_ch('get_param',$pn) } +sub _debug ($@) { + my ($r,@args) = @_; + $r->_ch('debug',@args); +} + sub _get_path ($$) { my ($v,$keybase) = @_; my $leaf = $v->{S}{"${keybase}_path"}; @@ -507,7 +513,7 @@ sub _check_divert_core ($) { ? $cooks : undef; my ($parmt) = $r->_identify($parmh, $parms); -#print STDERR "_c_d_c cookt=$cookt parmt=$parmt\n"; + $r->_debug("_c_d_c cookt=$cookt parmt=$parmt\n"); if ($r->_ch('is_logout')) { $r->_must_be_post(); @@ -720,7 +726,7 @@ sub check_divert ($) { my $dbh = $r->{Dbh}; $r->{Divert} = $r->_db_transaction(sub { $r->_check_divert_core(); }); $dbh->commit(); -#print STDERR Dumper($r->{Divert}); + $r->_debug(Data::Dumper->Dump([$r->{Divert}],[qw(divert)])); return $r->{Divert}; } -- 2.30.2