summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2019-10-12 21:08:34 +0200
committerYorhel <git@yorhel.nl>2019-10-12 21:08:34 +0200
commit8c9a5a4bdfa111b149ea58f36db7720f62a2d379 (patch)
tree55de352560b2b20ed8bb92897fd320ce71079bdb
parent0be1aa6acb62c13b4bcb4bd52a9c76df5f248e45 (diff)
rewards: Fix applying the public skin even when disabled
-rw-r--r--lib/VNDB/DB/Users.pm2
-rw-r--r--lib/VNWeb/HTML.pm5
-rw-r--r--lib/VNWeb/Misc/History.pm2
-rw-r--r--lib/VNWeb/User/Page.pm2
4 files changed, 6 insertions, 5 deletions
diff --git a/lib/VNDB/DB/Users.pm b/lib/VNDB/DB/Users.pm
index d253a52b..276ce202 100644
--- a/lib/VNDB/DB/Users.pm
+++ b/lib/VNDB/DB/Users.pm
@@ -55,7 +55,7 @@ sub dbUserGet {
VNWeb::DB::sql_user(), # XXX: This duplicates id and username, but updating all the code isn't going to be easy
q|extract('epoch' from registered) as registered|,
$o{what} =~ /extended/ ? qw|perm ign_votes| : (), # mail
- $o{what} =~ /pubskin/ ? qw|pubskin_can customcss skin| : (),
+ $o{what} =~ /pubskin/ ? qw|pubskin_can pubskin_enabled customcss skin| : (),
$token ? qq|extract('epoch' from user_isloggedin(id, decode('$token', 'hex'))) as session_lastused| : (),
);
diff --git a/lib/VNWeb/HTML.pm b/lib/VNWeb/HTML.pm
index 17ab0947..ad5a9076 100644
--- a/lib/VNWeb/HTML.pm
+++ b/lib/VNWeb/HTML.pm
@@ -119,9 +119,10 @@ sub _head_ {
my $o = shift;
my $fancy = !(auth->pref('nodistract_can') && auth->pref('nodistract_nofancy'));
- my $skin = tuwf->reqGet('skin') || ($fancy && $o->{pubskin}{pubskin_can} ? $o->{pubskin}{skin} : auth->pref('skin')) || '';
+ my $pubskin = $fancy && $o->{pubskin}{pubskin_can} && $o->{pubskin}{pubskin_enabled};
+ my $skin = tuwf->reqGet('skin') || ($pubskin ? $o->{pubskin}{skin} : auth->pref('skin')) || '';
$skin = config->{skin_default} if !tuwf->{skins}{$skin};
- my $customcss = $fancy && $o->{pubskin}{pubskin_can} ? $o->{pubskin}{customcss} : auth->pref('customcss');
+ my $customcss = $pubskin ? $o->{pubskin}{customcss} : auth->pref('customcss');
meta_ charset => 'utf-8';
title_ $o->{title}.' | vndb';
diff --git a/lib/VNWeb/Misc/History.pm b/lib/VNWeb/Misc/History.pm
index 2ba4675d..5251d4ea 100644
--- a/lib/VNWeb/Misc/History.pm
+++ b/lib/VNWeb/Misc/History.pm
@@ -187,7 +187,7 @@ TUWF::get qr{/(?:([upvrcsd])([1-9]\d*)/)?hist} => sub {
};
my $obj = !$type ? undef :
- $type eq 'u' ? tuwf->dbRowi('SELECT id, ', sql_user(), ', pubskin_can, customcss, skin FROM users u WHERE id =', \$id) :
+ $type eq 'u' ? tuwf->dbRowi('SELECT id, ', sql_user(), ', pubskin_can, pubskin_enabled, customcss, skin FROM users u WHERE id =', \$id) :
$type eq 'p' ? dbitem producers => 'name' :
$type eq 'v' ? dbitem vn => 'title' :
$type eq 'r' ? dbitem releases => 'title' :
diff --git a/lib/VNWeb/User/Page.pm b/lib/VNWeb/User/Page.pm
index b276f8fa..1eebcbb0 100644
--- a/lib/VNWeb/User/Page.pm
+++ b/lib/VNWeb/User/Page.pm
@@ -125,7 +125,7 @@ sub _votestats_ {
TUWF::get qr{/$RE{uid}}, sub {
my $u = tuwf->dbRowi(q{
- SELECT id, hide_list, c_changes, c_votes, c_tags, pubskin_can, skin, customcss
+ SELECT id, hide_list, c_changes, c_votes, c_tags, pubskin_can, pubskin_enabled, skin, customcss
,}, sql_totime('registered'), q{ AS registered
,}, sql_user(), q{
FROM users u