X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/8c7e44938a661e035f62840e1e177353240ace5d..de998cce754a73341988441034e2649f3ded6c54:/SL/Auth.pm diff --git a/SL/Auth.pm b/SL/Auth.pm index 062a4baeb..cbd90bcdb 100644 --- a/SL/Auth.pm +++ b/SL/Auth.pm @@ -92,12 +92,12 @@ sub _read_auth_config { sub authenticate_root { $main::lxdebug->enter_sub(); - my $self = shift; - my $password = shift; - my $is_crypted = shift; + my $self = shift; + my $password = shift; + my $is_crypted = shift; - $password = crypt $password, 'ro' if (!$password || !$is_crypted); - $admin_password = crypt "$self->{admin_password}", 'ro'; + $password = crypt $password, 'ro' if (!$password || !$is_crypted); + my $admin_password = crypt "$self->{admin_password}", 'ro'; $main::lxdebug->leave_sub(); @@ -325,7 +325,7 @@ sub read_all_users { while (my $ref = $sth->fetchrow_hashref()) { $users{$ref->{login}} ||= { 'login' => $ref->{login}, 'id' => $ref->{id} }; - $users{$ref->{login}}->{$ref->{cfg_key}} = $ref->{cfg_value} if (($cfg_key ne 'login') && ($cfg_key ne 'id')); + $users{$ref->{login}}->{$ref->{cfg_key}} = $ref->{cfg_value} if (($ref->{cfg_key} ne 'login') && ($ref->{cfg_key} ne 'id')); } $sth->finish(); @@ -423,7 +423,7 @@ sub restore_session { $form = $main::form; $dbh = $self->dbconnect(); - $query = qq|SELECT *, (mtime < (now() - '24h'::interval)) AS is_expired FROM auth.session WHERE id = ?|; + $query = qq|SELECT *, (mtime < (now() - '8h'::interval)) AS is_expired FROM auth.session WHERE id = ?|; $cookie = selectfirst_hashref_query($form, $dbh, $query, $session_id); @@ -477,13 +477,13 @@ sub expire_sessions { WHERE session_id IN (SELECT id FROM auth.session - WHERE (mtime < (now() - '24h'::interval)))|; + WHERE (mtime < (now() - '8h'::interval)))|; do_query($main::form, $dbh, $query); $query = qq|DELETE FROM auth.session - WHERE (mtime < (now() - '24h'::interval))|; + WHERE (mtime < (now() - '8h'::interval))|; do_query($main::form, $dbh, $query);