From a155e54a432dbe0799f3ad62770dd30104e8b9e1 Mon Sep 17 00:00:00 2001 From: Yorhel Date: Fri, 27 Nov 2009 14:55:15 +0100 Subject: Util::Auth: Fixed 500 on invalid cookie format Caused by $self->{_auth} being set to an empty string when the uid part of the cookie doesn't match, and authCan() not properly checking for a positive value of $self->{_auth} --- lib/VNDB/Util/Auth.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/VNDB/Util/Auth.pm') diff --git a/lib/VNDB/Util/Auth.pm b/lib/VNDB/Util/Auth.pm index cef9b905..19a58a0f 100644 --- a/lib/VNDB/Util/Auth.pm +++ b/lib/VNDB/Util/Auth.pm @@ -82,7 +82,7 @@ sub authInfo { # a certain action. Argument is the action name as defined in global.pl sub authCan { my($self, $act) = @_; - my $r = $self->{_auth}{rank}||0; + my $r = $self->{_auth} ? $self->{_auth}{rank} : 0; return scalar grep $_ eq $act, @{$self->{user_ranks}[$r]}[0..$#{$self->{user_ranks}[$r]}]; } -- cgit v1.2.3