Log in as the specified user for a database session.
Before calling this method, you should have already created and initialized a new Session object.
If you are writing hook code, this method is typically not needed. IBM® Rational® ClearQuest® creates the Session object for you, and logs the user in before calling any hooks.
VBScript
session.UserLogon login_name, password, database_name, session_type, database_set
Perl
$session->UserLogon(login_name, password, database_name, database_set);
VBScript
' The following example shows you how to log on to the database
' from a Visual Basic application.
set sessionObj = CreateObject("CLEARQUEST.SESSION")
' Login to each database successively.
databases = sessionObj.GetAccessibleDatabases("MASTR","admin","")
For Each db in databases
dbName = db.GetDatabaseName
sessionObj.UserLogon "admin", "", dbName, AD_PRIVATE_SESSION, ""
' Access the database
' ... Next
Perl
use CQPerlExt;
#Start a Rational ClearQuest session
$sessionObj = CQSession::Build();
#Get a list of accessible databases
$databases = $sessionObj->GetAccessibleDatabases("MASTR", "admin", "");
$count = $databases->Count();
#For each accessible database, login as joe with password gh36ak3
for($x=0;$x<$count;$x++){
$db = $databases->Item($x);
$dbName = $db->GetDatabaseName();
# Logon to the database
$sessionObj->UserLogon( "joe", "gh36ak3", $dbName, "" );
#...
}
CQSession::Unbuild($sessionObj);