diff options
author | Jeff Fearn <jfearn@redhat.com> | 2022-06-08 20:18:35 +1000 |
---|---|---|
committer | Jeff Fearn <jfearn@redhat.com> | 2022-06-08 20:18:35 +1000 |
commit | 366c58483eea2b5c806c7d9bd61f7152f5cf2806 (patch) | |
tree | 4811b4954b1f187395b2205ac6bb9804e78a1884 | |
parent | Bug 2075342 - Support session time limits (diff) | |
download | bugzilla-366c58483eea2b5c806c7d9bd61f7152f5cf2806.tar.gz bugzilla-366c58483eea2b5c806c7d9bd61f7152f5cf2806.tar.bz2 bugzilla-366c58483eea2b5c806c7d9bd61f7152f5cf2806.zip |
Bug 2092657 - Validating redhat.com accounts fails for valid aliases
Only validate enabled accounts.
Change-Id: I47fc434660050fc1651eb7ae9dde1b21d34e617b
-rw-r--r-- | extensions/RedHat/Extension.pm | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/extensions/RedHat/Extension.pm b/extensions/RedHat/Extension.pm index 34ccf248d..40829efbf 100644 --- a/extensions/RedHat/Extension.pm +++ b/extensions/RedHat/Extension.pm @@ -4242,15 +4242,12 @@ sub object_end_of_update { # Note that this is a made-up class, for this example. if ($object->isa('Bugzilla::User')) { - my $valid = _validate_redhat_addr($object->login); - if (defined $changes->{'name'}) { my ($old, $new) = @{$changes->{'name'}}; print "The name field changed from $old to $new!"; } - if ( !$valid - && !$object->is_bot + if ( !$object->is_bot && Bugzilla->user->login ne Bugzilla->params->{system_user}) { my ($old_dt, $new_dt); @@ -4261,8 +4258,10 @@ sub object_end_of_update { if (defined $changes->{'disable_mail'}); if ($object->is_enabled || $object->email_enabled) { + my $valid = _validate_redhat_addr($object->login); + ThrowUserError('cannot_update_invalid_redhat_mail', - {account => $object->login}); + {account => $object->login}) unless($valid); } } } |