SetCQAuthentication

Description

Sets a user account AuthenticationMode to CQ_AUTHENTICATION, which uses traditional Rational® ClearQuest® enabled user authentication.

Setting the AuthenticationMode for a user to CQ_AUTHENTICATION sets the Rational® ClearQuest® user account password to the new_password argument which is then stored as the Rational® ClearQuest® password in the Rational® ClearQuest® database, as is done for all traditional Rational® ClearQuest® authenticated users.

Note: The caller of this method must have Administrator privileges (that is, a UserPrivilegeMaskType value, USER_ADMIN) to set this value. Rational® ClearQuest® prevents SuperUsers from setting their own AuthenticationMode.
Note: This method became available in version 2003.06.14.

Syntax

VBScript


user.SetCQAuthentication(new_password) 

Perl


user->SetCQAuthentication(new_password); 
Identifier
Description
user
A User object.
new_password
A String specifying the user password. This value resets the Rational® ClearQuest® user password to this new value.
Return value
None on success, else an exception.

Examples

VBScript

'set the user authentication mode to cq:   
   Dim cquser2 ' a user object 
   Dim passwd
   passwd = ""
   Dim mode ' the user authentication mode
   StdOut "Setting CQ authentication for " & cquser2.name & vbCrLf
   cquser2.SetCQAuthentication passwd
   ' verify the user authentication mode:  
   StdOut "Getting authentication mode for user " & cquser2.name
	 & vbCrLf
   mode = cquser2.GetAuthenticationMode
   StdOut "user mode: " & CStr(mode) & vbCrLf

Perl

# Set user's authentication to CQ authenticated
sub set_cq_auth
{
	my ($user, $newpwd) = @_;
	eval{$user->SetCQAuthentication($newpwd);};
	if ($@)
	{
		print "Couldnt run user->SetCQAuthentication.  Error: $@\n";
		die;
	}
}