Changeset 583


Ignore:
Timestamp:
01/12/10 15:02:36 (14 years ago)
Author:
nanardon
Message:
  • check user connection before doing anything
File:
1 edited

Legend:

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

    r573 r583  
    2424    my ( $self, $c ) = @_; 
    2525 
     26    if (!$c->user_exists) { 
     27        if ($c->req->path ne 'login') { 
     28            $c->forward('/login'); 
     29        } 
     30    } else { 
     31        $c->model('Accounts')->db->connect($c->user->{username}, 
     32            $c->user->{password}); 
     33    } 
     34     
    2635    my $menu = ''; 
    2736    my @menus = ( 
     
    4756    } 
    4857    $c->stash->{mainmenu} = $menu; 
    49     if (!$c->user_exists) { 
    50         if ($c->req->path ne 'login') { 
    51             $c->forward('/login'); 
    52         } 
    53     } else { 
    54         $c->model('Accounts')->db->connect($c->user->{username}, 
    55             $c->user->{password}); 
    56     } 
    5758} 
    5859 
     
    6768    $c->forward($c->view('TT')); 
    6869    $c->model('Accounts')->db->rollback; 
    69     if (my $sync = $c->model('Accounts')->sync) { 
    70 #        $sync->process; 
    71     } 
     70    $c->model('Accounts')->call_batch_sync; 
    7271} 
    7372 
Note: See TracChangeset for help on using the changeset viewer.