X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/a9f30fbdaf8162c9030aa6f042d094ae00e3b7c6..0fce1b519824327b2edd4ad201b224758ccf6fda:/SL/Controller/Admin.pm diff --git a/SL/Controller/Admin.pm b/SL/Controller/Admin.pm index 2fb7de6ef..1c0f25e0c 100644 --- a/SL/Controller/Admin.pm +++ b/SL/Controller/Admin.pm @@ -6,6 +6,7 @@ use parent qw(SL::Controller::Base); use IO::Dir; use List::Util qw(first); +use List::UtilsBy qw(sort_by); use SL::Common (); use SL::DB::AuthUser; @@ -81,6 +82,8 @@ sub action_create_auth_tables { $::auth->set_session_value('admin_password', $::lx_office_conf{authentication}->{admin_password}); $::auth->create_or_refresh_session; + return if $self->apply_dbupgrade_scripts; + my $group = (SL::DB::Manager::AuthGroup->get_all(limit => 1))[0]; if (!$group) { SL::DB::AuthGroup->new( @@ -90,9 +93,7 @@ sub action_create_auth_tables { )->save; } - if (!$self->apply_dbupgrade_scripts) { - $self->action_login; - } + $self->action_login; } # @@ -528,13 +529,13 @@ sub init_all_rights { my (@sections, $current_section); foreach my $entry ($::auth->all_rights_full) { - if ($entry->[0] =~ m/^--/) { - push @sections, { description => $entry->[1], rights => [] }; + if ($entry->[2]) { + push @sections, { description => t8($entry->[1]), rights => [] }; } elsif (@sections) { push @{ $sections[-1]->{rights} }, { name => $entry->[0], - description => $entry->[1], + description => t8($entry->[1]), }; } else { @@ -672,4 +673,12 @@ sub authenticate_root { return undef; } +sub is_user_used_for_task_server { + my ($self, $user) = @_; + + return undef if !$user; + return join ', ', sort_by { lc } map { $_->name } @{ SL::DB::Manager::AuthClient->get_all(where => [ task_server_user_id => $user->id ]) }; +} + + 1;