OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Thomas Lotterer
  Root:   /v/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-registry                 Date:   25-Nov-2005 22:45:26
  Branch: HEAD                             Handle: 2005112521452500

  Modified files:
    openpkg-registry        registry-ui.pl

  Log:
    precheck pages which require authentication early and detour through
    ase login

  Summary:
    Revision    Changes     Path
    1.20        +28 -2      openpkg-registry/registry-ui.pl
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-registry/registry-ui.pl
  ============================================================================
  $ cvs diff -u -r1.19 -r1.20 registry-ui.pl
  --- openpkg-registry/registry-ui.pl   25 Nov 2005 18:17:38 -0000      1.19
  +++ openpkg-registry/registry-ui.pl   25 Nov 2005 21:45:25 -0000      1.20
  @@ -230,7 +230,7 @@
   elsif ($cgi->param("page") eq "association") {
       my $out;
       $out = '';
  -    $out .= &viewhttp();
  +    $out .= viewhttpauthrequired("association");
       $out .= &viewhtmlhead(-menu);
       $out .= &viewassociation();
       $out .= &viewhtmltail();
  @@ -287,7 +287,7 @@
       return $cgi->user_agent() =~ 
m:^openpkg-regist(er|ry)/[01][\.ab]\d+[\.ab]\d+$:;
   }
   
  -sub viewhttp ($$$)
  +sub httpheader ($$$)
   {
       my ($type, $expires, $refresh) = @_;
       my $header = {};
  @@ -307,6 +307,32 @@
           )
       }
   
  +    return $header;
  +}
  +
  +sub viewhttp ($$$)
  +{
  +    my ($type, $expires, $refresh) = @_;
  +    my $header = {};
  +
  +    $header = &httpheader($type, $expires, $refresh);
  +
  +    return $cgi->header($header);
  +}
  +
  +sub viewhttpauthrequired($$$$)
  +{
  +    my ($page, $type, $expires, $refresh) = @_;
  +    my ($header, $username);
  +    
  +    $header = &httpheader($type, $expires, $refresh);
  +
  +    $username = &identifyusername();
  +    if (not defined $username or $username eq '') {
  +        if    ($cfg->{identification}->{mode} eq "ase") {
  +            $header->{redirect} = $cgi->redirect(-uri => $ase->url(-action 
=> "login", -mode_during => "ase", -mode_after => "association"));
  +        }
  +    }
       return $cgi->header($header);
   }
   
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [email protected]

Reply via email to