summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-11-27 14:55:15 +0100
committerYorhel <git@yorhel.nl>2009-11-27 14:55:15 +0100
commita155e54a432dbe0799f3ad62770dd30104e8b9e1 (patch)
tree9a5761d0717f62d004f4efbc39e1ae0b427519e7
parent8448e6a074a5b5899db99567b625506fc57689c9 (diff)
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}
-rw-r--r--lib/VNDB/Util/Auth.pm2
1 files changed, 1 insertions, 1 deletions
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]}];
}