summaryrefslogtreecommitdiff
path: root/lib/VNDB/Handler/Users.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2010-12-23 14:25:37 +0100
committerYorhel <git@yorhel.nl>2010-12-23 14:25:37 +0100
commit3eb574e4e26162aa754372fff806e4c6de8f4754 (patch)
tree32b08348512dc2f16d932676bb9b1b61fab16f3a /lib/VNDB/Handler/Users.pm
parent6ff1efe0d07e24e9fb2db199c308c6cbed51e578 (diff)
Converted the notify_announce and notify_dbedit preferences
And renamed notify_dbedit to notify_nodbedit, since the default is to provide a notify on a database edit. Also fixed a few bugs along the way.
Diffstat (limited to 'lib/VNDB/Handler/Users.pm')
-rw-r--r--lib/VNDB/Handler/Users.pm17
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/VNDB/Handler/Users.pm b/lib/VNDB/Handler/Users.pm
index d19b2f74..044c72b2 100644
--- a/lib/VNDB/Handler/Users.pm
+++ b/lib/VNDB/Handler/Users.pm
@@ -559,15 +559,11 @@ sub notifies {
if($self->reqMethod() eq 'POST' && $self->reqParam('set')) {
return if !$self->authCheckCode;
my $frm = $self->formValidate(
- { name => 'notify_dbedit', required => 0 },
- { name => 'notify_announce', required => 0 }
+ { name => 'notify_nodbedit', required => 0, default => 1, enum => [0,1] },
+ { name => 'notify_announce', required => 0, default => 0, enum => [0,1] }
);
return 404 if $frm->{_err};
- for ('notify_dbedit', 'notify_announce') {
- $frm->{$_} = $frm->{$_} ? 1 : 0;
- $self->authInfo->{$_} = $frm->{$_};
- }
- $self->dbUserEdit($uid, %$frm);
+ $self->authPref($_, $frm->{$_}) for ('notify_nodbedit', 'notify_announce');
$saved = 1;
# updating notifications
@@ -658,9 +654,10 @@ sub notifies {
h1 mt '_usern_set_title';
div class => 'notice', mt '_usern_set_saved' if $saved;
p;
- for('dbedit', 'announce') {
- input type => 'checkbox', name => "notify_$_", id => "notify_$_", value => 1,
- $self->authInfo->{"notify_$_"} ? (checked => 'checked') : ();
+ for('nodbedit', 'announce') {
+ my $def = $_ eq 'nodbedit'? 0 : 1;
+ input type => 'checkbox', name => "notify_$_", id => "notify_$_", value => $def,
+ ($self->authPref("notify_$_")||0) == $def ? (checked => 'checked') : ();
label for => "notify_$_", ' '.mt("_usern_set_$_");
br;
}