X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/c781fb44ddffd751ae494781cbd239c44c844e15..90af0ce7f2f0a8b4155d65a89e612bea1631db38:/SL/Auth.pm diff --git a/SL/Auth.pm b/SL/Auth.pm index ff77bfcc7..adf58106e 100644 --- a/SL/Auth.pm +++ b/SL/Auth.pm @@ -567,6 +567,8 @@ sub expire_sessions { my $self = shift; + $main::lxdebug->leave_sub and return if !$self->session_tables_present; + my $dbh = $self->dbconnect(); $dbh->begin_work; @@ -779,6 +781,14 @@ sub session_tables_present { $main::lxdebug->enter_sub(); my $self = shift; + + # Only re-check for the presence of auth tables if either the check + # hasn't been done before of if they weren't present. + if ($self->{session_tables_present}) { + $main::lxdebug->leave_sub(); + return $self->{session_tables_present}; + } + my $dbh = $self->dbconnect(1); if (!$dbh) { @@ -794,9 +804,11 @@ sub session_tables_present { my ($count) = selectrow_query($main::form, $dbh, $query); + $self->{session_tables_present} = 2 == $count; + $main::lxdebug->leave_sub(); - return 2 == $count; + return $self->{session_tables_present}; } # -------------------------------------- @@ -1117,7 +1129,7 @@ sub load_rights_for_user { my $dbh = $self->dbconnect; my ($query, $sth, $row, $rights); - $rights = { map { $rights->{$_} = 0 } all_rights() }; + $rights = { map { $_ => 0 } all_rights() }; $query = qq|SELECT gr."right", gr.granted