Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision d8ac0828

Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt

  • ID d8ac08282dad52789b8bea785e8cddae44085483
  • Vorgänger 738fb45b
  • Nachfolger 672e9658

Admin: Teile von admin.pl in neuen Controller Admin verschoben; Mandanten anzeigen

Unterschiede anzeigen:

SL/Auth.pm
566 566

  
567 567
  if (!$session_id) {
568 568
    $main::lxdebug->leave_sub();
569
    return SESSION_NONE;
569
    return $self->session_restore_result(SESSION_NONE());
570 570
  }
571 571

  
572 572
  my ($dbh, $query, $sth, $cookie, $ref, $form);
......
576 576
  # Don't fail if the auth DB doesn't yet.
577 577
  if (!( $dbh = $self->dbconnect(1) )) {
578 578
    $::lxdebug->leave_sub;
579
    return SESSION_NONE;
579
    return $self->session_restore_result(SESSION_NONE());
580 580
  }
581 581

  
582 582
  # Don't fail if the "auth" schema doesn't exist yet, e.g. if the
......
586 586
  if (!($sth = $dbh->prepare($query)) || !$sth->execute($session_id)) {
587 587
    $sth->finish if $sth;
588 588
    $::lxdebug->leave_sub;
589
    return SESSION_NONE;
589
    return $self->session_restore_result(SESSION_NONE());
590 590
  }
591 591

  
592 592
  $cookie = $sth->fetchrow_hashref;
......
605 605
  if ($cookie_is_bad) {
606 606
    $self->destroy_session();
607 607
    $main::lxdebug->leave_sub();
608
    return $cookie ? SESSION_EXPIRED : SESSION_NONE;
608
    return $self->session_restore_result($cookie ? SESSION_EXPIRED() : SESSION_NONE());
609 609
  }
610 610

  
611 611
  if ($self->{column_information}->has('auto_restore')) {
......
616 616

  
617 617
  $main::lxdebug->leave_sub();
618 618

  
619
  return SESSION_OK;
619
  return $self->session_restore_result(SESSION_OK());
620
}
621

  
622
sub session_restore_result {
623
  my $self = shift;
624
  if (@_) {
625
    $self->{session_restore_result} = $_[0];
626
  }
627
  return $self->{session_restore_result};
620 628
}
621 629

  
622 630
sub _load_without_auto_restore_column {
SL/Controller/Admin.pm
1
package SL::Controller::Admin;
2

  
3
use strict;
4

  
5
use parent qw(SL::Controller::Base);
6

  
7
use IO::File;
8

  
9
use SL::DB::AuthUser;
10
use SL::DB::AuthGroup;
11
use SL::Helper::Flash;
12
use SL::Locale::String qw(t8);
13

  
14
use Rose::Object::MakeMethods::Generic
15
(
16
  'scalar --get_set_init' => [ qw(client user nologin_file_name db_cfg) ],
17
);
18

  
19
__PACKAGE__->run_before(\&setup_layout);
20

  
21
sub get_auth_level { "admin" };
22
sub keep_auth_vars {
23
  my ($class, %params) = @_;
24
  return $params{action} eq 'login';
25
}
26

  
27
#
28
# actions
29
#
30

  
31
sub action_login {
32
  my ($self) = @_;
33

  
34
  return $self->login_form if !$::form->{do_login};
35
  return                   if !$self->authenticate_root;
36
  return                   if !$self->check_auth_db_and_tables;
37
  return                   if  $self->apply_dbupgrade_scripts;
38
  $self->redirect_to(action => 'list_clients_and_users');
39
}
40

  
41
sub action_logout {
42
  my ($self) = @_;
43
  $::auth->destroy_session;
44
  $self->redirect_to(action => 'login');
45
}
46

  
47
sub action_apply_dbupgrade_scripts {
48
  my ($self) = @_;
49

  
50
  return if $self->apply_dbupgrade_scripts;
51
  $self->action_list_clients_and_users;
52
}
53

  
54
sub action_create_auth_db {
55
  my ($self) = @_;
56

  
57
  $::auth->create_database(superuser          => $::form->{db_superuser},
58
                           superuser_password => $::form->{db_superuser_password},
59
                           template           => $::form->{db_template});
60
  $self->check_auth_db_and_tables;
61
}
62

  
63
sub action_create_auth_tables {
64
  my ($self) = @_;
65

  
66
  $::auth->create_tables;
67
  $::auth->set_session_value('admin_password', $::lx_office_conf{authentication}->{admin_password});
68
  $::auth->create_or_refresh_session;
69

  
70
  my $group = (SL::DB::Manager::AuthGroup->get_all(limit => 1))[0];
71
  if (!$group) {
72
    SL::DB::AuthGroup->new(
73
      name        => t8('Full Access'),
74
      description => t8('Full access to all functions'),
75
      rights      => [ map { SL::DB::AuthGroupRight->new(right => $_, granted => 1) } SL::Auth::all_rights() ],
76
    )->save;
77
  }
78

  
79
  if (!$self->apply_dbupgrade_scripts) {
80
    $self->action_login;
81
  }
82
}
83

  
84
sub action_list_clients_and_users {
85
  my ($self) = @_;
86

  
87
  $self->render(
88
    "admin/list_users",
89
    CLIENTS => SL::DB::Manager::AuthClient->get_all_sorted,
90
    USERS   => SL::DB::Manager::AuthUser->get_all_sorted,
91
    LOCKED  => (-e $self->nologin_file_name),
92
    title   => "kivitendo " . $::locale->text('Administration'),
93
  );
94
}
95

  
96
sub action_unlock_system {
97
  my ($self) = @_;
98
  unlink $self->nologin_file_name;
99
  flash_later('info', t8('Lockfile removed!'));
100
  $self->redirect_to(action => 'list_clients_and_users');
101
}
102

  
103
sub action_lock_system {
104
  my ($self) = @_;
105

  
106
  my $fh = IO::File->new($self->nologin_file_name, "w");
107
  if (!$fh) {
108
    $::form->error(t8('Cannot create Lock!'));
109

  
110
  } else {
111
    $fh->close;
112
    flash_later('info', t8('Lockfile created!'));
113
    $self->redirect_to(action => 'list_clients_and_users');
114
  }
115
}
116

  
117
#
118
# initializers
119
#
120

  
121
sub init_db_cfg            { $::lx_office_conf{'authentication/database'}               }
122
sub init_nologin_file_name { $::lx_office_conf{paths}->{userspath} . '/nologin';        }
123
sub init_client            { SL::DB::AuthClient->new(id => $::form->{client_id})->load; }
124
sub init_user              { SL::DB::AuthUser  ->new(id => $::form->{user_id}  )->load; }
125

  
126
#
127
# filters
128
#
129

  
130
sub setup_layout {
131
  my ($self, $action) = @_;
132

  
133
  $::request->layout(SL::Layout::Dispatcher->new(style => 'admin'));
134
  $::request->layout->use_stylesheet("lx-office-erp.css");
135
  $::form->{favicon} = "favicon.ico";
136
}
137

  
138
#
139
# helpers
140
#
141

  
142
sub login_form {
143
  my ($self, %params) = @_;
144
  $::request->layout->focus('#admin_password');
145
  $self->render('admin/adminlogin', title => t8('kivitendo v#1 administration', $::form->{version}), %params);
146
}
147

  
148
sub check_auth_db_and_tables {
149
  my ($self) = @_;
150

  
151
  if (!$::auth->check_database) {
152
    $self->render('admin/check_auth_database', title => t8('Authentification database creation'));
153
    return 0;
154
  }
155

  
156
  if (!$::auth->check_tables) {
157
    $self->render('admin/check_auth_tables', title => t8('Authentification tables creation'));
158
    return 0;
159
  }
160

  
161
  return 1;
162
}
163

  
164
sub apply_dbupgrade_scripts {
165
  return SL::DBUpgrade2->new(form => $::form, dbdriver => 'Pg', auth => 1)->apply_admin_dbupgrade_scripts(1);
166
}
167

  
168
sub authenticate_root {
169
  my ($self) = @_;
170

  
171
  return 1 if $::auth->authenticate_root($::form->{'{AUTH}admin_password'}) == $::auth->OK();
172

  
173
  $::auth->punish_wrong_login;
174
  $::auth->delete_session_value('admin_password');
175

  
176
  $self->login_form(error => t8('Incorrect Password!'));
177

  
178
  return undef;
179
}
180

  
181
1;
SL/Controller/Base.pm
562 562
future value C<none> (which would require no authentication but is not
563 563
yet implemented).
564 564

  
565
=item C<keep_auth_vars_in_form>
565
=item C<keep_auth_vars_in_form %params>
566 566

  
567 567
May be overridden by a controller. If falsish (the default) all form
568 568
variables whose name starts with C<{AUTH}> are removed before the
569 569
request is routed. Only controllers that handle login requests
570 570
themselves should return trueish for this function.
571 571

  
572
C<$params{action}> contains the action name that the request will be
573
dispatched to.
574

  
572 575
=item C<controller_name>
573 576

  
574 577
Returns the name of the curernt controller package without the
SL/DB.pm
49 49
  my %connect_settings;
50 50
  my $initial_sql;
51 51

  
52
  if ($type eq 'KIVITENDO_AUTH') {
52
  if (($type eq 'KIVITENDO_AUTH') && $::auth && $::auth->{DB_config} && $::auth->session_tables_present) {
53 53
    %connect_settings = ( driver          => 'Pg',
54 54
                          database        => $::auth->{DB_config}->{db},
55 55
                          host            => $::auth->{DB_config}->{host} || 'localhost',
......
58 58
                          password        => $::auth->{DB_config}->{password},
59 59
                          connect_options => { pg_enable_utf8 => $::locale && $::locale->is_utf8,
60 60
                                             });
61
  } elsif (!%::myconfig) {
62
    $type = 'KIVITENDO_EMPTY';
63
    %connect_settings = ( driver => 'Pg' );
61
  }
64 62

  
65
  } else {
63
  if (!%connect_settings && %::myconfig) {
66 64
    my $european_dates = 0;
67 65
    if ($::myconfig{dateformat}) {
68 66
      $european_dates = 1 if $_dateformats{ $::myconfig{dateformat} }
......
80 78
                          european_dates  => $european_dates);
81 79
  }
82 80

  
81
  if (!%connect_settings) {
82
    $type = 'KIVITENDO_EMPTY';
83
    %connect_settings = ( driver => 'Pg' );
84
  }
85

  
83 86
  my %flattened_settings = _flatten_settings(%connect_settings);
84 87

  
85 88
  $domain = 'KIVITENDO' if $type =~ m/^KIVITENDO/;
SL/DB/AuthClient.pm
6 6
use strict;
7 7

  
8 8
use SL::DB::MetaSetup::AuthClient;
9
use SL::DB::Manager::AuthClient;
9 10

  
10 11
# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
11 12
__PACKAGE__->meta->schema('auth');
12 13

  
13
__PACKAGE__->meta->make_manager_class;
14

  
15 14
__PACKAGE__->meta->add_relationship(
16 15
  users => {
17 16
    type      => 'many to many',
SL/DB/AuthGroup.pm
6 6
use strict;
7 7

  
8 8
use SL::DB::MetaSetup::AuthGroup;
9
use SL::DB::Manager::AuthGroup;
9 10
use SL::DB::AuthGroupRight;
10 11

  
11
# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
12
__PACKAGE__->meta->make_manager_class;
13

  
14 12
__PACKAGE__->meta->schema('auth');
15 13

  
16 14
__PACKAGE__->meta->add_relationship(
SL/DB/AuthUser.pm
8 8
use List::Util qw(first);
9 9

  
10 10
use SL::DB::MetaSetup::AuthUser;
11
use SL::DB::Manager::AuthUser;
11 12
use SL::DB::AuthUserGroup;
12 13

  
13
# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
14
__PACKAGE__->meta->make_manager_class;
15

  
16 14
__PACKAGE__->meta->schema('auth');
17 15

  
18 16
__PACKAGE__->meta->add_relationship(
......
44 42
  return $cfg ? $cfg->cfg_value : undef;
45 43
}
46 44

  
45
sub config_values {
46
  my $self = shift;
47

  
48
  if (0 != scalar(@_)) {
49
    my %settings = (ref($_[0]) || '') eq 'HASH' ? %{ $_[0] } : @_;
50
    $self->configs([ map { SL::DB::AuthUserConfig->new(cfg_key => $_, cfg_value => $settings{$_}) } keys %settings ]);
51
  }
52

  
53
  return { map { ($_->cfg_key => $_->cfg_value) } @{ $self->configs } };
54
}
55

  
47 56
1;
SL/DB/Manager/AuthClient.pm
1
package SL::DB::Manager::AuthClient;
2

  
3
use strict;
4

  
5
use SL::DB::Helper::Manager;
6
use base qw(SL::DB::Helper::Manager);
7

  
8
use SL::DB::Helper::Paginated;
9
use SL::DB::Helper::Sorted;
10

  
11
sub object_class { 'SL::DB::AuthClient' }
12

  
13
__PACKAGE__->make_manager_methods;
14

  
15
sub _sort_spec {
16
  return ( default => [ 'name', 1 ],
17
           columns => { SIMPLE => 'ALL' } );
18
}
19

  
20
1;
SL/DB/Manager/AuthGroup.pm
1
package SL::DB::Manager::AuthGroup;
2

  
3
use strict;
4

  
5
use SL::DB::Helper::Manager;
6
use base qw(SL::DB::Helper::Manager);
7

  
8
use SL::DB::Helper::Paginated;
9
use SL::DB::Helper::Sorted;
10

  
11
sub object_class { 'SL::DB::AuthGroup' }
12

  
13
__PACKAGE__->make_manager_methods;
14

  
15
sub _sort_spec {
16
  return ( default => [ 'name', 1 ],
17
           columns => { SIMPLE => 'ALL' } );
18
}
19

  
20
1;
SL/DB/Manager/AuthUser.pm
1
package SL::DB::Manager::AuthUser;
2

  
3
use strict;
4

  
5
use SL::DB::Helper::Manager;
6
use base qw(SL::DB::Helper::Manager);
7

  
8
use SL::DB::Helper::Paginated;
9
use SL::DB::Helper::Sorted;
10

  
11
sub object_class { 'SL::DB::AuthUser' }
12

  
13
__PACKAGE__->make_manager_methods;
14

  
15
sub _sort_spec {
16
  return ( default => [ 'login', 1 ],
17
           columns => { SIMPLE => 'ALL' } );
18
}
19

  
20
1;
SL/DBConnect.pm
7 7
sub connect {
8 8
  shift;
9 9

  
10
  # print STDERR "Starting full caller dump:\n";
11
  # my $level = 0;
12
  # while (my ($dummy, $filename, $line, $subroutine) = caller $level) {
13
  #   print STDERR "  ${subroutine} from ${filename}:${line}\n";
14
  #   $level++;
15
  # }
16

  
10 17
  return DBI->connect(@_) unless $::lx_office_conf{debug} && $::lx_office_conf{debug}->{dbix_log4perl};
11 18

  
12 19
  require Log::Log4perl;
SL/Dispatcher.pm
59 59
  return $self->{interface} eq 'cgi' ? 'CGI' : 'FastCGI';
60 60
}
61 61

  
62
sub is_admin_request {
63
  my %params = @_;
64
  return ($params{script} eq 'admin.pl') || (($params{routing_type} eq 'controller') && ($params{script_name} eq 'Admin'));
65
}
66

  
62 67
sub pre_request_checks {
68
  my (%params) = @_;
69

  
63 70
  _check_for_old_config_files();
64 71

  
65
  if (!$::auth->session_tables_present) {
66
    if ($::form->{script} eq 'admin.pl') {
67
      ::run();
68
      ::end_of_request();
69
    } else {
70
      show_error('login_screen/auth_db_unreachable');
71
    }
72
  if (!$::auth->session_tables_present && !is_admin_request(%params)) {
73
    show_error('login_screen/auth_db_unreachable');
72 74
  }
73 75

  
74 76
  if ($::request->type !~ m/^ (?: html | js | json ) $/x) {
......
231 233
  }
232 234

  
233 235
  eval {
234
    pre_request_checks();
236
    pre_request_checks(script => $script, action => $action, routing_type => $routing_type, script_name => $script_name);
235 237

  
236
    $::form->error($::locale->text('System currently down for maintenance!')) if -e ($::lx_office_conf{paths}->{userspath} . "/nologin") && $script ne 'admin';
238
    if (   (-e ($::lx_office_conf{paths}->{userspath} . "/nologin"))
239
        && !is_admin_request(script => $script, script_name => $script_name, routing_type => $routing_type)) {
240
      $::form->error($::locale->text('System currently down for maintenance!'));
241
    }
237 242

  
238 243
    # For compatibility with a lot of database upgrade scripts etc:
239 244
    # Re-write request to old 'login.pl?action=login' to new
......
246 251
    if (($script eq 'login') && !$action) {
247 252
      print $::request->{cgi}->redirect('controller.pl?action=LoginScreen/user_login');
248 253

  
249
    } elsif ($script eq 'admin') {
250
      $::form->{titlebar} = "kivitendo " . $::locale->text('Version') . " $::form->{version}";
251
      ::run($session_result);
252

  
253 254
    } else {
254
      if (SL::Auth::SESSION_EXPIRED == $session_result) {
255
        print $::request->{cgi}->redirect('controller.pl?action=LoginScreen/user_login&error=session');
256
        ::end_of_request();
257
      }
255
      $self->redirect_to_login($script) if SL::Auth::SESSION_EXPIRED == $session_result;
258 256

  
259 257
      my %auth_result = $self->{auth_handler}->handle(
260 258
        routing_type => $routing_type,
......
320 318
  $::lxdebug->leave_sub;
321 319
}
322 320

  
321
sub redirect_to_login {
322
  my ($self, $script) = @_;
323
  my $action          = $script =~ m/^admin/i ? 'Admin/login' : 'LoginScreen/user_login&error=session';
324
  print $::request->cgi->redirect("controller.pl?action=${action}");
325
  ::end_of_request();
326
}
327

  
323 328
sub unrequire_bin_mozilla {
324 329
  my $self = shift;
325 330
  return unless $self->_interface_is_fcgi;
SL/Dispatcher/AuthHandler.pm
1
  package SL::Dispatcher::AuthHandler;
1
package SL::Dispatcher::AuthHandler;
2 2

  
3 3
use strict;
4 4

  
......
18 18
  my $handler_name                     = "SL::Dispatcher::AuthHandler::" . ucfirst($auth_level);
19 19
  $self->{handlers}                  ||= {};
20 20
  $self->{handlers}->{$handler_name} ||= $handler_name->new;
21
  my $ok = $self->{handlers}->{$handler_name}->handle;
21
  my $ok = $self->{handlers}->{$handler_name}->handle(%param);
22 22

  
23 23
  return (
24 24
    auth_level     => $auth_level,
......
40 40
sub get_keep_auth_vars {
41 41
  my ($self, %param) = @_;
42 42

  
43
  return $param{routing_type} eq 'controller' ? "SL::Controller::$param{controller}"->keep_auth_vars_in_form : 0;
43
  return $param{routing_type} eq 'controller' ? "SL::Controller::$param{controller}"->keep_auth_vars_in_form(action => $param{action}) : 0;
44 44
}
45 45

  
46 46
1;
SL/Dispatcher/AuthHandler/Admin.pm
6 6
use SL::Layout::Dispatcher;
7 7

  
8 8
sub handle {
9
  my ($self, %params) = @_;
10

  
9 11
  %::myconfig = ();
10 12

  
11 13
  return 1 if  $::auth->get_api_token_cookie;
12 14
  return 1 if  $::form->{'{AUTH}admin_password'} && ($::auth->authenticate_root($::form->{'{AUTH}admin_password'})            == $::auth->OK());
13 15
  return 1 if !$::form->{'{AUTH}admin_password'} && ($::auth->authenticate_root($::auth->get_session_value('admin_password')) == $::auth->OK());
16
  return 1 if $params{action} eq 'login';
14 17

  
15 18
  $::request->{layout} = SL::Layout::Dispatcher->new(style => 'admin');
16 19

  
bin/mozilla/admin.pl
47 47

  
48 48
use SL::Auth;
49 49
use SL::Auth::PasswordPolicy;
50
use SL::DB::AuthClient;
51
use SL::DB::AuthUser;
50 52
use SL::Form;
51 53
use SL::Iconv;
52 54
use SL::Mailer;
......
105 107
    } else {
106 108
      if ($auth->session_tables_present()) {
107 109
        delete $::form->{'{AUTH}admin_password'};
108
        _apply_dbupgrade_scripts();
109 110
      }
110 111

  
111 112
      call_sub($locale->findsub($form->{action}));
......
130 131
  print $form->parse_html_template('admin/adminlogin');
131 132
}
132 133

  
133
sub login {
134
  check_auth_db_and_tables();
135
  list_users();
136
}
137

  
138
sub logout {
139
  $main::auth->destroy_session();
140
  adminlogin();
141
}
142

  
143
sub check_auth_db_and_tables {
144
  my $form   = $main::form;
145
  my $locale = $main::locale;
146

  
147
  my %params;
148

  
149
  map { $params{"db_${_}"} = $main::auth->{DB_config}->{$_} } keys %{ $auth->{DB_config} };
150

  
151
  $params{admin_password} = $::lx_office_conf{authentication}->{admin_password};
152

  
153
  if (!$main::auth->check_database()) {
154
    $form->{title} = $locale->text('Authentification database creation');
155
    $form->header();
156
    print $form->parse_html_template('admin/check_auth_database', \%params);
157

  
158
    ::end_of_request();
159
  }
160

  
161
  if (!$main::auth->check_tables()) {
162
    $form->{title} = $locale->text('Authentification tables creation');
163
    $form->header();
164
    print $form->parse_html_template('admin/check_auth_tables', \%params);
165

  
166
    ::end_of_request();
167
  }
168
}
169

  
170
sub create_auth_db {
171
  my $form = $main::form;
172

  
173
  $main::auth->create_database('superuser'          => $form->{db_superuser},
174
                               'superuser_password' => $form->{db_superuser_password},
175
                               'template'           => $form->{db_template});
176
  login();
177
}
178

  
179
sub create_auth_tables {
180
  my $form   = $main::form;
181
  my $locale = $main::locale;
182

  
183
  $main::auth->create_tables();
184
  $main::auth->set_session_value('admin_password', $form->{'{AUTH}admin_password'});
185
  $main::auth->create_or_refresh_session();
186

  
187
  my $memberfile = $::lx_office_conf{paths}->{memberfile};
188
  if (!-f $memberfile) {
189
    # New installation -- create a standard group with full access
190
    my %members;
191
    my $group = {
192
      'name'        => $locale->text('Full Access'),
193
      'description' => $locale->text('Full access to all functions'),
194
      'rights'      => { map { $_ => 1 } SL::Auth::all_rights() },
195
      'members'     => [ map { $_->{id} } values %members ],
196
    };
197

  
198
    $main::auth->save_group($group);
199
  }
200

  
201
  _apply_dbupgrade_scripts();
202
  login();
203
}
204

  
205
sub list_users {
206
  my $form    = $main::form;
207
  my $locale  = $main::locale;
208

  
209
  my %members = $main::auth->read_all_users();
210

  
211
  delete $members{"root login"};
212

  
213
  for (values %members) {
214
    $_->{templates} =~ s|.*/||;
215
    $_->{login_url} =  $::locale->is_utf8 ? Encode::encode('utf-8-strict', $_->{login}) : $_->{login_url};
216
  }
217

  
218
  $form->{title}   = "kivitendo " . $locale->text('Administration');
219
  $form->{LOCKED}  = -e _nologin_file_name();
220
  $form->{MEMBERS} = [ @members{sort { lc $a cmp lc $b } keys %members} ];
221

  
222
  $form->header();
223
  print $form->parse_html_template("admin/list_users");
224
}
225

  
226 134
sub add_user {
227 135
  $::form->{title}   = "kivitendo " . $::locale->text('Administration') . " / " . $::locale->text('Add User');
228 136

  
......
249 157
  # get user
250 158
  my $user = User->new(id => $::form->{user}{id});
251 159

  
252
  # strip basedir from templates directory
253
  $user->{templates} =~ s|.*/||;
254

  
255 160
  edit_user_form($user);
256 161
}
257 162

  
......
923 828
  rmdir $tmpdir;
924 829
}
925 830

  
926
sub unlock_system {
927
  my $form   = $main::form;
928
  my $locale = $main::locale;
929

  
930
  unlink _nologin_file_name();;
931

  
932
  $form->{callback} = "admin.pl?action=list_users";
933

  
934
  $form->redirect($locale->text('Lockfile removed!'));
935

  
936
}
937

  
938
sub lock_system {
939
  my $form   = $main::form;
940
  my $locale = $main::locale;
941

  
942
  open(FH, ">", _nologin_file_name())
943
    or $form->error($locale->text('Cannot create Lock!'));
944
  close(FH);
945

  
946
  $form->{callback} = "admin.pl?action=list_users";
947

  
948
  $form->redirect($locale->text('Lockfile created!'));
949

  
950
}
951

  
952 831
sub yes {
953 832
  call_sub($main::form->{yes_nextsub});
954 833
}
......
1006 885
  $form->error($locale->text('No action defined.'));
1007 886
}
1008 887

  
1009
sub _apply_dbupgrade_scripts {
1010
  ::end_of_request() if SL::DBUpgrade2->new(form => $::form, dbdriver => 'Pg', auth => 1)->apply_admin_dbupgrade_scripts(1);
1011
}
1012

  
1013
sub _nologin_file_name {
1014
  return $::lx_office_conf{paths}->{userspath} . '/nologin';
1015
}
1016

  
1017 888
sub _search_templates {
1018 889
  my %templates = SL::Template->available_templates;
1019 890

  
css/kivitendo/main.css
370 370
  color: #ccc;
371 371
  font-style: italic;
372 372
}
373

  
374
.link_separator {
375
  margin-left: 6px;
376
  margin-right: 6px;
377
}
css/lx-office-erp/main.css
423 423
  color: #aaa;
424 424
  font-style: italic;
425 425
}
426

  
427
.link_separator {
428
  margin-left: 6px;
429
  margin-right: 6px;
430
}
locale/de/all
127 127
  'Add Accounts Receivables Transaction' => 'Debitorenbuchung erfassen',
128 128
  'Add Assembly'                => 'Erzeugnis erfassen',
129 129
  'Add Buchungsgruppe'          => 'Buchungsgruppe erfassen',
130
  'Add Client'                  => 'Neuer Mandant',
130 131
  'Add Credit Note'             => 'Gutschrift erfassen',
131 132
  'Add Customer'                => 'Kunde erfassen',
132 133
  'Add Delivery Note'           => 'Lieferschein erfassen',
......
439 440
  'Client #1'                   => 'Mandant #1',
440 441
  'Client Configuration'        => 'Mandantenkonfiguration',
441 442
  'Client Configuration saved!' => 'Mandantenkonfiguration gespeichert!',
443
  'Client list'                 => 'Mandantenliste',
442 444
  'Client name'                 => 'Mandantenname',
443 445
  'Close'                       => 'Übernehmen',
444 446
  'Close Books up to'           => 'Die Bücher abschließen bis zum',
......
1031 1033
  'If you have not chosen for example the category revenue for a tax and you choose an revenue account to create a transfer in the general ledger, this tax will not be displayed in the tax dropdown.' => 'Wenn Sie z.B. die Kategory Erlös für eine Steuer nicht gewählt haben und ein Erlöskonto beim Erstellen einer Dialogbuchung wählen, wird diese Steuer auch nicht im Dropdown-Menü für die Steuern angezeigt.',
1032 1034
  'If you see this message, you most likely just setup your LX-Office and haven\'t added any entry types. If this is the case, the option is accessible for administrators in the System menu.' => 'Wenn Sie diese Meldung sehen haben Sie wahrscheinlich ein frisches LX-Office Setup und noch keine Buchungsgruppen eingerichtet. Ein Administrator kann dies im Systemmen&uuml; erledigen.',
1033 1035
  'If you select a base unit then you also have to enter a factor.' => 'Wenn Sie eine Basiseinheit auswählen, dann müssen Sie auch einen Faktor eingeben.',
1034
  'If you want to change any of these parameters then press the &quot;Back&quot; button, edit the file &quot;config/kivitendo.conf&quot; and login into the admin module again.' => 'Wenn Sie einen der Parameter &auml;ndern wollen, so dr&uuml;cken Sie auf den &quot;Zur&uuml;ck&quot;-Button, bearbeiten Sie die Datei &quot;config/kivitendo.conf&quot;, und melden Sie sich erneut im Administrationsbereich an.',
1036
  'If you want to change any of these parameters then press the "Back" button, edit the file "config/kivitendo.conf" and login into the admin module again.' => 'Wenn Sie einen der Parameter ändern wollen, so drücken Sie auf den "Zurück"-Button, bearbeiten Sie die Datei "config/kivitendo.conf", und melden Sie sich erneut im Administrationsbereich an.',
1035 1037
  'If you want to delete such a dataset you have to edit the user(s) that are using the dataset in question and have them use another dataset.' => 'Wenn Sie eine solche Datenbank l&ouml;schen wollen, so m&uuml;ssen Sie zuerst die Benutzer bearbeiten, die die fragliche Datenbank benutzen, und sie so &auml;ndern, dass sie eine andere Datenbank benutzen.',
1036 1038
  'If you want to set up the authentication database yourself then log in to the administration panel. kivitendo will then create the database and tables for you.' => 'Wenn Sie die Authentifizierungs-Datenbank selber einrichten wollen, so melden Sie sich im Administrationsbereich an. kivitendo wird dann die Datenbank und die erforderlichen Tabellen für Sie anlegen.',
1037 1039
  'If your old bins match exactly Bins in the Warehouse CLICK on <b>AUTOMATICALLY MATCH BINS</b>.' => 'Falls die alte Lagerplatz-Beschreibung in Stammdaten genau mit einem Lagerplatz in einem vorhandenem Lager übereinstimmt, KLICK auf <b>LAGERPLÄTZE AUTOMATISCH ZUWEISEN</b>',
......
1047 1049
  'Import result'               => 'Import-Ergebnis',
1048 1050
  'Import summary'              => 'Import-Zusammenfassung',
1049 1051
  'In order to do that hit the button "Delete transaction".' => 'Drücken Sie dafür auf den Button "Buchung löschen".',
1052
  'In order to use kivitendo you have to create at least one client, one user, and grant that user access to the client.' => 'Um kivitendo zu nutzen, müssen Sie mindestens einen Mandanten und einen Benutzer anlegen sowie dem Benutzer den Zugriff auf diesen Mandanten gewähren.',
1050 1053
  'In the latter case the tables needed by kivitendo will be created in that database.' => 'In letzterem Fall werden die von kivitendo benötigten Tabellen in dieser existierenden Datenbank angelegt.',
1051 1054
  'In version 2.4.0 the administrator has to enter a list of units in the administrative section.' => 'Vor Version 2.4.0 musste der Benutzer die Konten bei jeder Ware und jeder Dienstleistung einzeln ausw&auml;hlen.',
1052 1055
  'In-line'                     => 'im Text',
......
1155 1158
  'Language saved!'             => 'Sprache gespeichert!',
1156 1159
  'Languages'                   => 'Sprachen',
1157 1160
  'Languages and translations'  => 'Sprachen und Übersetzungen',
1158
  'Last Action'                 => 'Letzte Aktivität',
1159 1161
  'Last Article Number'         => 'Letzte Artikelnummer',
1160 1162
  'Last Assembly Number'        => 'Letzte Erzeugnisnummer',
1161 1163
  'Last Cost'                   => 'Einkaufspreis',
......
1320 1322
  'No bank information has been entered in this vendor\'s master data entry. You cannot create bank transfers unless you enter bank information.' => 'Für diesen Lieferanten wurden in seinen Stammdaten keine Kontodaten hinterlegt. Solange dies nicht geschehen ist, können Sie keine Überweisungen für den Lieferanten anlegen.',
1321 1323
  'No bins have been added to this warehouse yet.' => 'Es wurden zu diesem Lager noch keine Lagerpl&auml;tze angelegt.',
1322 1324
  'No business has been created yet.' => 'Es wurden noch kein Kunden-/Lieferantentyp erfasst.',
1325
  'No clients have been created yet.' => 'Es wurden noch keine Mandanten angelegt.',
1323 1326
  'No contact selected to delete' => 'Keine Ansprechperson zum Löschen ausgewählt',
1324 1327
  'No customer has been selected yet.' => 'Es wurde noch kein Kunde ausgewählt.',
1325 1328
  'No data was found.'          => 'Es wurden keine Daten gefunden.',
......
1343 1346
  'No transaction selected!'    => 'Keine Transaktion ausgewählt',
1344 1347
  'No transfers were executed in this export.' => 'In diesem SEPA-Export wurden keine Überweisungen ausgeführt.',
1345 1348
  'No unknown units where found.' => 'Es wurden keine unbekannten Einheiten gefunden.',
1349
  'No users have been created yet.' => 'Es wurden noch keine Benutzer angelegt.',
1346 1350
  'No valid number entered for pricegroup "#1".' => 'Für Preisgruppe "#1" wurde keine gültige Nummer eingegeben.',
1347 1351
  'No vendor has been selected yet.' => 'Es wurde noch kein Lieferant ausgewählt.',
1348 1352
  'No warehouse has been created yet or the quantity of the bins is not configured yet.' => 'Es wurde noch kein Lager angelegt, bzw. die dazugehörigen Lagerplätze sind noch nicht konfiguriert.',
......
2320 2324
  'User Config'                 => 'Einstellungen',
2321 2325
  'User Login'                  => 'Als Benutzer anmelden',
2322 2326
  'User access'                 => 'Benutzerzugriff',
2323
  'User data migration'         => 'Benutzerdatenmigration',
2324 2327
  'User deleted!'               => 'Benutzer gelöscht!',
2328
  'User list'                   => 'Benutzerliste',
2325 2329
  'User login'                  => 'Benutzeranmeldung',
2326 2330
  'User name'                   => 'Benutzername',
2327 2331
  'User saved!'                 => 'Benutzer gespeichert!',
......
2535 2539
  'invoice_list'                => 'debitorenbuchungsliste',
2536 2540
  'kivitendo'                   => 'kivitendo',
2537 2541
  'kivitendo Homepage'          => 'Infos zu kivitendo',
2538
  'kivitendo administration'    => 'kivitendo Administration',
2539 2542
  'kivitendo can fix these problems automatically.' => 'kivitendo kann solche Probleme automatisch beheben.',
2540 2543
  'kivitendo has been extended to handle multiple clients within a single installation.' => 'kivitendo wurde um Mandantenfähigkeit erweitert.',
2541
  'kivitendo has been switched to group-based access restrictions.' => 'kivitendo wurde auf eine gruppenbasierte Benutzerzugriffsverwaltung umgestellt.',
2542 2544
  'kivitendo has found one or more problems in the general ledger.' => 'kivitendo hat ein oder mehrere Probleme im Hauptbuch gefunden.',
2543 2545
  'kivitendo is about to update the database [ #1 ].' => 'kivitendo wird gleich die Datenbank [ #1 ] aktualisieren.',
2544 2546
  'kivitendo is now able to manage warehouses instead of just tracking the amount of goods in your system.' => 'kivitendo enth&auml;lt jetzt auch echte Lagerverwaultung anstatt reiner Mengenz&auml;hlung.',
2545 2547
  'kivitendo needs to update the authentication database before you can proceed.' => 'kivitendo muss die Authentifizierungsdatenbank aktualisieren, bevor Sie fortfahren können.',
2548
  'kivitendo v#1 administration' => 'kivitendo v#1 Administration',
2546 2549
  'kivitendo website (external)' => 'kivitendo-Webseite (extern)',
2547 2550
  'kivitendo will then update the database automatically.' => 'kivitendo wird die Datenbank daraufhin automatisch aktualisieren.',
2548 2551
  'lead deleted!'               => 'Kundenquelle gelöscht',
......
2567 2570
  'not configured'              => 'nicht konfiguriert',
2568 2571
  'not delivered'               => 'nicht geliefert',
2569 2572
  'not executed'                => 'nicht ausgeführt',
2570
  'not logged in'               => 'nicht eingeloggt',
2571 2573
  'not running'                 => 'läuft nicht',
2572 2574
  'not set'                     => 'nicht gesetzt',
2573 2575
  'not shipped'                 => 'nicht geliefert',
templates/webpages/admin/adminlogin.html
1 1
[%- USE T8 %]
2 2
[% USE HTML %]
3
[% USE LxERP%]
3
[% USE LxERP %][%- USE L -%]
4 4
 <center>
5 5
  <table class="login" border="3" cellpadding="20">
6 6
   <tr>
7 7
    <td class="login" align="center">
8 8
     <a href="http://www.kivitendo.de" target="_top"><img src="image/kivitendo.png" border="0"></a>
9
     <h1>[% 'kivitendo administration' | $T8 %] [% version %]</h1>
9
     <h1>[% LxERP.t8('kivitendo v#1 administration', FORM.version) %]</h1>
10 10

  
11
     [% IF error %]
12
     <p><span class="message_error_login">[% error %]</span></p>
13
     [% END %]
11
[% IF error %]
12
     <p><span class="message_error_login">[% HTML.escape(error) %]</span></p>
13
[% END %]
14 14

  
15 15
     <p>
16 16

  
17
      <form method="post" action="admin.pl">
17
      <form method="post" action="controller.pl">
18
       [%- L.hidden_tag("action",   'Admin/login') %]
19
       [%- L.hidden_tag("do_login", 1) %]
18 20

  
19 21
       <table width="100%">
20 22
        <tr>
......
22 24
          <table>
23 25
           <tr>
24 26
            <th align="right">[% 'Password' | $T8 %]</th>
25
            <td><input class="login" type="password" name="{AUTH}admin_password" id="admin_password" size="30" tabindex="1"></td>
27
            <td>[%- L.input_tag("{AUTH}admin_password", '', type="password", class="login", id="admin_password", size="30") %]</td>
26 28
           </tr>
27 29
          </table>
28 30

  
29 31
          <br>
30
          <input type="submit" value="[% 'Login' | $T8 %]" tabindex="2">
32

  
33
          [% L.submit_tag('dummy', LxERP.t8('Login')) %]
31 34

  
32 35
         </td>
33 36
        </tr>
34 37
       </table>
35

  
36
       <input type="hidden" name="action" value="login">
37 38
      </form>
38 39

  
39 40
    </td>
......
45 46
   &nbsp;|&nbsp;
46 47
   <a href="doc/kivitendo-Dokumentation.pdf" target="_top">[%- LxERP.t8('Documentation') %]</a>
47 48
  </p>
48

  
49
  <script type='text/javascript'>
50
    $('#admin_password').focus();
51
  </script>
templates/webpages/admin/backup_dataset.html
82 82

  
83 83
   </table>
84 84

  
85
   <input name="callback" type="hidden" value="admin.pl?action=list_users">
85
   <input name="callback" type="hidden" value="controller.pl?action=Admin/list_clients_and_users">
86 86
   <input type="hidden" name="nextsub" value="backup_dataset_start">
87
   <input type="hidden" name="back_nextsub" value="list_users">
88 87

  
89 88
   <hr size="3" noshade>
90 89

  
91 90
   <br>
92 91

  
93 92
   <input type="submit" class="submit" name="action" value="[% 'Continue' | $T8 %]">
94
   <a href="admin.pl?action=pg_database_administration">[% 'Back' | $T8 %]</a>
93
   <a href="controller.pl?action=Admin/list_clients_and_users">[% 'Back' | $T8 %]</a>
95 94

  
96 95
  </form>
97 96

  
templates/webpages/admin/backup_dataset_email_done.html
1 1
[%- USE T8 %]
2 2
[%- USE LxERP %]
3
[%- USE HTML %]
3
[%- USE HTML %][%- USE L -%]
4 4
 <h1>[% title %]</h1>
5 5

  
6 6
 <p>[% LxERP.t8('The dataset backup has been sent via email to #1.', to) | html %]</p>
7 7

  
8
 <form method="post" action="admin.pl">
9
  <input type="hidden" name="nextsub" value="list_users">
10
  <input type="submit" name="action" value="[% 'Continue' | $T8 %]">
11
 </form>
8
 <p>[% L.link("controller.pl?action=Admin/list_clients_and_users", LxERP.t8("Continue")) %]
templates/webpages/admin/check_auth_database.html
1 1
[%- USE T8 %]
2
[%- USE HTML %]
2
[%- USE HTML %][%- USE L -%][%- USE LxERP -%]
3 3

  
4 4
 <h1>[% title %]</h1>
5 5

  
6
 <form method="post" action="admin.pl">
6
 <form method="post" action="controller.pl">
7
  [%- L.hidden_tag("action", 'Admin/create_auth_db') %]
8
  [%- L.hidden_tag("{AUTH}admin_password", LXCONFIG.authentication.admin_password) %]
7 9

  
8 10
  <p>
9 11
   [% 'The database for user management and authentication does not exist. You can create let kivitendo create it with the following parameters:' | $T8 %]
......
12 14
  <table border="0">
13 15
   <tr>
14 16
    <td>[% 'Host' | $T8 %]:</td>
15
    <td>[% HTML.escape(db_host) %]</td>
17
    <td>[% HTML.escape(SELF.db_cfg.host) %]</td>
16 18
   </tr>
17 19
   <tr>
18 20
    <td>[% 'Port' | $T8 %]:</td>
19
    <td>[% HTML.escape(db_port) %]</td>
21
    <td>[% HTML.escape(SELF.db_cfg.port) %]</td>
20 22
   </tr>
21 23
   <tr>
22 24
    <td>[% 'User name' | $T8 %]:</td>
23
    <td>[% HTML.escape(db_user) %]</td>
25
    <td>[% HTML.escape(SELF.db_cfg.user) %]</td>
24 26
   </tr>
25 27
   <tr>
26 28
    <td>[% 'Database name' | $T8 %]:</td>
27
    <td>[% HTML.escape(db_db) %]</td>
29
    <td>[% HTML.escape(SELF.db_cfg.db) %]</td>
28 30
   </tr>
29 31
  </table>
30 32

  
......
38 40
   [% 'If the database user listed above does not have the right to create a database then enter the name and password of the superuser below:' | $T8 %]
39 41
  </p>
40 42

  
41
  <table border="0"
43
  <table border="0">
42 44
   <tr>
43 45
    <td>[% 'Superuser name' | $T8 %]:</td>
44
    <td><input name="db_superuser"></td>
46
    <td>[% L.input_tag('db_superuser', '') %]</td>
45 47
   </tr>
46 48

  
47 49
   <tr>
48 50
    <td>[% 'Password' | $T8 %]:</td>
49
    <td><input type="password" name="db_superuser_password"></td>
51
    <td>[% L.input_tag('db_superuser_password', '', type='password') %]</td>
50 52
   </tr>
51 53
  </table>
52 54

  
53
  <input type="hidden" name="{AUTH}admin_password" value="[% HTML.escape(admin_password) %]">
54
  <input type="hidden" name="action" value="create_auth_db">
55

  
56
  <input type="submit" class="submit" value="[% 'Create Dataset' | $T8 %]">
57
  <input type="button" class="submit" onclick="history.back()" value="[% 'Back' | $T8 %]">
58

  
55
  [% L.submit_tag("dummy", LxERP.t8("Create Dataset")) %]
56
  [% L.button_tag("history.back()", LxERP.t8("Back")) %]
59 57
 </form>
templates/webpages/admin/check_auth_tables.html
1 1
[%- USE T8 %]
2
[%- USE HTML %]
2
[%- USE HTML %][%- USE LxERP -%][%- USE L -%]
3 3

  
4 4
 <h1>[% title %]</h1>
5 5

  
......
10 10
 <table border="0">
11 11
  <tr>
12 12
   <td>[% 'Host' | $T8 %]:</td>
13
   <td>[% HTML.escape(db_host) %]</td>
13
   <td>[% HTML.escape(SELF.db_cfg.host) %]</td>
14 14
  </tr>
15 15
  <tr>
16 16
   <td>[% 'Port' | $T8 %]:</td>
17
   <td>[% HTML.escape(db_port) %]</td>
17
   <td>[% HTML.escape(SELF.db_cfg.port) %]</td>
18 18
  </tr>
19 19
  <tr>
20 20
   <td>[% 'User name' | $T8 %]:</td>
21
   <td>[% HTML.escape(db_user) %]</td>
21
   <td>[% HTML.escape(SELF.db_cfg.user) %]</td>
22 22
  </tr>
23 23
  <tr>
24 24
   <td>[% 'Database name' | $T8 %]:</td>
25
   <td>[% HTML.escape(db_db) %]</td>
25
   <td>[% HTML.escape(SELF.db_cfg.db) %]</td>
26 26
  </tr>
27 27
 </table>
28 28

  
29 29
 <p>
30
  [% 'If you want to change any of these parameters then press the &quot;Back&quot; button, edit the file &quot;config/kivitendo.conf&quot; and login into the admin module again.' | $T8 %]
30
  [% 'If you want to change any of these parameters then press the "Back" button, edit the file "config/kivitendo.conf" and login into the admin module again.' | $T8 %]
31 31
 </p>
32 32

  
33
 <form method="post" action="admin.pl">
34

  
35
  <input type="hidden" name="{AUTH}admin_password" value="[% HTML.escape(admin_password) %]">
36
  <input type="hidden" name="action" value="create_auth_tables">
37

  
38
  <input type="submit" class="submit" value="[% 'Create tables' | $T8 %]">
39
  <input type="button" class="submit" onclick="history.back()" value="[% 'Back' | $T8 %]">
33
 <form method="post" action="controller.pl">
34
  [%- L.hidden_tag("action", 'Admin/create_auth_tables') %]
35
  [%- L.hidden_tag("{AUTH}admin_password", LXCONFIG.authentication.admin_password) %]
40 36

  
37
  [% L.submit_tag("dummy", LxERP.t8("Create tables")) %]
38
  [% L.button_tag("history.back()", LxERP.t8("Back")) %]
41 39
 </form>
templates/webpages/admin/dbadmin.html
3 3
  <h1>[% title %]</h1>
4 4

  
5 5
  <form method="post" action="admin.pl">
6
   <a href="admin.pl?action=list_users">[% 'Back' | $T8 %]</a>
6
   <a href="controller.pl?action=Admin/list_clients_and_users">[% 'Back' | $T8 %]</a>
7 7

  
8 8
   <table>
9 9
    <tr>
......
48 48
       </tr>
49 49
      </table>
50 50

  
51
      <input name="callback" type="hidden" value="admin.pl?action=list_users">
51
      <input name="callback" type="hidden" value="controller.pl?action=Admin/list_clients_and_users">
52 52

  
53 53
      <br>
54 54
      <input type="submit" class="submit" name="action" value="[% 'Create Dataset' | $T8 %]">
templates/webpages/admin/dbcreate.html
1 1
[%- USE T8 %]
2 2
[%- USE HTML %]
3
[%- USE LxERP %]
3
[%- USE LxERP %][%- USE L -%]
4 4
  <h1>[% title %]</h1>
5 5

  
6
  <form method="post" action="admin.pl">
6
  <p>[% LxERP.t8('The dataset #1 has been successfully created.', db) | html %]</p>
7 7

  
8
   <p>[% LxERP.t8('The dataset #1 has been successfully created.', db) | html %]</p>
9

  
10
   <input type="hidden" name="nextsub" value="list_users">
11

  
12
   <p><input type="submit" class="submit" name="action" value="[% 'Continue' | $T8 %]"></p>
13

  
14
  </form>
8
  <p>[% L.link("controller.pl?action=Admin/list_clients_and_users", LxERP.t8("Continue")) %]</p>
templates/webpages/admin/dbdelete.html
1 1
[%- USE T8 %]
2 2
[%- USE LxERP %]
3
[%- USE HTML %]
3
[%- USE HTML %][%- USE L -%]
4 4
  <h1>[% title %]</h1>
5 5

  
6
  <form method="post" action="admin.pl">
6
  <p>[% LxERP.t8('The database #1 has been successfully deleted.', db) | html %]</p>
7 7

  
8
   <p>[% LxERP.t8('The database #1 has been successfully deleted.', db) | html %]</p>
9

  
10
   <input type="hidden" name="nextsub" value="list_users">
11

  
12
   <p><input type="submit" class="submit" name="action" value="[% 'Continue' | $T8 %]"></p>
13
  </form>
8
  <p>[% L.link("controller.pl?action=Admin/list_clients_and_users", LxERP.t8("Continue")) %]</p>
templates/webpages/admin/dbupgrade_all_done.html
1 1
[%- USE T8 %]
2
[% USE HTML%]
2
[% USE HTML%][%- USE LxERP -%][%- USE L -%]
3 3
[% IF NOTHING_TO_DO %]
4 4
 <p>[% 'No datasets have been selected.' | $T8 %]</p>
5 5

  
......
10 10
 <p>[% 'All database upgrades have been applied.' | $T8 %]</p>
11 11
[% END %]
12 12

  
13
<form method="post" action="admin.pl">
14
 <input type="hidden" name="nextsub" value="list_users">
15

  
16
 <input type="submit" name="action" value="[% 'Continue' | $T8 %]">
17
</form>
18

  
13
<p>[% L.link("controller.pl?action=Admin/list_clients_and_users", LxERP.t8("Continue")) %]</p>
templates/webpages/admin/delete_dataset.html
18 18
  <input type="hidden" name="dbpasswd"  value="[% HTML.escape(dbpasswd) %]">
19 19
  <input type="hidden" name="dbdefault" value="[% HTML.escape(dbdefault) %]">
20 20

  
21
  <input name="callback" type="hidden" value="admin.pl?action=list_users">
21
  <input name="callback" type="hidden" value="controller.pl?action=Admin/list_clients_and_users">
22 22

  
23 23

  
24 24
  <input type="hidden" name="nextsub" value="dbdelete">
templates/webpages/admin/list_users.html
1 1
[%- USE T8 %]
2
[%- USE HTML %]
2
[%- USE HTML %][%- USE LxERP -%][%- USE L -%]
3 3
 <h1>[% title %]</h1>
4 4

  
5 5
 <form method="post" action="admin.pl">
6 6

  
7
  <p>
8
   <table width="100%">
9
    <tr>
10
     <th class="listtop">[% 'Login Name' | $T8 %]</th>
11
     <th class="listtop">[% 'Name' | $T8 %]</th>
12
     <th class="listtop">[% 'Company' | $T8 %]</th>
13
     <th class="listtop">[% 'Templates' | $T8 %]</th>
14
     <th class="listtop">[% 'Print' | $T8 %]</th>
15
     <th class="listtop">[% 'Language' | $T8 %]</th>
16
     <th class="listtop">[% 'Dataset' | $T8 %]</th>
17
     <th class="listtop">[% 'Host' | $T8 %]</th>
18
     <th class="listtop">[% 'Last Action' | $T8 %]</th>
19
<!-- <th class="listtop">[% 'Driver' | $T8 %]</th> -->
20
    </tr>
7
  <div class="tabwidget">
8
   <ul>
9
    <li><a href="#client_list">[%- LxERP.t8("Client list") %]</a></li>
10
    <li><a href="#user_list">[%- LxERP.t8("User list") %]</a></li>
11
   </ul>
21 12

  
22
    [% FOREACH row = MEMBERS %]
23
     <tr class="listrow[% loop.count % 2 %]">
24
      <td>&nbsp;<a href="admin.pl?action=edit&user.id=[% HTML.url(row.id) %]">[% HTML.escape(row.login) %]</a></td>
25
      <td>&nbsp;[% HTML.escape(row.name) %]</td>
26
      <td>&nbsp;[% HTML.escape(row.company) %]</td>
27
      <td>&nbsp;[% HTML.escape(row.templates) %]</td>
28
      <td>&nbsp;[% HTML.escape(row.template_format) %]</td>
29
      <td>&nbsp;[% HTML.escape(row.countrycode) %]</td>
30
      <td>&nbsp;[% HTML.escape(row.dbname) %]</td>
31
      <td>&nbsp;[% IF row.dbhost %][% HTML.escape(row.dbhost) %][% ELSE %]localhost[% END %]</td>
32
      <td>&nbsp;
33
        [% IF( row.last_action ) %]
34
          [% HTML.escape(row.last_action) %]
35
        [% ELSE %]
36
          [% 'not logged in' | $T8 %]
37
        [% END %]</td>
38
<!--  <td>&nbsp;[% HTML.escape(row.dbdriver) %]</td> -->
13
   <div id="client_list">
14
[%- IF !CLIENTS.size %]
15
    <p>
16
     [% LxERP.t8("No clients have been created yet.") %]
17
     [% LxERP.t8("In order to use kivitendo you have to create at least one client, one user, and grant that user access to the client.") %]
18
    </p>
19

  
20
[%- ELSE %]
21
    <table width="100%">
22
     <tr>
23
      <th class="listtop">[% 'Client name' | $T8 %]</th>
24
      <th class="listtop">[% 'Database ID' | $T8 %]</th>
25
      <th class="listtop">[% 'Database name' | $T8 %]</th>
26
      <th class="listtop">[% 'Database Host' | $T8 %]</th>
27
      <th class="listtop">[% 'Database User' | $T8 %]</th>
28
     </tr>
29

  
30
 [%- FOREACH client = CLIENTS %]
31
     <tr class="listrow">
32
      <td><a href="admin.pl?action=edit_client&client.id=[% HTML.url(client.id) %]">[% HTML.escape(client.name) %]</a></td>
33
      <td>[% HTML.escape(client.id) %]</td>
34
      <td>[% HTML.escape(client.dbname) %]</td>
35
      <td>[% HTML.escape(client.dbhost) %][% IF client.dbport %]:[%- HTML.escape(client.dbport) %][%- END %]</td>
36
      <td>[% HTML.escape(client.dbuser) %]</td>
39 37
     </tr>
40
    [% END %]
38
 [%- END %]
39
    </table>
40
[%- END %]
41
   </div>
41 42

  
42
   </table>
43
  <hr size="3" noshade>
44
  </p>
43
   <div id="user_list">
44
[%- IF !USERS.size %]
45
    <p>
46
     [% LxERP.t8("No users have been created yet.") %]
47
     [% LxERP.t8("In order to use kivitendo you have to create at least one client, one user, and grant that user access to the client.") %]
48
    </p>
45 49

  
50
[%- ELSE %]
51
    <table width="100%">
52
     <tr>
53
      <th class="listtop">[% 'Login Name' | $T8 %]</th>
54
      <th class="listtop">[% 'Name' | $T8 %]</th>
55
      <th class="listtop">[% 'Language' | $T8 %]</th>
56
     </tr>
57

  
58
 [% FOREACH user = USERS %]
59
  [%- SET config = user.config_values %]
60
     <tr class="listrow">
61
      <td><a href="admin.pl?action=edit&user.id=[% HTML.url(user.id) %]">[% HTML.escape(user.login) %]</a></td>
62
      <td>[% HTML.escape(config.name) %]</td>
63
      <td>[% HTML.escape(config.countrycode) %]</td>
64
     </tr>
65
 [% END %]
66
    </table>
67
[%- END %]
68
   </div>
69
  </div>
46 70

  
47
  <input type="submit" class="submit" name="action" value="[% 'Add User' | $T8 %]">
48
  <input type="submit" class="submit" name="action" value="[% 'Edit groups' | $T8 %]">
49
  <input type="submit" class="submit" name="action" value="[% 'Pg Database Administration' | $T8 %]">
50
  <input type="submit" class="submit" name="action" value="[% 'Printer Management' | $T8 %]">
71
  [% L.link(SELF.url_for(action="add_client"), LxERP.t8("Add Client")) %]
72
  <span class="link_separator">|</span>
73
  [% L.link(SELF.url_for(action="add_user"), LxERP.t8("Add User")) %]
74
  <span class="link_separator">|</span>
75
  [% L.link(SELF.url_for(action="edit_groups"), LxERP.t8("Edit groups")) %]
76
  <span class="link_separator">|</span>
77
  [% L.link(SELF.url_for(action="pg_database_administration", controller="admin.pl"), LxERP.t8("Pg Database Administration")) %]
78
  <span class="link_separator">|</span>
79
  [% L.link(SELF.url_for(action="printer_management", controller="admin.pl"), LxERP.t8("Printer Management")) %]
80
  <span class="link_separator">|</span>
51 81
  [% IF LOCKED %]
52
   <input type="submit" class="submit" name="action" value="[% 'Unlock System' | $T8 %]">
53
   [% ELSE %]
54
   <input type="submit" class="submit" name="action" value="[% 'Lock System' | $T8 %]">
82
   [% L.link(SELF.url_for(action="unlock_system"), LxERP.t8("Unlock System")) %]
83
  [% ELSE %]
84
   [% L.link(SELF.url_for(action="lock_system"), LxERP.t8("Lock System")) %]
55 85
  [% END %]
56
  <input type="submit" class="submit" name="action" value="[% 'Logout' | $T8 %]">
86
  <span class="link_separator">|</span>
87
  [% L.link(SELF.url_for(action="logout"), LxERP.t8("Logout")) %]
57 88

  
58 89
  <div style="background-color: #FFFFDA; font-size: 12px; padding: 0.5em; max-width: 720px; margin: 1em;">
59 90
  <p>[% 'Click on login name to edit!' | $T8 %]</p>
templates/webpages/admin/restore_dataset_start_footer.html
1 1
[%- USE T8 %]
2 2
[%- USE LxERP %]
3
[% USE HTML %] </pre>
3
[% USE HTML %][%- USE L -%] </pre>
4 4

  
5 5
 <hr>
6 6

  
......
9 9
  [%- LxERP.t8('The program\'s exit code was #1 (&quot;0&quot; usually means that everything went OK).', retval) | html %]
10 10
 </p>
11 11

  
12
 <form method="post" action="admin.pl">
13
  <input type="hidden" name="nextsub" value="list_users">
14
  <input type="submit" name="action" value="[% 'Continue' | $T8 %]">
15
 </form>
12
 <p>
13
  [% L.link("controller.pl?action=Admin/list_clients_and_users", LxERP.t8("Continue")) %]
14
 </p>
templates/webpages/admin/update_dataset.html
39 39

  
40 40
   <input type="hidden" name="rowcount" value="[% NEED_UPDATES.size %]">
41 41

  
42
   <input name="callback" type="hidden" value="admin.pl?action=list_users">
42
   <input name="callback" type="hidden" value="controller.pl?action=Admin/list_clients_and_users">
43 43
   <input type="hidden" name="nextsub" value="dbupdate">
44 44

  
45 45
   <hr size="3" noshade>
templates/webpages/dbupgrade/footer.html
1 1
[%- USE T8 %]
2 2
[% USE HTML %]<p>[% '...done' | $T8 %]</p>
3 3

  
4
<form action="[% IF is_admin %]admin.pl[% ELSE %]login.pl[% END %]">
4
<form action="[% IF is_admin %]controller.pl[% ELSE %]login.pl[% END %]">
5 5

  
6
 <input type="hidden" name="action" value="[% IF is_admin %]login[% ELSE %]company_logo[% END %]">
6
 <input type="hidden" name="action" value="[% IF is_admin %]Admin/login[% ELSE %]company_logo[% END %]">
7 7

  
8 8
 <p><input type="submit" value="[% 'Continue' | $T8 %]"></p>
9 9
</form>
10

  

Auch abrufbar als: Unified diff