Revision 3772d03a
Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt
SL/Controller/LoginScreen.pm | ||
---|---|---|
4 | 4 |
|
5 | 5 |
use parent qw(SL::Controller::Base); |
6 | 6 |
|
7 |
use List::Util qw(first); |
|
8 |
|
|
7 | 9 |
use SL::Dispatcher::AuthHandler::User; |
10 |
use SL::DB::AuthClient; |
|
11 |
use SL::DB::AuthGroup; |
|
12 |
use SL::DB::AuthUser; |
|
8 | 13 |
use SL::User; |
9 | 14 |
|
15 |
use Rose::Object::MakeMethods::Generic ( |
|
16 |
'scalar --get_set_init' => [ qw(clients default_client_id) ], |
|
17 |
); |
|
18 |
|
|
10 | 19 |
__PACKAGE__->run_before('set_layout'); |
20 |
|
|
11 | 21 |
# |
12 | 22 |
# actions |
13 | 23 |
# |
... | ... | |
122 | 132 |
$::request->{layout} = SL::Layout::Dispatcher->new(style => 'login'); |
123 | 133 |
} |
124 | 134 |
|
135 |
sub init_clients { |
|
136 |
return SL::DB::Manager::AuthClient->get_all_sorted; |
|
137 |
} |
|
138 |
|
|
139 |
sub init_default_client_id { |
|
140 |
my ($self) = @_; |
|
141 |
my $default_client = first { $_->is_default } @{ $self->clients }; |
|
142 |
return $default_client ? $default_client->id : undef; |
|
143 |
} |
|
144 |
|
|
125 | 145 |
1; |
Auch abrufbar als: Unified diff
Mandantenauswahl in Loginbildschirm anzeigen