5 use Digest::MD5 qw(md5_hex);
7 use Time::HiRes qw(gettimeofday);
8 use List::MoreUtils qw(uniq);
10 use SL::Auth::Constants qw(:all);
20 $main::lxdebug->enter_sub();
27 $self->{SESSION} = { };
29 $self->_read_auth_config();
31 $main::lxdebug->leave_sub();
37 my ($self, $login) = @_;
38 my %user = $self->read_user($login);
39 my $dbh = DBI->connect(
44 pg_enable_utf8 => $::locale->is_utf8,
47 ) or $::form->dberror;
49 if ($user{dboptions}) {
50 $dbh->do($user{dboptions}) or $::form->dberror($user{dboptions});
59 $self->{dbh}->disconnect() if ($self->{dbh});
62 # form isn't loaded yet, so auth needs it's own error.
64 $::lxdebug->show_backtrace();
66 my ($self, @msg) = @_;
67 if ($ENV{HTTP_USER_AGENT}) {
68 print Form->create_http_response(content_type => 'text/html');
69 print "<pre>", join ('<br>', @msg), "</pre>";
71 print STDERR "Error: @msg\n";
76 sub _read_auth_config {
77 $main::lxdebug->enter_sub();
82 my $in = IO::File->new('config/authentication.pl', 'r');
85 my $locale = Locale->new('en');
86 $self->mini_error($locale->text('The config file "config/authentication.pl" was not found.'));
97 my $locale = Locale->new('en');
98 $self->mini_error($locale->text('The config file "config/authentication.pl" contained invalid Perl code:'), $@);
101 if ($self->{module} eq 'DB') {
102 $self->{authenticator} = SL::Auth::DB->new($self);
104 } elsif ($self->{module} eq 'LDAP') {
105 $self->{authenticator} = SL::Auth::LDAP->new($self);
108 if (!$self->{authenticator}) {
109 my $locale = Locale->new('en');
110 $self->mini_error($locale->text('No or an unknown authenticantion module specified in "config/authentication.pl".'));
113 my $cfg = $self->{DB_config};
116 my $locale = Locale->new('en');
117 $self->mini_error($locale->text('config/authentication.pl: Key "DB_config" is missing.'));
120 if (!$cfg->{host} || !$cfg->{db} || !$cfg->{user}) {
121 my $locale = Locale->new('en');
122 $self->mini_error($locale->text('config/authentication.pl: Missing parameters in "DB_config". Required parameters are "host", "db" and "user".'));
125 $self->{authenticator}->verify_config();
127 $self->{session_timeout} *= 1;
128 $self->{session_timeout} = 8 * 60 if (!$self->{session_timeout});
130 $main::lxdebug->leave_sub();
133 sub authenticate_root {
134 $main::lxdebug->enter_sub();
137 my $password = shift;
138 my $is_crypted = shift;
140 $password = crypt $password, 'ro' if (!$password || !$is_crypted);
141 my $admin_password = crypt "$self->{admin_password}", 'ro';
143 $main::lxdebug->leave_sub();
145 return OK if $password eq $admin_password;
151 $main::lxdebug->enter_sub();
155 $main::lxdebug->leave_sub();
157 my $result = $self->{authenticator}->authenticate(@_);
158 return OK if $result eq OK;
164 $main::lxdebug->enter_sub(2);
167 my $may_fail = shift;
170 $main::lxdebug->leave_sub(2);
174 my $cfg = $self->{DB_config};
175 my $dsn = 'dbi:Pg:dbname=' . $cfg->{db} . ';host=' . $cfg->{host};
178 $dsn .= ';port=' . $cfg->{port};
181 $main::lxdebug->message(LXDebug->DEBUG1, "Auth::dbconnect DSN: $dsn");
183 $self->{dbh} = DBI->connect($dsn, $cfg->{user}, $cfg->{password}, { pg_enable_utf8 => $::locale->is_utf8, AutoCommit => 0 });
185 if (!$may_fail && !$self->{dbh}) {
186 $main::form->error($main::locale->text('The connection to the authentication database failed:') . "\n" . $DBI::errstr);
189 $main::lxdebug->leave_sub();
195 $main::lxdebug->enter_sub();
200 $self->{dbh}->disconnect();
204 $main::lxdebug->leave_sub();
208 $main::lxdebug->enter_sub();
212 my $dbh = $self->dbconnect();
213 my $query = qq|SELECT COUNT(*) FROM pg_tables WHERE (schemaname = 'auth') AND (tablename = 'user')|;
215 my ($count) = $dbh->selectrow_array($query);
217 $main::lxdebug->leave_sub();
223 $main::lxdebug->enter_sub();
227 my $dbh = $self->dbconnect(1);
229 $main::lxdebug->leave_sub();
234 sub create_database {
235 $main::lxdebug->enter_sub();
240 my $cfg = $self->{DB_config};
242 if (!$params{superuser}) {
243 $params{superuser} = $cfg->{user};
244 $params{superuser_password} = $cfg->{password};
247 $params{template} ||= 'template0';
248 $params{template} =~ s|[^a-zA-Z0-9_\-]||g;
250 my $dsn = 'dbi:Pg:dbname=template1;host=' . $cfg->{host};
253 $dsn .= ';port=' . $cfg->{port};
256 $main::lxdebug->message(LXDebug->DEBUG1(), "Auth::create_database DSN: $dsn");
258 my $charset = $main::dbcharset;
259 $charset ||= Common::DEFAULT_CHARSET;
260 my $encoding = $Common::charset_to_db_encoding{$charset};
261 $encoding ||= 'UNICODE';
263 my $dbh = DBI->connect($dsn, $params{superuser}, $params{superuser_password}, { pg_enable_utf8 => $charset =~ m/^utf-?8$/i });
266 $main::form->error($main::locale->text('The connection to the template database failed:') . "\n" . $DBI::errstr);
269 my $query = qq|CREATE DATABASE "$cfg->{db}" OWNER "$cfg->{user}" TEMPLATE "$params{template}" ENCODING '$encoding'|;
271 $main::lxdebug->message(LXDebug->DEBUG1(), "Auth::create_database query: $query");
276 my $error = $dbh->errstr();
278 $query = qq|SELECT pg_encoding_to_char(encoding) FROM pg_database WHERE datname = 'template0'|;
279 my ($cluster_encoding) = $dbh->selectrow_array($query);
281 if ($cluster_encoding && ($cluster_encoding =~ m/^(?:UTF-?8|UNICODE)$/i) && ($encoding !~ m/^(?:UTF-?8|UNICODE)$/i)) {
282 $error = $main::locale->text('Your PostgreSQL installationen uses UTF-8 as its encoding. Therefore you have to configure Lx-Office to use UTF-8 as well.');
287 $main::form->error($main::locale->text('The creation of the authentication database failed:') . "\n" . $error);
292 $main::lxdebug->leave_sub();
296 $main::lxdebug->enter_sub();
299 my $dbh = $self->dbconnect();
301 my $charset = $main::dbcharset;
302 $charset ||= Common::DEFAULT_CHARSET;
305 User->process_query($main::form, $dbh, 'sql/auth_db.sql', undef, $charset);
307 $main::lxdebug->leave_sub();
311 $main::lxdebug->enter_sub();
317 my $form = $main::form;
319 my $dbh = $self->dbconnect();
321 my ($sth, $query, $user_id);
323 $query = qq|SELECT id FROM auth."user" WHERE login = ?|;
324 ($user_id) = selectrow_query($form, $dbh, $query, $login);
327 $query = qq|SELECT nextval('auth.user_id_seq')|;
328 ($user_id) = selectrow_query($form, $dbh, $query);
330 $query = qq|INSERT INTO auth."user" (id, login) VALUES (?, ?)|;
331 do_query($form, $dbh, $query, $user_id, $login);
334 $query = qq|DELETE FROM auth.user_config WHERE (user_id = ?)|;
335 do_query($form, $dbh, $query, $user_id);
337 $query = qq|INSERT INTO auth.user_config (user_id, cfg_key, cfg_value) VALUES (?, ?, ?)|;
338 $sth = prepare_query($form, $dbh, $query);
340 while (my ($cfg_key, $cfg_value) = each %params) {
341 next if ($cfg_key eq 'password');
343 do_statement($form, $sth, $query, $user_id, $cfg_key, $cfg_value);
348 $main::lxdebug->leave_sub();
351 sub can_change_password {
354 return $self->{authenticator}->can_change_password();
357 sub change_password {
358 $main::lxdebug->enter_sub();
361 my $result = $self->{authenticator}->change_password(@_);
363 $main::lxdebug->leave_sub();
369 $main::lxdebug->enter_sub();
373 my $dbh = $self->dbconnect();
374 my $query = qq|SELECT u.id, u.login, cfg.cfg_key, cfg.cfg_value
375 FROM auth.user_config cfg
376 LEFT JOIN auth."user" u ON (cfg.user_id = u.id)|;
377 my $sth = prepare_execute_query($main::form, $dbh, $query);
381 while (my $ref = $sth->fetchrow_hashref()) {
382 $users{$ref->{login}} ||= { 'login' => $ref->{login}, 'id' => $ref->{id} };
383 $users{$ref->{login}}->{$ref->{cfg_key}} = $ref->{cfg_value} if (($ref->{cfg_key} ne 'login') && ($ref->{cfg_key} ne 'id'));
388 $main::lxdebug->leave_sub();
394 $main::lxdebug->enter_sub();
399 my $dbh = $self->dbconnect();
400 my $query = qq|SELECT u.id, u.login, cfg.cfg_key, cfg.cfg_value
401 FROM auth.user_config cfg
402 LEFT JOIN auth."user" u ON (cfg.user_id = u.id)
403 WHERE (u.login = ?)|;
404 my $sth = prepare_execute_query($main::form, $dbh, $query, $login);
408 while (my $ref = $sth->fetchrow_hashref()) {
409 $user_data{$ref->{cfg_key}} = $ref->{cfg_value};
410 @user_data{qw(id login)} = @{$ref}{qw(id login)};
415 $main::lxdebug->leave_sub();
421 $main::lxdebug->enter_sub();
426 my $dbh = $self->dbconnect();
427 my ($id) = selectrow_query($main::form, $dbh, qq|SELECT id FROM auth."user" WHERE login = ?|, $login);
429 $main::lxdebug->leave_sub();
435 $main::lxdebug->enter_sub();
440 my $form = $main::form;
442 my $dbh = $self->dbconnect();
443 my $query = qq|SELECT id FROM auth."user" WHERE login = ?|;
445 my ($id) = selectrow_query($form, $dbh, $query, $login);
447 return $main::lxdebug->leave_sub() if (!$id);
449 do_query($form, $dbh, qq|DELETE FROM auth.user_group WHERE user_id = ?|, $id);
450 do_query($form, $dbh, qq|DELETE FROM auth.user_config WHERE user_id = ?|, $id);
454 $main::lxdebug->leave_sub();
457 # --------------------------------------
461 sub restore_session {
462 $main::lxdebug->enter_sub();
466 my $cgi = $main::cgi;
467 $cgi ||= CGI->new('');
469 $session_id = $cgi->cookie($self->get_session_cookie_name());
470 $session_id =~ s|[^0-9a-f]||g;
472 $self->{SESSION} = { };
475 $main::lxdebug->leave_sub();
479 my ($dbh, $query, $sth, $cookie, $ref, $form);
483 $dbh = $self->dbconnect();
484 $query = qq|SELECT *, (mtime < (now() - '$self->{session_timeout}m'::interval)) AS is_expired FROM auth.session WHERE id = ?|;
486 $cookie = selectfirst_hashref_query($form, $dbh, $query, $session_id);
488 if (!$cookie || $cookie->{is_expired} || ($cookie->{ip_address} ne $ENV{REMOTE_ADDR})) {
489 $self->destroy_session();
490 $main::lxdebug->leave_sub();
491 return SESSION_EXPIRED;
494 $query = qq|SELECT sess_key, sess_value FROM auth.session_content WHERE session_id = ?|;
495 $sth = prepare_execute_query($form, $dbh, $query, $session_id);
497 while (my $ref = $sth->fetchrow_hashref()) {
498 $self->{SESSION}->{$ref->{sess_key}} = $ref->{sess_value};
499 $form->{$ref->{sess_key}} = $ref->{sess_value} if (!defined $form->{$ref->{sess_key}});
504 $main::lxdebug->leave_sub();
509 sub destroy_session {
510 $main::lxdebug->enter_sub();
515 my $dbh = $self->dbconnect();
517 do_query($main::form, $dbh, qq|DELETE FROM auth.session_content WHERE session_id = ?|, $session_id);
518 do_query($main::form, $dbh, qq|DELETE FROM auth.session WHERE id = ?|, $session_id);
523 $self->{SESSION} = { };
526 $main::lxdebug->leave_sub();
529 sub expire_sessions {
530 $main::lxdebug->enter_sub();
534 my $dbh = $self->dbconnect();
536 qq|DELETE FROM auth.session_content
540 WHERE (mtime < (now() - '$self->{session_timeout}m'::interval)))|;
542 do_query($main::form, $dbh, $query);
545 qq|DELETE FROM auth.session
546 WHERE (mtime < (now() - '$self->{session_timeout}m'::interval))|;
548 do_query($main::form, $dbh, $query);
552 $main::lxdebug->leave_sub();
555 sub _create_session_id {
556 $main::lxdebug->enter_sub();
559 map { push @data, int(rand() * 255); } (1..32);
561 my $id = md5_hex(pack 'C*', @data);
563 $main::lxdebug->leave_sub();
568 sub create_or_refresh_session {
569 $main::lxdebug->enter_sub();
573 $session_id ||= $self->_create_session_id();
575 my ($form, $dbh, $query, $sth, $id);
578 $dbh = $self->dbconnect();
580 $query = qq|SELECT id FROM auth.session WHERE id = ?|;
582 ($id) = selectrow_query($form, $dbh, $query, $session_id);
585 do_query($form, $dbh, qq|UPDATE auth.session SET mtime = now() WHERE id = ?|, $session_id);
586 do_query($form, $dbh, qq|DELETE FROM auth.session_content WHERE session_id = ?|, $session_id);
589 do_query($form, $dbh, qq|INSERT INTO auth.session (id, ip_address, mtime) VALUES (?, ?, now())|, $session_id, $ENV{REMOTE_ADDR});
593 $query = qq|INSERT INTO auth.session_content (session_id, sess_key, sess_value) VALUES (?, ?, ?)|;
594 $sth = prepare_query($form, $dbh, $query);
596 foreach my $key (sort keys %{ $self->{SESSION} }) {
597 do_statement($form, $sth, $query, $session_id, $key, $self->{SESSION}->{$key});
603 $main::lxdebug->leave_sub();
606 sub set_session_value {
607 $main::lxdebug->enter_sub();
611 $self->{SESSION} ||= { };
613 while (2 <= scalar @_) {
617 $self->{SESSION}->{$key} = $value;
620 $main::lxdebug->leave_sub();
623 sub set_cookie_environment_variable {
625 $ENV{HTTP_COOKIE} = $self->get_session_cookie_name() . "=${session_id}";
628 sub get_session_cookie_name {
631 return $self->{cookie_name} || 'lx_office_erp_session_id';
638 sub session_tables_present {
639 $main::lxdebug->enter_sub();
642 my $dbh = $self->dbconnect(1);
645 $main::lxdebug->leave_sub();
652 WHERE (schemaname = 'auth')
653 AND (tablename IN ('session', 'session_content'))|;
655 my ($count) = selectrow_query($main::form, $dbh, $query);
657 $main::lxdebug->leave_sub();
662 # --------------------------------------
664 sub all_rights_full {
665 my $locale = $main::locale;
668 ["--crm", $locale->text("CRM optional software")],
669 ["crm_search", $locale->text("CRM search")],
670 ["crm_new", $locale->text("CRM create customers, vendors and contacts")],
671 ["crm_service", $locale->text("CRM services")],
672 ["crm_admin", $locale->text("CRM admin")],
673 ["crm_adminuser", $locale->text("CRM user")],
674 ["crm_adminstatus", $locale->text("CRM status")],
675 ["crm_email", $locale->text("CRM send email")],
676 ["crm_termin", $locale->text("CRM termin")],
677 ["crm_opportunity", $locale->text("CRM opportunity")],
678 ["crm_knowhow", $locale->text("CRM know how")],
679 ["crm_follow", $locale->text("CRM follow up")],
680 ["crm_notices", $locale->text("CRM notices")],
681 ["crm_other", $locale->text("CRM other")],
682 ["--master_data", $locale->text("Master Data")],
683 ["customer_vendor_edit", $locale->text("Create and edit customers and vendors")],
684 ["part_service_assembly_edit", $locale->text("Create and edit parts, services, assemblies")],
685 ["project_edit", $locale->text("Create and edit projects")],
686 ["license_edit", $locale->text("Manage license keys")],
687 ["--ar", $locale->text("AR")],
688 ["sales_quotation_edit", $locale->text("Create and edit sales quotations")],
689 ["sales_order_edit", $locale->text("Create and edit sales orders")],
690 ["sales_delivery_order_edit", $locale->text("Create and edit sales delivery orders")],
691 ["invoice_edit", $locale->text("Create and edit invoices and credit notes")],
692 ["dunning_edit", $locale->text("Create and edit dunnings")],
693 ["sales_all_edit", $locale->text("View/edit all employees sales documents")],
694 ["--ap", $locale->text("AP")],
695 ["request_quotation_edit", $locale->text("Create and edit RFQs")],
696 ["purchase_order_edit", $locale->text("Create and edit purchase orders")],
697 ["purchase_delivery_order_edit", $locale->text("Create and edit purchase delivery orders")],
698 ["vendor_invoice_edit", $locale->text("Create and edit vendor invoices")],
699 ["--warehouse_management", $locale->text("Warehouse management")],
700 ["warehouse_contents", $locale->text("View warehouse content")],
701 ["warehouse_management", $locale->text("Warehouse management")],
702 ["--general_ledger_cash", $locale->text("General ledger and cash")],
703 ["general_ledger", $locale->text("Transactions, AR transactions, AP transactions")],
704 ["datev_export", $locale->text("DATEV Export")],
705 ["cash", $locale->text("Receipt, payment, reconciliation")],
706 ["--reports", $locale->text('Reports')],
707 ["report", $locale->text('All reports')],
708 ["advance_turnover_tax_return", $locale->text('Advance turnover tax return')],
709 ["--batch_printing", $locale->text("Batch Printing")],
710 ["batch_printing", $locale->text("Batch Printing")],
711 ["--others", $locale->text("Others")],
712 ["email_bcc", $locale->text("May set the BCC field when sending emails")],
713 ["config", $locale->text("Change Lx-Office installation settings (all menu entries beneath 'System')")],
720 return grep !/^--/, map { $_->[0] } all_rights_full();
724 $main::lxdebug->enter_sub();
728 my $form = $main::form;
730 my $dbh = $self->dbconnect();
732 my $query = 'SELECT * FROM auth."group"';
733 my $sth = prepare_execute_query($form, $dbh, $query);
737 while ($row = $sth->fetchrow_hashref()) {
738 $groups->{$row->{id}} = $row;
742 $query = 'SELECT * FROM auth.user_group WHERE group_id = ?';
743 $sth = prepare_query($form, $dbh, $query);
745 foreach $group (values %{$groups}) {
748 do_statement($form, $sth, $query, $group->{id});
750 while ($row = $sth->fetchrow_hashref()) {
751 push @members, $row->{user_id};
753 $group->{members} = [ uniq @members ];
757 $query = 'SELECT * FROM auth.group_rights WHERE group_id = ?';
758 $sth = prepare_query($form, $dbh, $query);
760 foreach $group (values %{$groups}) {
761 $group->{rights} = {};
763 do_statement($form, $sth, $query, $group->{id});
765 while ($row = $sth->fetchrow_hashref()) {
766 $group->{rights}->{$row->{right}} |= $row->{granted};
769 map { $group->{rights}->{$_} = 0 if (!defined $group->{rights}->{$_}); } all_rights();
773 $main::lxdebug->leave_sub();
779 $main::lxdebug->enter_sub();
784 my $form = $main::form;
785 my $dbh = $self->dbconnect();
787 my ($query, $sth, $row, $rights);
790 ($group->{id}) = selectrow_query($form, $dbh, qq|SELECT nextval('auth.group_id_seq')|);
792 $query = qq|INSERT INTO auth."group" (id, name, description) VALUES (?, '', '')|;
793 do_query($form, $dbh, $query, $group->{id});
796 do_query($form, $dbh, qq|UPDATE auth."group" SET name = ?, description = ? WHERE id = ?|, map { $group->{$_} } qw(name description id));
798 do_query($form, $dbh, qq|DELETE FROM auth.user_group WHERE group_id = ?|, $group->{id});
800 $query = qq|INSERT INTO auth.user_group (user_id, group_id) VALUES (?, ?)|;
801 $sth = prepare_query($form, $dbh, $query);
803 foreach my $user_id (uniq @{ $group->{members} }) {
804 do_statement($form, $sth, $query, $user_id, $group->{id});
808 do_query($form, $dbh, qq|DELETE FROM auth.group_rights WHERE group_id = ?|, $group->{id});
810 $query = qq|INSERT INTO auth.group_rights (group_id, "right", granted) VALUES (?, ?, ?)|;
811 $sth = prepare_query($form, $dbh, $query);
813 foreach my $right (keys %{ $group->{rights} }) {
814 do_statement($form, $sth, $query, $group->{id}, $right, $group->{rights}->{$right} ? 't' : 'f');
820 $main::lxdebug->leave_sub();
824 $main::lxdebug->enter_sub();
829 my $form = $main::from;
831 my $dbh = $self->dbconnect();
833 do_query($form, $dbh, qq|DELETE FROM auth.user_group WHERE group_id = ?|, $id);
834 do_query($form, $dbh, qq|DELETE FROM auth.group_rights WHERE group_id = ?|, $id);
835 do_query($form, $dbh, qq|DELETE FROM auth."group" WHERE id = ?|, $id);
839 $main::lxdebug->leave_sub();
842 sub evaluate_rights_ary {
843 $main::lxdebug->enter_sub(2);
850 foreach my $el (@{$ary}) {
851 if (ref $el eq "ARRAY") {
852 if ($action eq '|') {
853 $value |= evaluate_rights_ary($el);
855 $value &= evaluate_rights_ary($el);
858 } elsif (($el eq '&') || ($el eq '|')) {
861 } elsif ($action eq '|') {
870 $main::lxdebug->leave_sub(2);
875 sub _parse_rights_string {
876 $main::lxdebug->enter_sub(2);
886 push @stack, $cur_ary;
888 while ($access =~ m/^([a-z_0-9]+|\||\&|\(|\)|\s+)/) {
890 substr($access, 0, length $1) = "";
892 next if ($token =~ /\s/);
895 my $new_cur_ary = [];
896 push @stack, $new_cur_ary;
897 push @{$cur_ary}, $new_cur_ary;
898 $cur_ary = $new_cur_ary;
900 } elsif ($token eq ")") {
904 $main::lxdebug->leave_sub(2);
908 $cur_ary = $stack[-1];
910 } elsif (($token eq "|") || ($token eq "&")) {
911 push @{$cur_ary}, $token;
914 push @{$cur_ary}, $self->{RIGHTS}->{$login}->{$token} * 1;
918 my $result = ($access || (1 < scalar @stack)) ? 0 : evaluate_rights_ary($stack[0]);
920 $main::lxdebug->leave_sub(2);
926 $main::lxdebug->enter_sub(2);
933 $self->{FULL_RIGHTS} ||= { };
934 $self->{FULL_RIGHTS}->{$login} ||= { };
936 if (!defined $self->{FULL_RIGHTS}->{$login}->{$right}) {
937 $self->{RIGHTS} ||= { };
938 $self->{RIGHTS}->{$login} ||= $self->load_rights_for_user($login);
940 $self->{FULL_RIGHTS}->{$login}->{$right} = $self->_parse_rights_string($login, $right);
943 my $granted = $self->{FULL_RIGHTS}->{$login}->{$right};
944 $granted = $default if (!defined $granted);
946 $main::lxdebug->leave_sub(2);
952 $main::lxdebug->enter_sub(2);
956 my $dont_abort = shift;
958 my $form = $main::form;
960 if ($self->check_right($form->{login}, $right)) {
961 $main::lxdebug->leave_sub(2);
966 delete $form->{title};
967 $form->show_generic_error($main::locale->text("You do not have the permissions to access this function."));
970 $main::lxdebug->leave_sub(2);
975 sub load_rights_for_user {
976 $main::lxdebug->enter_sub();
981 my $form = $main::form;
982 my $dbh = $self->dbconnect();
984 my ($query, $sth, $row, $rights);
989 qq|SELECT gr."right", gr.granted
990 FROM auth.group_rights gr
993 FROM auth.user_group ug
994 LEFT JOIN auth."user" u ON (ug.user_id = u.id)
997 $sth = prepare_execute_query($form, $dbh, $query, $login);
999 while ($row = $sth->fetchrow_hashref()) {
1000 $rights->{$row->{right}} |= $row->{granted};
1004 map({ $rights->{$_} = 0 unless (defined $rights->{$_}); } SL::Auth::all_rights());
1006 $main::lxdebug->leave_sub();