summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorJeff Fearn <Jeff.Fearn@gmail.com>2015-05-18 06:38:56 +0200
committerByron Jones <glob@mozilla.com>2015-05-18 06:38:56 +0200
commit3ff9b3e89d495a181495615189da38b2c792124a (patch)
treebcfdfa285ee1ceb38a898a7d4ec1eb72823fb0f6 /Bugzilla
parentbd4bfe35ac0c3c7808bedf99a9f6c68b16ec215b (diff)
downloadbugzilla-3ff9b3e89d495a181495615189da38b2c792124a.tar.gz
bugzilla-3ff9b3e89d495a181495615189da38b2c792124a.tar.xz
Bug 1162334: email_enabled value inverted in User.update RPC call
r=glob,a=glob
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/API/1_0/Resource/User.pm2
-rw-r--r--Bugzilla/User.pm9
-rw-r--r--Bugzilla/WebService/User.pm2
3 files changed, 7 insertions, 6 deletions
diff --git a/Bugzilla/API/1_0/Resource/User.pm b/Bugzilla/API/1_0/Resource/User.pm
index 8b4e99e2e..3f1b6272d 100644
--- a/Bugzilla/API/1_0/Resource/User.pm
+++ b/Bugzilla/API/1_0/Resource/User.pm
@@ -56,14 +56,12 @@ use constant MAPPED_FIELDS => {
email => 'login',
full_name => 'name',
login_denied_text => 'disabledtext',
- email_enabled => 'disable_mail'
};
use constant MAPPED_RETURNS => {
login_name => 'email',
realname => 'full_name',
disabledtext => 'login_denied_text',
- disable_mail => 'email_enabled'
};
sub REST_RESOURCES {
diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm
index fdc54de04..8df1316c5 100644
--- a/Bugzilla/User.pm
+++ b/Bugzilla/User.pm
@@ -314,8 +314,9 @@ sub _check_is_enabled {
# Mutators
################################################################################
-sub set_disable_mail { $_[0]->set('disable_mail', $_[1]); }
-sub set_extern_id { $_[0]->set('extern_id', $_[1]); }
+sub set_disable_mail { $_[0]->set('disable_mail', $_[1]); }
+sub set_email_enabled { $_[0]->set('disable_mail', !$_[1]); }
+sub set_extern_id { $_[0]->set('extern_id', $_[1]); }
sub set_login {
my ($self, $login) = @_;
@@ -3098,6 +3099,10 @@ C<hash> - This is the same as set_groups, but affects what groups a user
has direct membership to bless that group. It takes the same inputs as
set_groups.
+=item C<set_email_enabled>
+
+C<bool> - Sets C<disable_mail> to the inverse of the boolean provided.
+
=back
=head1 CLASS FUNCTIONS
diff --git a/Bugzilla/WebService/User.pm b/Bugzilla/WebService/User.pm
index 06698668c..0ae76d70f 100644
--- a/Bugzilla/WebService/User.pm
+++ b/Bugzilla/WebService/User.pm
@@ -46,14 +46,12 @@ use constant MAPPED_FIELDS => {
email => 'login',
full_name => 'name',
login_denied_text => 'disabledtext',
- email_enabled => 'disable_mail'
};
use constant MAPPED_RETURNS => {
login_name => 'email',
realname => 'full_name',
disabledtext => 'login_denied_text',
- disable_mail => 'email_enabled'
};
##############