projects
/
kivitendo-erp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2f4fdf7
)
LoginScreen: im Check auf "schon angemeldet?" Client setzen
author
Moritz Bunkus
<m.bunkus@linet-services.de>
Tue, 16 Jul 2013 11:07:27 +0000
(13:07 +0200)
committer
Moritz Bunkus
<m.bunkus@linet-services.de>
Tue, 16 Jul 2013 11:07:27 +0000
(13:07 +0200)
SL/Controller/LoginScreen.pm
patch
|
blob
|
history
diff --git
a/SL/Controller/LoginScreen.pm
b/SL/Controller/LoginScreen.pm
index
ba10984
..
e84a315
100644
(file)
--- a/
SL/Controller/LoginScreen.pm
+++ b/
SL/Controller/LoginScreen.pm
@@
-129,6
+129,19
@@
sub _redirect_to_main_script_if_already_logged_in {
my %user = $::auth->read_user(login => $login);
return if ($user{login} || '') ne $login;
my %user = $::auth->read_user(login => $login);
return if ($user{login} || '') ne $login;
+ # Check if there's a client set in the session -- and whether or not
+ # the user still has access to the client.
+ my $client_id = $::auth->get_session_value('client_id');
+ return if !$client_id;
+
+ if (!$::auth->set_client($client_id)) {
+ $::auth->punish_wrong_login;
+ $::auth->destroy_session;
+ $::auth->create_or_refresh_session;
+ $self->show_login_form(error => t8('Incorrect username or password or no access to selected client!'));
+ return 1;
+ }
+
# Check if the session is logged in correctly.
return if SL::Auth::OK() != $::auth->authenticate($login, undef);
# Check if the session is logged in correctly.
return if SL::Auth::OK() != $::auth->authenticate($login, undef);