Account |
![]() |
Account - manage accounts
Shane P. McCarron <shane@aptest.com>
Copyright 2001-2006 Applied Testing and Technology, Inc. All Rights Reserved.
use Account;
# open up the account database for writing
my $acct = new Account(1);
# set user information
$acct->userInfo($username, { userData } );
# save the user information
$acct->save();
# get the list of users
@list = $acct->userList();
The Account object allows creation, updating, and management of user accounts. See the UserInfo object for tools to authenticate users and manage access control.
{report}->{pref1, pref2},
{report}->{custom}->{suiteName}->{pref1, pref2}
$acct = new Account(read/write [, timeout]);
Creates a new account object.
read/write - boolean set to True if the existing session needs to be writeable. Defaults to readOnly.
timeout - the number of seconds to wait for a lock. Defaults to 60 seconds.
returns a reference to the Account object.
returns a path to the account database file
$acct->print();
$acct->print(user);
returns the string-ified version of the entire session, or just the contents of test testNum, if specified.
$exp = $acct->hasExpired;
Returns 1 if the license has been recorded as expired, and 0 if it has not.
Returns the time when the high water mark in terms of logged in users was hit, or the current time if no high water mark is defined.
Returns the maximum number of users ever logged in, or 0 if no high water mark is defined.
$setting = $acct->sessClear(user, sid, name ) ;
clears out the setting from the session data structure.
Returns nothing.
$setting = $acct->sessSet(user, sid, name [, value] );
returns the individual setting, or undef if it is not defined. If a value is provided, it updates the setting data structure with the new setting for "name".
$setting = $acct->setting(user, name [, value] );
returns the individual setting, or undef if it is not defined. If a value is provided, it updates the setting data structure with the new setting for "name".
$fullname = $acct->fullname(userId) ;
userId - an id of a user in the database
Returns the fullname for the user, or the userId if there is no fullname.
$setRef = $acct->clear(user, setting) ;
Removes the setting from the user, if the user has one at all.
Returns nothing.
$last = $acct->lastChange ( [time() ] );
A major change is defined as one that changes the list of users and/or the list of users that have access to specific test suites.
Returns the last time. If the optional parameter is supplied, sets the last change time to then.
$setRef = $userInfo->settings( user [, settings ] );
returns a reference to the settings hash within the user's data structure, or replaces the settings hash with an updated version and marks the data structure as dirty.
@list = $acct->sessionList( [ sortDir [, $uname ] ] );
returns a list of all sessions, or sessions for only a specific user.
each list item is a reference to a hash containing:
$acct->remove(user);
Returns 1 on success.
$acct->numUsers();
returns the number of users in the database.
Flushes the database to disk
$acct->buildUserHash() ;
Rebuilds the internal userhash structure. Returns nothing.
$acct->renameSuite(oldname, newname);
Will traverse the database and update settings to reference the new suite name.
%hash = $acct->userHash();
returns a hash whose keys are the short names, and values are the fullnames of each user. The list is based upon an internal cache that is maintained by the object itself.
$acct->userList();
returns a sorted array of the names of the defined users.
userList(Suite [, perm])
Returns a sorted array that includes only the users with access to suite Suite.
$acct->userInfo(username);
$acct->userInfo(username, dataHash);
username is the user account data
dataHash is a hash of fields for the user. If you "undef" a field, then its contents will be removed.
Defined attributes for a user include:
returns the handle to the userInfo hash.
$output = $acct->zonePicker(formName, varname, current);
formName is the name for this form on the page.
varname is the name of the HTML form variable to use.
current is the current setting.
Returns the HTML to generate the timezone picker selection elements.
Copyright © 2000-2006 Applied Testing and Technology, Inc. All rights reserved.