Ignore:
Timestamp:
01/13/16 17:11:30 (8 years ago)
Author:
nanardon
Message:

Fix session expired detection

Location:
trunk/LATMOS-Accounts-Web
Files:
2 added
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts-Web/MANIFEST

    r1615 r1632  
    2929lib/LATMOS/Accounts/Web/Controller/Json/Timeline.pm 
    3030lib/LATMOS/Accounts/Web/Controller/Json/Tree.pm 
     31lib/LATMOS/Accounts/Web/Controller/Login.pm 
    3132lib/LATMOS/Accounts/Web/Controller/Logout.pm 
    3233lib/LATMOS/Accounts/Web/Controller/NetHosts.pm 
     
    101102root/html/includes/sidebar.tt 
    102103root/html/includes/wrapper.tt 
    103 root/html/login.tt 
     104root/html/login/index.tt 
    104105root/html/logout.tt 
    105106root/html/logout/index.tt 
  • trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Remote.pm

    r1570 r1632  
    1717=cut 
    1818 
    19 sub begin { 
     19sub auto { 
    2020    my ( $self, $c ) = @_; 
    2121 
    2222    if ($c->user_exists) { 
    2323        # Set login user: 
    24         $c->model('Accounts')->db->{_user} = 
    25         $c->user->{username}; 
     24        $c->model('Accounts')->db->{_user} = $c->user->{username}; 
    2625    } 
    2726} 
  • trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Root.pm

    r1609 r1632  
    4444        # Set login user: 
    4545        $c->model('Accounts')->db->{_user} = $c->user->{username}; 
     46        return 1; 
    4647    } else { 
    4748        # No need to login for About section 
    48         $c->forward('needlogin'); 
     49        $c->detach('needlogin'); 
    4950        return; 
    5051    } 
     
    6970    $c->stash->{sslid} = $ENV{$sslid}; 
    7071 
    71     $c->stash->{template} = 'login.tt'; 
    72 } 
    73  
    74 sub login : Local { 
    75     my ( $self, $c ) = @_; 
    76  
    77     my $sslid = $c->config->{ssl}->{SSL_ID} || 'HTTP_SSL_CLIENT_S_DN_EMAIL'; 
    78     $c->stash->{sslid} = $ENV{$sslid}; 
    79  
    80     $c->stash->{template} = 'login.tt'; 
    81     if ($c->req->param('username')) { 
    82         if ($c->authenticate({ 
    83                 username => $c->req->param('username') || '', 
    84                 password => $c->req->param('password') || '', 
    85                 ssl      => $c->req->param('use_ssl')  || '', 
    86         })) { 
    87             my $redirurl = $c->session->{redirurl}; 
    88             $redirurl->query_form(%{ $c->session->{redirparam} || {}}); 
    89             $c->session->{redirurl} = undef; 
    90             $c->session->{redirparam} = undef; 
    91             $c->res->redirect($redirurl || $c->uri_for('/'), ); 
    92         } else { 
    93             # invalid login... 
    94         } 
    95     } 
     72    $c->stash->{template} = 'login/index.tt'; 
    9673} 
    9774 
Note: See TracChangeset for help on using the changeset viewer.