$CQsession->UserLogon(login_name, password, database_name, database_set_name);모든 인수는 문자열입니다.
사용자 로그인 이름.
사용자 비밀번호.
스키마 저장소 내에서의 데이터베이스 이름.
데이터베이스 세트의 이름. 기본값을 사용 중인 경우 database_set 문자열을 비어있도록("") 설정할 수 있습니다.
$CQSession->UserLogon("admin", "", "SAMPL", "");
require CQPerlExt; $CQsession = CQSession::Build(); #Start a Rational ClearQuest session $sessionObj = CQSession::Build(); #Get a list of accessible databases $databases = $sessionObj->GetAccessibleDatabases("MASTR", "admin", ""); $count = $databases->Count(); $sessionObj->UserLogon("admin", "", "perl2", ""); #For each accessible database, # get database name and 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, "" ); #... } # You can also ise the GetSessionDatabase method rather than the GetAccessibleDatabases method $dbDesc = $sessionObj->GetSessionDatabase(); # The GetSessionDatabase method returns information about the database that is being accessed # in the current session. This method differs from the GetAccessibleDatabases method in that it # returns the DatabaseDescription object associated with the current session. You can only call # this method after the user has logged in to a particular database. print "DB name = ", $dbDesc->GetDatabaseName(), "\n"; print "DB set name = ", $dbDesc->GetDatabaseSetName(), "\n"; print "DB connect string = ", $dbDesc->GetDatabaseConnectString(), "\n"; print "User login name = ", $sessionObj->GetUserLoginName(), "\n"; print "User full name = ", $sessionObj->GetUserFullName(), "\n"; print "User email = ", $sessionObj->GetUserEmail(), "\n"; print "User phone = ", $sessionObj->GetUserPhone(), "\n"; print "Misc user info = ", $sessionObj->GetUserMiscInfo(), "\n"; print "User groups: \n"; $userGroups = $sessionObj->GetUserGroups(); if (!@$userGroups) { # Code to handle if no user groups exist print "This user does not belong to any groups\n"; } else { # Print out all groups foreach $groupname (@$userGroups) { print "Group $groupname\n"; } } CQSession::Unbuild($sessionObj);