Changeset 782


Ignore:
Timestamp:
02/02/10 02:34:38 (14 years ago)
Author:
nanardon
Message:
  • properly handle redirect url at login
Location:
LATMOS-Accounts-Web
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Root.pm

    r651 r782  
    4040                username => $c->req->param('username'), 
    4141                password => $c->req->param('password')})) { 
    42             my $redirurl = $c->uri_for($c->req->param('loguri') || '/'); 
    43             $redirurl = $c->uri_for('/') if ($redirurl =~ m:^/login:); 
     42            my $redirurl = $c->uri_for($c->req->param('loguri') ||  '/'); 
    4443            $c->res->redirect($redirurl || $c->uri_for('/')); 
    4544        } else { 
     
    4746        } 
    4847    } 
     48    my ($redirurl) = grep { $_ } ( 
     49        $c->req->param('loguri'), 
     50        ($c->req->path ? '/' . $c->req->path : undef), 
     51        $c->uri_for('/'), 
     52    ); 
     53    $c->stash->{redirurl} = $redirurl; 
    4954} 
    5055 
  • LATMOS-Accounts-Web/root/html/login.tt

    r600 r782  
    22<form action="[% c.uri_for('/login') %]" method="POST"> 
    33<p>Vous devez vous connecter:</p> 
    4 <input type="hidden" name="loguri" value="[% '/' _ c.req.path | html %]"> 
     4<input type="hidden" name="loguri" value="[% redirurl | html %]"> 
    55<table border="0" align="center"> 
    66<tr> 
Note: See TracChangeset for help on using the changeset viewer.