X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FAuth.pm;h=98c36d3b74e7ad65abaae587a6a02750bec2d275;hb=df0d4d3fb8a275b7f96a260d403966c873123666;hp=6fb66c482f59f9f2dcca899891ee00d06c61f684;hpb=300f3739cfe93d10a867a778a1430068c00c32a8;p=kivitendo-erp.git diff --git a/SL/Auth.pm b/SL/Auth.pm index 6fb66c482..98c36d3b7 100644 --- a/SL/Auth.pm +++ b/SL/Auth.pm @@ -615,7 +615,7 @@ sub save_session { my $dbh = $provided_dbh || $self->dbconnect(1); - $::lxdebug->leave_sub && return unless $dbh; + $::lxdebug->leave_sub && return unless $dbh && $session_id; $dbh->begin_work unless $provided_dbh; @@ -1092,25 +1092,20 @@ sub check_right { } sub assert { - $main::lxdebug->enter_sub(2); - - my $self = shift; - my $right = shift; - my $dont_abort = shift; - - my $form = $main::form; + $::lxdebug->enter_sub(2); + my ($self, $right, $dont_abort) = @_; - if ($self->check_right($form->{login}, $right)) { - $main::lxdebug->leave_sub(2); + if ($self->check_right($::myconfig{login}, $right)) { + $::lxdebug->leave_sub(2); return 1; } if (!$dont_abort) { - delete $form->{title}; - $form->show_generic_error($main::locale->text("You do not have the permissions to access this function.")); + delete $::form->{title}; + $::form->show_generic_error($::locale->text("You do not have the permissions to access this function.")); } - $main::lxdebug->leave_sub(2); + $::lxdebug->leave_sub(2); return 0; } @@ -1122,7 +1117,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