diff options
author | Yorhel <git@yorhel.nl> | 2019-10-03 10:45:51 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2019-10-03 10:50:20 +0200 |
commit | 8795f8a55df40603e3e589b584cc5d4c66e78f3a (patch) | |
tree | 7407dd4b1d40a0485a42e0a0ea14fa41a7e74981 /lib/VNWeb/HTML.pm | |
parent | 2e9f6f1844131529f553de37eba0bca421a75f8b (diff) |
SQL: Get rid of the users_prefs table, store preferences in users table
This bloats the users table a little bit, but that's fine. The main
advantage of this change is that we now have a proper schema for user
preferences, rather than the schemaless key-value mess we had before.
This commit also splits the 'tags_cat' preference up into tags_cont,
tags_ero and tags_tech bools, as that's more compact to store and easier
to work with.
This commit also changes the 'notify_nodbedit' preference to
'notify_dbedit' with inverted meaning. The reason the value was negated
in the first place was because the old schemaless approach did not
support positive defaults.
Diffstat (limited to 'lib/VNWeb/HTML.pm')
-rw-r--r-- | lib/VNWeb/HTML.pm | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/VNWeb/HTML.pm b/lib/VNWeb/HTML.pm index e84f009c..28002dcb 100644 --- a/lib/VNWeb/HTML.pm +++ b/lib/VNWeb/HTML.pm @@ -285,9 +285,7 @@ sub _maintabs_ { t list => "/$id/list", 'list'; } if $t eq 'u' && ( auth->permUsermod || (auth && auth->uid == $o->{id}) - || !(exists $o->{hide_list} - ? $o->{hide_list} - : tuwf->dbVali('SELECT value FROM users_prefs WHERE', { uid => $o->{id}, key => 'hide_list' })) + || !($o->{hide_list} // tuwf->dbVali('SELECT hide_list FROM users WHERE id =', \$o->{id})) ); t tagmod => "/$id/tagmod", 'modify tags' if $t eq 'v' && auth->permTag && !$o->{entry_hidden}; |