summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/User.pm14
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 #
###########################