BZ::Client::User(3pm)
π¦ BZ::Client::User(3pm) π¦
okay so bestie, this is the BZ::Client::User(3pm) page from User Contributed Perl Documentation β and it is literally the manual for creating and editing user accounts in Bugzilla. π
π NAME π
BZ::Client::User β Creates and edits user accounts in Bugzilla
β¨ VERSION β¨
version 4.91
πΈ SYNOPSIS πΈ
This class provides methods for accessing information about the Bugzilla servers installation.
my $client = BZ::Client->new( url => $url,
user => $user,
password => $password );
my $ok = BZ::Client::User->offer_account_by_email( $client, 'email@address' );
my $users = BZ::Client::User->get( $client, \%params );
my $id = BZ::Client::User->create( $client, \%params );
my $users = BZ::Client::User->update( $client, \%params );
π CLASS METHODS π
This section lists the class methods, which are available in this module.
π
offer_account_by_email
my $ok = BZ::Client::User->offer_account_by_email( $client, 'email@address' );
my $ok = BZ::Client::User->offer_account_by_email( $client, \%params );
Sends an email to the user, offering to create an account. The user will have to click on a URL in the email, and choose their password and real name.
This is the recommended way to create a Bugzilla account. π«Ά
Parameters
emailβ (string) The email address to send the offer to.
Note: email can be provided as the single option as a scalar as shown above.
Returns
nothing if successful
Errors
50 - Email parameter missingβ Theemailparameter was not provided.500 - Account Already Existsβ An account with that email address already exists in Bugzilla.501 - Illegal Email Addressβ This Bugzilla does not allow you to create accounts with the format of email address you specified. Account creation may be entirely disabled.
π get
my $users = BZ::Client::User->get( $client, \%params );
Gets information about user accounts in Bugzilla.
History
Added in Bugzilla 3.4
Parameters
Note: At least one ofids,names, ormatchmust be specified.
Note: Users will only appear once in the returned list, even if that user is matched by more than one search argument.
In addition to the parameters below, this method also accepts the standard include_fields in BZ::Client::Bug and exclude_fields in BZ::Client::Bug arguments.
idsβ (array) An array of integers, representing user ID's.
Logged-out users cannot pass this parameter to this function. If they try, they will get an error. Logged-in users will get an error if they specify the ID of a user they cannot see.
namesβ (array) An array of login names (strings).matchβ (array) An array of strings. This works just like "user matching" in Bugzilla itself. Users will be returned whose real name or login name contains any one of the specified strings. Users that you cannot see will not be included in the returned list.
Most installations have a limit on how many matches are returned for each string, which defaults to 1000 but can be changed by the Bugzilla administrator.
Logged-out users cannot use this argument, and an error will be thrown if they try. (This is to make it harder for spammers to harvest email addresses from Bugzilla, and also to enforce the user visibility restrictions that are implemented on some Bugzillas.)
limitβ (int) Limit the number of users matched by thematchparameter. If value is greater than the system limit, the system limit will be used. This parameter is only used when user matching using thematchparameter is being performed.group_idsβ (array)group_idsis an array of numeric ids for groups that a user can be in. If this is specified, it limits the return value to users who are in any of the groups specified.
Added in Bugzilla 4.0
groupsβ (array)groupsis an array of names of groups that a user can be in. If this is specified, it limits the return value to users who are in any of the groups specified.
Added in Bugzilla 4.0
include_disabledβ (boolean) By default, when using thematchparameter, disabled users are excluded from the returned results unless their full username is identical to the match string. Settinginclude_disabledtotruewill include disabled users in the returned results even if their username doesn't fully match the input string.
Added in Bugzilla 4.0, default behaviour for match was then changed to exclude disabled users.
Returns
A hash containing one item, users, that is an array of hashes. Each hash describes a user, and has the following items:
idβid (int)The unique integer ID that Bugzilla uses to represent this user. Even if the user's login name changes, this will not change.real_nameβreal_name (string)The actual name of the user. May be blank.emailβemail (string)The email address of the user.nameβname (string)The login name of the user. Note that in some situations this is different than their email.can_loginβcan_login (boolean)A boolean value to indicate if the user can login into bugzilla.email_enabledβemail_enabled (boolean)A boolean value to indicate if bug-related mail will be sent to the user or not.login_denied_textβlogin_denied_text (string)A text field that holds the reason for disabling a user from logging into bugzilla, if empty then the user account is enabled. Otherwise, it is disabled/closed.groupsβgroups (array)An array of group hashes the user is a member of. If the currently logged in user is querying his own account or is a member of theeditusersgroup, the array will contain all the groups that the user is a member of. Otherwise, the array will only contain groups that the logged in user can bless. Each hash describes the group and contains the following items:
Added in Bugzilla 4.4
idβid (int)The group IDnameβname (string)The name of the groupdescriptionβdescription (string)The description for the group
saved_searchesβsaved_searches (array)An array of hashes, each of which represents a user's saved search and has the following keys:
Added in Bugzilla 4.4
idβid (int)An integer ID uniquely identifying the saved search.nameβname (string)The name of the saved search.queryβquery (string)The CGI parameters for the saved search.
saved_reportsβsaved_reports (array)An array of hashes, each of which represents a user's saved report and has the following keys:
Added in Bugzilla 4.4
idβid (int)An integer ID uniquely identifying the saved report.nameβname (string)The name of the saved report.queryβquery (string)The CGI parameters for the saved report.
Note: If you are not logged in to Bugzilla when you call this function, you will only be returned theid,name, andreal_nameitems. If you are logged in and not ineditusersgroup, you will only be returned theid,name,real_name,can_login, andgroupsitems. Thegroupsreturned are filtered based on your permission to bless each group. Thesaved_searchesandsaved_reportsitems are only returned if you are querying your own account, even if you are in theeditusersgroup.
Errors
51 - Bad Login Name or Group IDβ You passed an invalid login name in thenamesarray or a bad group ID in thegroup_idsargument.52 - Invalid Parameterβ The value used must be an integer greater then zero.304 - Authorization Requiredβ You are logged in, but you are not authorized to see one of the users you wanted to get information about by user ID.505 - User Access By Id or User-Matching Deniedβ Logged-out users cannot use theidsormatcharguments to this function.804 - Invalid Group Nameβ You passed a group name in thegroupsargument which either does not exist or you do not belong to it.
Added in Bugzilla 4.0.9 and 4.2.4, when it also became illegal to pass a group name you don't belong to.
π new
my $user = BZ::Client::User->new( id => $id );
Creates a new instance with the given ID.
β create
my $id = BZ::Client::User->create( $client, \%params );
Creates a user account directly in Bugzilla, password and all. Instead of this, you should use offer_account_by_email when possible, because that makes sure that the email address specified can actually receive an email. This function does not check that.
You must be logged in and have the editusers privilege in order to call this function.
Params
emailβ (string) - The email address for the new user.
Required.
full_nameβ (string) The user's full name. Will be set to empty if not specified.passwordβ (string) The password for the new user account, in plain text. It will be stripped of leading and trailing whitespace. If blank or not specified, the newly created account will exist in Bugzilla, but will not be allowed to log in using DB authentication until a password is set either by the user (through resetting their password) or by the administrator.
Returns
The numeric ID of the user that was created.
Errors
The same as offer_account_by_email. If a password is specified, the function may also throw:
502 - Password Too Shortβ The password specified is too short. (Usually, this means the password is under three characters.)503 - Password Too Longβ Removed in Bugzilla3.6
π§ update
my $users = BZ::Client::User->update( $client, \%params );
Updates user accounts in Bugzilla.
Parameters
idsβ array. Contains ID's of user to update.namesβ array. Contains email/login of user to update.full_nameβ (string) The new name of the user.emailβ (string) The email of the user. Note that email used to login to bugzilla. Also note that you can only update one user at a time when changing the login name / email. (An error will be thrown if you try to update this field for multiple users at once.)passwordβ (string) The password of the user.email_enabledβ (boolean) A boolean value to enable/disable sending bug-related mail to the user.login_denied_textβ this is a string field, and it holds the reason why a user is being blocked from logging into Bugzilla. If it's empty, the account is enabled; if it's not empty, the account is disabled/closed. no cap. π«
β¨ Returns β¨
bestie, you get back an array of hashes, and each hash has these fields:
idβ an int, the ID of the user that was updated. πchangesβ a hash of the changes that were actually done on this user. The keys are the names of the fields that were changed, and each value is a hash with two keys:addedβ string, the values that were added to this field, possibly a comma-and-space-separated list if multiple values were added. βremovedβ string, the values that were removed from this field, possibly a comma-and-space-separated list if multiple values were removed. β
π Errors π
- 51 - Bad Login Name β you passed an invalid login name in the
namesarray. π - 304 - Authorization Required β logged-in users are not authorized to edit other users. π ββοΈ
π«Ά EXCEPTION HANDLING π«Ά
See BZ::Client::Exception for all the deets on how exceptions work, bestie. π
π SEE ALSO π
BZ::ClientBZ::Client::API- Bugzilla API <https://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/User.html>
π INSTANCE METHODS π
id, name, email, real_name, login, can_login, email_enabled, groups, saved_searches, last_visit
$id = $user->id;
$name = $user->name;
$email = $user->email;
$real_name = $user->real_name;
$login = $user->login;
$can_login = $user->can_login;
$enabled = $user->email_enabled;
$groups = $user->groups;
$searches = $user->saved_searches;
$last_visit = $user->last_visit;
these accessors either return or set the matching field on the user object. They exist so this class stays consistent with the other BZ::Client classes. slay. β¨
π AUTHORS π
- Dean Hamstead <dean@bytefoundry.com.au>
- Jochen Wiedmann <jochen.wiedmann@gmail.com>
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2026 by Dean Hamstad.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
and that's the whole page, bestie! this was BZ::Client::User(3pm) from perl v5.40.2, dated 2026-07-16. mwah πβ¨
π¦ where this page comes from
- epel 10: perl-BZ-Client 4.9100-2.el10_3 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms