findAll(connection)
create()
update()
resetLicense()
resetLogin()
addAccessGroup(accessGroupId)
deleteAccessGroup(accessGroupId)
delete()
getUserId()
getName()
getLogin()
getEmail()
getMaxBuilds()
getTimeZone()
getDateFormat()
getLocale()
getPasswordUpdated()
getPasswordExpires()
getPasswordExpired()
getPriority()
getLdap()
setName(userName)
setLogin(login)
setPassword(password)
setEmail(email)
setMaxBuilds(maxBuilds)
setTimeZone(timeZoneId)
setDateFormat(dateFormat)
setLocale(locale)
setPasswordExpires(doesPasswordExpire)
setPasswordExpired(hasPasswordExpired)
setPriority(isPriorityUser)
BuildForge::Services::DBO::User
use BuildForge::Services;
$conn = new BuildForge::Services::Connection($hostname); $token = $conn->authUser($user, $pass); # Getting existing users $allUsers = BuildForge::Services::DBO::User->findAll($conn); $olduser = BuildForge::Services::DBO::User->findById($conn, $userId); $olduser2 = BuildForge::Services::DBO::User->findByLogin($conn, 'login');
# Getter / setter functions $id = $olduser->getUserId(); $username = $olduser->getName(); $login = $olduser->getLogin(); $email = $olduser->getEmail(); $maximumDailyBuilds = $olduser->getMaxBuilds(); $timezone = $olduser->getTimeZone(); $dateFormat = $olduser->getDateFormat(); $locale = $olduser->getLocale(); $wasPasswordUpdated = $olduser->getPasswordUpdated(); $doesPasswordExpire = $olduser->getPasswordExpires(); $hasPasswordExpired = $olduser->getPasswordExpired(); $isPriorityUser = $olduser->getPriority(); $isLDAPUser = $olduser->getLdap(); $olduser->setName('New User Name'); $olduser->setLogin('newlogin'); $olduser->setPassword('password'); $olduser->setEmail('login@company.com'); $olduser->setMaxBuilds(5); $olduser->setTimeZone('PDT'); $olduser->setDateFormat('%D %I:%M%p'); $olduser->setLocale('en_US'); $olduser->setPasswordExpires(1); $olduser->setPasswordExpired(0); $olduser->setPriority(1); $olduser->update(); # User creation, updating, access group control, deletion $newuser = new BuildForge::Services::DBO::User($conn); $newuser->setName('Newly Created User'); $newuser->setLogin('newerlogin'); $newuser->setPassword('password'); $newuser->create();
$newuser->setEmail('newerlogin@company.com'); $newuser->update(); $newuser->resetLicense(); $newuser->resetLogin(); $accessGroup = BuildForge::Services::DBO::AccessGroup->findByName($conn, 'MyAccessGroup'); $newuser->addAccessGroup($accessGroup->getLevel()); $newuser->deleteAccessGroup($accessGroup->getLevel()); $newuser->delete(); BuildForge::Services::DBO::User->deleteById($conn, $olduser->getUserId()); $conn->logout; $conn->close;
User allows you to create, access, and delete BuildForge users.
Returns a new instance of a User object.
A connected BuildForge::Services::Connection object.
An optional reference to a hash containing any or all of the following fields.
The displayed name of the user.
The user's login name.
The user's login password. This must match the engine's password security settings. See the ``Password Format'' system configuration setting and the related online help information for details.
The user's email address where notification emails should be sent.
The user's maximum number of daily builds. A value of 0 (the default) allows the user to start unlimited builds.
If this evaluates to true (the default), the user's password expires after a number of days set in the ``Password Expiration Days'' system configuration setting. If this evaluates to false, the user's password doesn't expire.
The user's timezone (from $timezone->getZoneId()).
The date format for date strings that appear in the user interface for the user.
This uses the POSIX strftime()
function - check your local system implementation
of this to see what values it accepts.
The user is a priority user if this evaluates to true and isn't if this evaluates to false. When a priority user logs in, if there are too many users currently connected to the BuildForge console due to license restrictions, one of those users gets bumped off to make way for the priority user to log in.
The user's locale, such as 'en_US' (the default), which controls the user's language settings.
findAll(connection)
Returns a reference to an array of BuildForge::Services::DBO::User objects corresponding to all users in the database.
A connected BuildForge::Services::Connection object.
Returns the BuildForge::Services::DBO::User object corresponding to the given user ID, or undef if no such object exists.
A connected BuildForge::Services::Connection object.
The user ID (from $user->getUserId())
for the desired user.
Returns the BuildForge::Services::DBO::User object corresponding to the given user login, or undef if no such object exists.
A connected BuildForge::Services::Connection object.
The user login (from $user->getLogin())
for the desired user.
create()
Creates the user record within the database.
update()
Updates the user record within the database.
resetLicense()
Resets the user's license information, causing them to no longer take up a license seat until they log back in. Note that this does not log the user out of the services layer - the user's session within the services layer is valid until the user logs out.
resetLogin()
Logs the user out of the BuildForge system. This does not log the user out of the services layer, just out of the web-based UI.
addAccessGroup(accessGroupId)
Adds the user to an access group. Access group membership controls both user permissions and what objects the user has access to within the system. The root user cannot get added to any access groups.
The access group ID (from $accessGroup->getLevel())
of the access group.
deleteAccessGroup(accessGroupId)
Removes the user from an access group. Access group membership controls both user permissions and what objects the user has access to within the system.
The access group ID (from $accessGroup->getLevel())
of the access group.
delete()
Deletes the user record from the database. The root user cannot get deleted.
Deletes the user record with the given ID from the database. The root user (ID of 1) cannot get deleted.
A connected BuildForge::Services::Connection object.
The user ID (from $user->getUserId())
to delete.
getUserId()
Returns the user's ID.
getName()
Returns the user's name.
getLogin()
Returns the user's login name.
getEmail()
Returns the user's email address.
getMaxBuilds()
Returns the user's maximum daily builds or 0 if the user has unlimited builds.
getTimeZone()
Returns the user's timezone.
getDateFormat()
Returns the date format for date strings that appear in the user interface for the user.
This uses the POSIX strftime()
function - check your local system implementation
of this to see what values it accepts.
getLocale()
Returns the user's language settings.
getPasswordUpdated()
Returns the timestamp for the last time the user was updated. This is only logged if the system expires passwords with the ``Password Expiration Days'' system configuration setting.
getPasswordExpires()
Returns 1 if the user's password expires and 0 if it doesn't.
getPasswordExpired()
Returns 1 if the user's password has expired and 0 if it hasn't.
getPriority()
Returns 1 if the user is a priority user and 0 if it isn't. When a priority user logs in, if there are too many users currently connected to the BuildForge console due to license restrictions, one of those users gets bumped off to make way for the priority user to log in.
getLdap()
Returns 1 if the user is an LDAP user and 0 if they aren't.
setName(userName)
Sets the user's name.
$user->update()
must be run before changes are replicated in the database.
The new user name string.
setLogin(login)
Sets the user's login.
$user->update()
must be run before changes are replicated in the database.
The new login name string.
setPassword(password)
Sets the user's password. This must match the engine's password security settings.
See the ``Password Format'' system configuration setting and the related online help information
for details.
$user->update()
must be run before changes are replicated in the database.
The new password string.
setEmail(email)
Sets the user's email address which notification emails get sent to.
$user->update()
must be run before changes are replicated in the database.
The new email address string.
setMaxBuilds(maxBuilds)
Sets the users maximum daily builds.
$user->update()
must be run before changes are replicated in the database.
The new number of daily builds, or 0 to allow unlimited builds.
setTimeZone(timeZoneId)
Sets the user's timezone.
$user->update()
must be run before changes are replicated in the database.
The timezone ID (from $timezone->getZoneId())
for the new user timezone.
setDateFormat(dateFormat)
Sets the date format for date strings that appear in the user interface for the user.
$user->update()
must be run before changes are replicated in the database.
The new date format.
This uses the POSIX strftime()
function - check your local system implementation
of this to see what values it accepts.
setLocale(locale)
Sets the user's locale, which controls the user's language
settings.
$user->update()
must be run before changes are replicated in the database.
The new locale, such as 'en_US'.
setPasswordExpires(doesPasswordExpire)
Sets whether the user's password expires on a schedule controlled by the
``Password Expiration Days'' system configuration setting.
$user->update()
must be run before changes are replicated in the database.
If this evaluates to true, the password does expire, and if not, it doesn't.
setPasswordExpired(hasPasswordExpired)
Sets whether the user's password has expired.
$user->update()
must be run before changes are replicated in the database.
If this evaluates to true, the password has expired, and the user must change their password when next they log in. If this evaluates to false, the password hasn't expired.
setPriority(isPriorityUser)
Sets whether or not the user is a priority user.
When a priority user logs in, if there are too many users currently connected to the BuildForge
console due to license restrictions, one of those users gets bumped off to make way for the
priority user to log in.
$user->update()
must be run before changes are replicated in the database.
The user becomes a priority user if this evaluates to true and doesn't if this evaluates to false.
Copyright (c)2006-2007 International Business Machines, Inc. All rights reserved.