chiark / gitweb /
API: Expose $authreq->chain_params()
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 27 Oct 2015 18:48:03 +0000 (18:48 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 27 Oct 2015 18:48:03 +0000 (18:48 +0000)
Contrary to what I said in a97dc2ce, it seems that this function is
indeed useful.  test/cgi wants it!

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
caf.pod
cgi-auth-flexible.pm

diff --git a/caf.pod b/caf.pod
index 90b15dbd4d3d5dc4d365d24488f94a21340d133e..fcb061521d4858218e432dd3cbd31f83d90bbb5d 100644 (file)
--- a/caf.pod
+++ b/caf.pod
@@ -462,6 +462,13 @@ Returns the value of the secret cookie.  CGI::Auth::Flexible sets this
 cookie in the forms generated by C<check_ok>.  You may also set it
 yourself (and indeed you must do so if you use C<check_divert>).
 
+item C<< $authreq->_chain_params() >>
+
+Returns a hash of the "relevant" parameters to this request, in a form
+suitable for C<url_with_query_params>.  This is all of the query
+parameters which are not related to CGI::Auth::Flexible.  The
+PATH_INFO from the request is returned as the parameter C<< '' >>.
+
 =back
 
 =head1 OTHER FUNCTIONS AND METHODS
index a661618067278c8b3099bc846603e34a617f0b19..79e12d3e80e308a31eca672bd04c42c156331919 100644 (file)
@@ -844,7 +844,7 @@ sub _check_divert_core ($) {
                                          " enabled.  You must enable cookies".
                                          " as we use them for login."),
                       _CookieRaw => $r->_fresh_secret(),
-                      Params => $r->_chain_params() })
+                      Params => $r->chain_params() })
         }
         if (!$cookt || $cookt eq 'n' || $cookh ne $parmh) {
             $r->_db_revoke($cookh);
@@ -862,13 +862,13 @@ sub _check_divert_core ($) {
             return ({ Kind => 'LOGIN-BAD',
                       Message => $login_errormessage,
                       _CookieRaw => $cooks,
-                      Params => $r->_chain_params() })
+                      Params => $r->chain_params() })
         }
        $r->_db_record_login_ok($parmh,$username);
        return ({ Kind => 'REDIRECT-LOGGEDIN',
                  Message => $r->_gt("Logging in..."),
                  _CookieRaw => $cooks,
-                 Params => $r->_chain_params() });
+                 Params => $r->chain_params() });
     }
     if ($cookt eq 't') {
        $cookt = '';
@@ -888,7 +888,7 @@ sub _check_divert_core ($) {
            return ({ Kind => 'LOGIN-INCOMINGLINK',
                      Message => $r->_gt("You need to log in."),
                      _CookieRaw => $news,
-                     Params => $r->_chain_params() });
+                     Params => $r->chain_params() });
        } else {
            $r->_db_revoke($parmh);
            return ({ Kind => 'LOGIN-FRESH',
@@ -922,14 +922,7 @@ sub _check_divert_core ($) {
     return undef;
 }
 
-sub _chain_params ($) {
-# =item C<< $authreq->_chain_params() >>
-#
-# Returns a hash of the "relevant" parameters to this request, in a form
-# used by C<url_with_query_params>.  This is all of the query parameters
-# which are not related to CGI::Auth::Flexible.  The PATH_INFO from the
-# request is returned as the parameter C<< '' >>.
-
+sub chain_params ($) {
     my ($r) = @_;
     my %p = %{ $r->_ch('get_params') };
     foreach my $pncn (keys %{ $r->{S} }) {