summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2011-01-25 17:19:55 +0100
committerYorhel <git@yorhel.nl>2011-01-27 09:53:17 +0100
commit01c4028bfa067546af572de06789cc4121b1ffbc (patch)
tree82ea50766ea26d4c770d7ac034e41d4321c84361
parente46f634c49aa4e174d6cc351b25a60d33c251b25 (diff)
TUWF: Made use of the new cookie_prefix feature
Configuration change: Make sure you more the cookie_prefix option from %S to %O. (It's now a TUWF option rather than a VNDB one)
-rw-r--r--data/global.pl2
-rw-r--r--lib/VNDB/Handler/Tags.pm2
-rw-r--r--lib/VNDB/Handler/VNBrowse.pm2
-rw-r--r--lib/VNDB/Util/Auth.pm4
4 files changed, 5 insertions, 5 deletions
diff --git a/data/global.pl b/data/global.pl
index f898599e..7b6a4154 100644
--- a/data/global.pl
+++ b/data/global.pl
@@ -9,6 +9,7 @@ our %O = (
db_login => [ 'dbi:Pg:dbname=vndb', 'vndb', 'passwd' ],
debug => 1,
logfile => $ROOT.'/data/log/vndb.log',
+ cookie_prefix => 'vndb_',
);
@@ -19,7 +20,6 @@ our %S = (%S,
url_static => 'http://s.vndb.org',
skin_default => 'angel',
cookie_domain => '.vndb.org',
- cookie_prefix => 'vndb_',
global_salt => 'any-private-string-here',
form_salt => 'a-different-private-string-here',
regen_static => 0,
diff --git a/lib/VNDB/Handler/Tags.pm b/lib/VNDB/Handler/Tags.pm
index 65f6a957..2c1d120c 100644
--- a/lib/VNDB/Handler/Tags.pm
+++ b/lib/VNDB/Handler/Tags.pm
@@ -36,7 +36,7 @@ sub tagpage {
{ get => 'm', required => 0, default => -1, enum => [qw|0 1 2|] },
);
return $self->resNotFound if $f->{_err};
- my $tagspoil = $self->reqCookie($self->{cookie_prefix}.'tagspoil');
+ my $tagspoil = $self->reqCookie('tagspoil');
$f->{m} = $tagspoil =~ /^[0-2]$/ ? $tagspoil : 0 if $f->{m} == -1;
my($list, $np) = $t->{meta} || $t->{state} != 2 ? ([],0) : $self->filFetchDB(vn => undef, undef, {
diff --git a/lib/VNDB/Handler/VNBrowse.pm b/lib/VNDB/Handler/VNBrowse.pm
index 16a7edfb..f3bad521 100644
--- a/lib/VNDB/Handler/VNBrowse.pm
+++ b/lib/VNDB/Handler/VNBrowse.pm
@@ -77,7 +77,7 @@ sub _fil_compat {
my $f = $self->formValidate(
{ get => 'ln', required => 0, multi => 1, enum => $self->{languages}, default => '' },
{ get => 'pl', required => 0, multi => 1, enum => $self->{platforms}, default => '' },
- { get => 'sp', required => 0, default => $self->reqCookie($self->{cookie_prefix}.'tagspoil') =~ /^([0-2])$/ ? $1 : 0, enum => [0..2] },
+ { get => 'sp', required => 0, default => $self->reqCookie('tagspoil') =~ /^([0-2])$/ ? $1 : 0, enum => [0..2] },
);
return () if $f->{_err};
$c{lang} //= $f->{ln} if $f->{ln}[0];
diff --git a/lib/VNDB/Util/Auth.pm b/lib/VNDB/Util/Auth.pm
index 864d1c54..996752f4 100644
--- a/lib/VNDB/Util/Auth.pm
+++ b/lib/VNDB/Util/Auth.pm
@@ -22,7 +22,7 @@ sub authInit {
my $self = shift;
$self->{_auth} = undef;
- my $cookie = $self->reqCookie($self->{cookie_prefix}.'auth');
+ my $cookie = $self->reqCookie('auth');
return 0 if !$cookie;
return _rmcookie($self) if length($cookie) < 41;
my $token = substr($cookie, 0, 40);
@@ -61,7 +61,7 @@ sub authLogin {
sub authLogout {
my $self = shift;
- my $cookie = $self->reqCookie($self->{cookie_prefix}.'auth');
+ my $cookie = $self->reqCookie('auth');
if ($cookie && length($cookie) >= 41) {
my $token = substr($cookie, 0, 40);
my $uid = substr($cookie, 40);