From ee2eb7de3865e97dd48030da6cf48606d95fe152 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Mon, 2 Jul 2007 09:16:08 +0000 Subject: Bug 384651: Make CC adding and removal use Bugzilla::Bug in process_bug Patch By Max Kanat-Alexander r=LpSolit, a=LpSolit --- Bugzilla/User.pm | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Bugzilla/User.pm') diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm index a14549f84..f13b94fbf 100644 --- a/Bugzilla/User.pm +++ b/Bugzilla/User.pm @@ -131,6 +131,14 @@ sub new { return $class->SUPER::new(@_); } +sub check { + my ($username) = @_; + $username = trim($username); + my $user = new Bugzilla::User({ name => $username }) + || ThrowUserError('invalid_username', { name => $username }); + return $user; +} + sub update { my $self = shift; my $changes = $self->SUPER::update(@_); @@ -2072,6 +2080,11 @@ Params: login_name - B The login name for the new user. disable_mail - If 1, bug-related mail will not be sent to this user; if 0, mail will be sent depending on the user's email preferences. +=item C + +Takes a username as its only argument. Throws an error if there is no +user with that username. Returns a C object. + =item C Returns a boolean indicating whether or not the supplied username is -- cgit v1.2.3-24-g4f1b