Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Check for admin status earlier so it's available to postlogin_action
  • Loading branch information
jonjensen committed Dec 23, 2016
1 parent ced2a56 commit e250c1f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Vend/UserDB.pm
Expand Up @@ -1941,6 +1941,9 @@ sub login {
$Vend::login_table = $Vend::Session->{login_table} = $self->{DB_ID};
$Vend::username = $Vend::Session->{username} = $self->{USERNAME};
$Vend::Session->{logged_in} = 1;
if ( $Vend::ReadOnlyCfg->{AdminUserDB}{$self->{PROFILE}} ) {
$Vend::admin = 1;
}

if (my $macros = $self->{OPTIONS}{postlogin_action}) {
eval {
Expand Down Expand Up @@ -2940,9 +2943,6 @@ sub userdb {
return undef;
}
if ($status = $user->login(%options) ) {
if( $Vend::ReadOnlyCfg->{AdminUserDB}{$user->{PROFILE}} ) {
$Vend::admin = 1;
}
::update_user();
}
}
Expand Down

0 comments on commit e250c1f

Please sign in to comment.