use SL::Dispatcher::AuthHandler::User;
use SL::User;
+__PACKAGE__->run_before('set_layout');
#
# actions
#
sub action_login {
my ($self) = @_;
- %::myconfig = $::form->{'{AUTH}login'} ? $::auth->read_user(login => $::form->{'{AUTH}login'}) : ();
- %::myconfig = SL::Dispatcher::AuthHandler::User->new->handle(countrycode => $::myconfig{countrycode});
+ my $login = $::form->{'{AUTH}login'} || $::auth->get_session_value('login');
+ %::myconfig = $login ? $::auth->read_user(login => $login) : ();
+ SL::Dispatcher::AuthHandler::User->new->handle(countrycode => $::myconfig{countrycode});
$::form->{login} = $::myconfig{login};
$::locale = Locale->new($::myconfig{countrycode}) if $::myconfig{countrycode};
my $user = User->new(login => $::myconfig{login});
+ $::request->{layout} = SL::Layout::Dispatcher->new(style => $user->{menustyle});
# if we get an error back, bale out
my $result = $user->login($::form);
}->{$_[0]};
}
+sub set_layout {
+ $::request->{layout} = SL::Layout::Dispatcher->new(style => 'login');
+}
+
1;