X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/d0c2cfbef2bfa708dad6df15c76daa81d4fda3ab..165a97b3d1d6190ae2a89a853bb62b58bf698308:/SL/Auth.pm diff --git a/SL/Auth.pm b/SL/Auth.pm index 3ff6a1c3b..415898061 100644 --- a/SL/Auth.pm +++ b/SL/Auth.pm @@ -137,12 +137,10 @@ sub _read_auth_config { sub authenticate_root { $main::lxdebug->enter_sub(); - my $self = shift; - my $password = shift; - my $is_crypted = shift; + my ($self, $password) = @_; - $password = crypt $password, 'ro' if (!$password || !$is_crypted); - my $admin_password = crypt "$self->{admin_password}", 'ro'; + $password = SL::Auth::Password->hash_if_unhashed(login => 'root', password => $password); + my $admin_password = SL::Auth::Password->hash_if_unhashed(login => 'root', password => $self->{admin_password}); $main::lxdebug->leave_sub(); @@ -173,6 +171,12 @@ sub store_credentials_in_session { $self->set_session_value(login => $params{login}, password => $params{password}); } +sub store_root_credentials_in_session { + my ($self, $rpw) = @_; + + $self->set_session_value(rpw => SL::Auth::Password->hash_if_unhashed(login => 'root', password => $rpw)); +} + sub dbconnect { $main::lxdebug->enter_sub(2);