summaryrefslogtreecommitdiff
path: root/lib/VNDB
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VNDB')
-rw-r--r--lib/VNDB/DB/Users.pm4
-rw-r--r--lib/VNDB/Handler/Users.pm19
2 files changed, 14 insertions, 9 deletions
diff --git a/lib/VNDB/DB/Users.pm b/lib/VNDB/DB/Users.pm
index 20278688..41f9f25a 100644
--- a/lib/VNDB/DB/Users.pm
+++ b/lib/VNDB/DB/Users.pm
@@ -54,7 +54,7 @@ sub dbUserGet {
qw|id username c_votes c_changes show_list c_tags|,
q|extract('epoch' from registered) as registered|,
$o{what} =~ /extended/ ? (
- qw|mail rank salt skin customcss show_nsfw ign_votes notify_dbedit|,
+ qw|mail rank salt skin customcss show_nsfw ign_votes notify_dbedit notify_announce|,
q|encode(passwd, 'hex') AS passwd|
) : (),
$o{what} =~ /notifycount/ ?
@@ -100,7 +100,7 @@ sub dbUserEdit {
my %h;
defined $o{$_} && ($h{$_.' = ?'} = $o{$_})
- for (qw| username mail rank show_nsfw show_list skin customcss salt ign_votes notify_dbedit |);
+ for (qw| username mail rank show_nsfw show_list skin customcss salt ign_votes notify_dbedit notify_announce |);
$h{'passwd = decode(?, \'hex\')'} = $o{passwd}
if defined $o{passwd};
diff --git a/lib/VNDB/Handler/Users.pm b/lib/VNDB/Handler/Users.pm
index e7822f6e..f68f9db9 100644
--- a/lib/VNDB/Handler/Users.pm
+++ b/lib/VNDB/Handler/Users.pm
@@ -537,11 +537,14 @@ sub notifies {
my $saved;
if($self->reqMethod() eq 'POST' && $self->reqParam('set')) {
my $frm = $self->formValidate(
- { name => 'notify_dbedit', required => 0 }
+ { name => 'notify_dbedit', required => 0 },
+ { name => 'notify_announce', required => 0 }
);
return 404 if $frm->{_err};
- $frm->{notify_dbedit} = $frm->{notify_dbedit} ? 1 : 0;
- $self->authInfo->{notify_dbedit} = $frm->{notify_dbedit};
+ for ('notify_dbedit', 'notify_announce') {
+ $frm->{$_} = $frm->{$_} ? 1 : 0;
+ $self->authInfo->{$_} = $frm->{$_};
+ }
$self->dbUserEdit($uid, %$frm);
$saved = 1;
@@ -628,10 +631,12 @@ sub notifies {
h1 mt '_usern_set_title';
div class => 'notice', mt '_usern_set_saved' if $saved;
p;
- input type => 'checkbox', name => 'notify_dbedit', id => 'notify_dbedit', value => 1,
- $self->authInfo->{notify_dbedit} ? (checked => 'checked') : ();
- label for => 'notify_dbedit', ' '.mt('_usern_set_dbedit');
- br;
+ for('dbedit', 'announce') {
+ input type => 'checkbox', name => "notify_$_", id => "notify_$_", value => 1,
+ $self->authInfo->{"notify_$_"} ? (checked => 'checked') : ();
+ label for => "notify_$_", ' '.mt("_usern_set_$_");
+ br;
+ }
input type => 'submit', name => 'set', value => mt '_usern_set_submit';
end;
end;