Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 3772d03a

Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt

  • ID 3772d03ab5a1d64173504ca61bf737dfcd451a92
  • Vorgänger 895309b3
  • Nachfolger 8b34d295

Mandantenauswahl in Loginbildschirm anzeigen

Unterschiede anzeigen:

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;
templates/webpages/login_screen/user_login.html
1 1
[%- USE T8 %]
2
[%- USE HTML %]
2
[%- USE HTML %][%- USE L -%][%- USE LxERP -%]
3 3
 <center>
4 4
  <table class="login" border="3" cellpadding="20">
5 5
   <tr>
......
11 11
     <p><span class="message_error_login">[% error %]</span></p>
12 12
     [% END %]
13 13

  
14
     <p>
15

  
14
[% IF SELF.clients.size %]
15
[%- SET style="width: 250px" %]
16 16
      <form method="post" name="loginscreen" action="controller.pl" target="_top">
17 17

  
18 18
       <input type="hidden" name="show_dbupdate_warning" value="1">
......
23 23
          <table>
24 24
           <tr>
25 25
            <th align="right">[% 'Login Name' | $T8 %]</th>
26
            <td><input id='input_login' class="login" name="{AUTH}login" size="30" tabindex="1"></td>
26
            <td>[% L.input_tag('{AUTH}login', '', style=style) %]</td>
27 27
           </tr>
28 28
           <tr>
29 29
            <th align="right">[% 'Password' | $T8 %]</th>
30
            <td><input class="login" type="password" name="{AUTH}password" size="30" tabindex="2"></td>
30
            <td>[% L.input_tag('{AUTH}password', '', type='password', style=style) %]</td>
31
           </tr>
32
           <tr>
33
            <th align="right">[% 'Client' | $T8 %]</th>
34
            <td>[% L.select_tag('{AUTH}client_id', SELF.clients, title_key='name', default=SELF.default_client_id, style=style) %]</td>
31 35
           </tr>
32 36
          </table>
33 37

  
......
40 44
       </table>
41 45

  
42 46
      </form>
47
[%- ELSE %]
48
      <p>
49
       [% LxERP.t8("No clients have been created yet.") %]
50
       [% LxERP.t8("Please do so in the administration area.") %]
51
      </p>
52

  
53
      <p>
54
       <a href="controller.pl?action=Admin/login">[% LxERP.t8("Administration area") %]</a>
55
      </p>
56
[%- END %]
43 57

  
44 58
    </td>
45 59
   </tr>

Auch abrufbar als: Unified diff