Changeset 1367


Ignore:
Timestamp:
07/08/15 15:06:49 (9 years ago)
Author:
nanardon
Message:

Split authentication function per base fonctionnality

Location:
trunk/LATMOS-Accounts/lib/LATMOS/Accounts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases.pm

    r1357 r1367  
    969969    }; 
    970970 
    971     if ($self->attribute('user', 'exported')) { 
    972         if (!$uobj->_get_c_field('exported')) { 
    973             la_log(LA_ERR, "User $username found but currently unexported"); 
    974             return; 
    975         } 
    976     } 
    977  
    978971    if ($uobj->_get_c_field('expired')) { 
    979972        la_log(LA_ERR, "Account $username has expired (%s)", 
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql.pm

    r1327 r1367  
    176176}  
    177177 
     178sub authenticate_user { 
     179    my ($self, $username, $passwd) = @_; 
     180    $username or return; 
     181    my $uobj = $self->get_object('user', $username) or do { 
     182        la_log(LA_ERR, "Cannot authenticate non existing user $username"); 
     183        return; 
     184    }; 
     185 
     186    if ($self->attribute('user', 'exported')) { 
     187        if (!$uobj->_get_c_field('exported')) { 
     188            la_log(LA_ERR, "User $username found but currently unexported"); 
     189            return; 
     190        } 
     191    } 
     192 
     193    $self->SUPER::authenticate_user($username, $passwd); 
     194} 
     195 
    178196=head1 SPECIFICS FUNCTIONS 
    179197 
Note: See TracChangeset for help on using the changeset viewer.