Revision 722fee3c
Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt
SL/Controller/LoginScreen.pm | ||
---|---|---|
10 | 10 |
use SL::DB::AuthClient; |
11 | 11 |
use SL::DB::AuthGroup; |
12 | 12 |
use SL::DB::AuthUser; |
13 |
use SL::Locale::String qw(t8); |
|
13 | 14 |
use SL::User; |
14 | 15 |
|
15 | 16 |
use Rose::Object::MakeMethods::Generic ( |
... | ... | |
54 | 55 |
} |
55 | 56 |
|
56 | 57 |
%::myconfig = $login ? $::auth->read_user(login => $login) : (); |
57 |
SL::Dispatcher::AuthHandler::User->new->handle(countrycode => $::myconfig{countrycode}); |
|
58 |
$::form->{login} = $::myconfig{login}; |
|
58 |
$::form->{login} = $login; |
|
59 | 59 |
$::locale = Locale->new($::myconfig{countrycode}) if $::myconfig{countrycode}; |
60 |
my $user = User->new(login => $::myconfig{login}); |
|
61 |
$::request->{layout} = SL::Layout::Dispatcher->new(style => $user->{menustyle}); |
|
60 |
SL::Dispatcher::AuthHandler::User->new->handle(countrycode => $::myconfig{countrycode}); |
|
61 |
|
|
62 |
$::request->layout(SL::Layout::Dispatcher->new(style => $::myconfig{menustyle})); |
|
62 | 63 |
|
63 | 64 |
# if we get an error back, bale out |
64 |
my $result = $user->login($::form);
|
|
65 |
my $result = User->new(login => $::myconfig{login})->login($::form);
|
|
65 | 66 |
|
66 | 67 |
# Database update available? |
67 | 68 |
::end_of_request() if -2 == $result; |
... | ... | |
84 | 85 |
# TODO: Employees anlegen/checken |
85 | 86 |
# $self->_ensure_employees_for_authorized_users_exist; |
86 | 87 |
|
87 |
$self->_redirect_to_main_script($user);
|
|
88 |
$self->_redirect_to_main_script; |
|
88 | 89 |
} |
89 | 90 |
|
90 | 91 |
# |
... | ... | |
103 | 104 |
# |
104 | 105 |
|
105 | 106 |
sub _redirect_to_main_script { |
106 |
my ($self, $user) = @_;
|
|
107 |
my ($self) = @_; |
|
107 | 108 |
|
108 | 109 |
return $self->redirect_to($::form->{callback}) if $::form->{callback}; |
109 | 110 |
|
... | ... | |
135 | 136 |
sub error_state { |
136 | 137 |
return { |
137 | 138 |
session => $::locale->text('The session is invalid or has expired.'), |
138 |
password => $::locale->text('Incorrect password!'),
|
|
139 |
password => $::locale->text('Incorrect username or password or no access to selected client!'),
|
|
139 | 140 |
}->{$_[0]}; |
140 | 141 |
} |
141 | 142 |
|
Auch abrufbar als: Unified diff
Userlogin mit Mandanten gefixt (erster Schritt)