diff options
author | Byron Jones <glob@mozilla.com> | 2015-07-27 06:56:59 +0200 |
---|---|---|
committer | Byron Jones <glob@mozilla.com> | 2015-07-27 06:56:59 +0200 |
commit | 1146dfffe7569ec677fd03c47b2a0447cf5b74ff (patch) | |
tree | 4aefdcedf9e32a8eca73117df39b5bba04cd5e78 /Bugzilla | |
parent | 8553f91f07568d64ff84b3bedee9e6e532b5cc0c (diff) | |
download | bugzilla-1146dfffe7569ec677fd03c47b2a0447cf5b74ff.tar.gz bugzilla-1146dfffe7569ec677fd03c47b2a0447cf5b74ff.tar.xz |
Bug 1186788 - disabling an account should always disable bugmail
Diffstat (limited to 'Bugzilla')
-rw-r--r-- | Bugzilla/User.pm | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm index a749aaaf2..fe48e4bf2 100644 --- a/Bugzilla/User.pm +++ b/Bugzilla/User.pm @@ -277,8 +277,9 @@ sub update { ################################################################################ sub _check_disable_mail { - return 1 unless $_[0]->is_enabled; - return $_[1] ? 1 : 0; + my ($invocant, $value) = @_; + return 1 if ref($invocant) && !$invocant->is_enabled; + return $value ? 1 : 0; } sub _check_disabledtext { return trim($_[1]) || ''; } @@ -2219,6 +2220,15 @@ sub create { return $user; } +sub check_required_create_fields { + my ($invocant, $params) = @_; + # ensure disabled users also have their email disabled + $params->{disable_mail} = 1 if + exists $params->{disabledtext} + && defined($params->{disabledtext}) + && trim($params->{disabledtext}) ne ''; +} + ########################### # Account Lockout Methods # ########################### |