- Timestamp:
- 12/23/15 16:54:29 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Root.pm
r1305 r1532 24 24 =cut 25 25 26 sub auth_required : Private {27 my ( $self, $c ) = @_;28 $c->forward('login');29 }30 31 26 sub component_disabled : Private { 32 27 my ( $self, $c ) = @_; … … 37 32 my ( $self, $c ) = @_; 38 33 39 $c->log->debug($c->config->{ssl}->{HTTP_SSL_CLIENT_I_DN});40 34 if ($c->user_exists) { 41 35 # Set login user: … … 43 37 } else { 44 38 # No need to login for About section 45 if (!$c->authenticate({ username => $c->req->param('username'), password => 46 $c->req->param('password') }, 'la')) { 47 $c->forward('auth_required'); 48 return; 49 } 39 $c->forward('login'); 40 return; 50 41 } 51 42 } … … 63 54 my ( $self, $c ) = @_; 64 55 56 $c->stash->{redirurl} = $c->req->uri unless($c->req->path =~ /^login/); 57 58 warn $c->config->{ssl}->{SSL_ID}; 59 my $sslid = $c->config->{ssl}->{SSL_ID} || 'HTTP_SSL_CLIENT_S_DN_EMAIL'; 60 $c->stash->{sslid} = $ENV{$sslid}; 61 65 62 $c->stash->{template} = 'login.tt'; 66 63 if ($c->req->param('username')) { 67 64 if ($c->authenticate({ 68 username => $c->req->param('username'), 69 password => $c->req->param('password')})) { 70 my $redirurl = $c->uri_for($c->req->param('loguri') || '/'); 65 username => $c->req->param('username') || '', 66 password => $c->req->param('password') || '', 67 ssl => $c->req->param('use_ssl') || '', 68 })) { 69 my $redirurl = $c->stash->{redirurl}; 70 $c->stash->{redirurl} = undef; 71 71 $c->res->redirect($redirurl || $c->uri_for('/')); 72 72 } else { … … 74 74 } 75 75 } 76 my ($redirurl) = grep { $_ } (77 $c->req->param('loguri'),78 ($c->req->path ? '/' . $c->req->path : undef),79 $c->uri_for('/'),80 );81 $c->stash->{redirurl} = $redirurl;82 76 } 83 77
Note: See TracChangeset
for help on using the changeset viewer.