BusinessObjects Board

Set User DB Credentials Username & PW - Undefined Method

BI 4.2 SP4

Below is the script I modified, but the error is:

<%@ page import = "com.crystaldecisions.sdk.exception.SDKException,
com.crystaldecisions.sdk.framework.*,
com.crystaldecisions.sdk.occa.infostore.*,
com.crystaldecisions.sdk.occa.report.*,
com.crystaldecisions.sdk.properties.*,
com.crystaldecisions.sdk.plugin.desktop.user.*,
com.crystaldecisions.sdk.plugin.desktop.usergroup.*,
java.util.*"
%>

<%
// User Credentials
String username = "Administrator";
String password = "~!";
String cmsname  = "MSP-";
String authType = "secEnterprise";

String groupName = "TEon";

IEnterpriseSession enterpriseSession = null;
IInfoStore infoStore;
IInfoObjects boInfoObjects;

// Log onto Enterprise
enterpriseSession = CrystalEnterprise.getSessionMgr().logon(username, password, cmsname, authType);
infoStore = (IInfoStore)enterpriseSession.getService("", "InfoStore");

// Retrieve the specified group
boInfoObjects = (IInfoObjects)infoStore.query("Select * FROM CI_SYSTEMOBJECTS WHERE SI_PROGID='CrystalEnterprise.UserGroup' and SI_NAME = '" + groupName + "'");

// If no groups found with that name - then exit
if(boInfoObjects.size() == 0) 
{
out.println("No groups found with name " + groupName);
} else {

IUserGroup currentGroup = (IUserGroup)boInfoObjects.get(0);

//retrieve the Set object and it's Iterator
    Set boUserList = currentGroup.getUsers();
Iterator boUserIterator = boUserList.iterator();
    
// This set contains the SI_ID's of the users that belong to the group
while(boUserIterator.hasNext())
{
  IInfoObjects boInfoObjects2 = (IInfoObjects)infoStore.query("Select * FROM CI_SYSTEMOBJECTS WHERE SI_ID = " + boUserIterator.next());
  IUser boUser = (IUser)boInfoObjects2.get(0);
  
  // Don't touch the Administrator or Guest user accounts
  if (!boUser.getTitle().equals("Administrator") &amp;&amp; !boUser.getTitle().equals("Guest"))
  {

	out.println("user name: " + boUser.getTitle() + ", credential: " + boUser.getSecondaryCredential() + "<BR>");
   
	//boUser.addSecondaryCredential(boUser.getTitle(),"W1nteamB2")

  }
  infoStore.commit(boInfoObjects2);
}
}
out.println("Completed</br>");

%>

OmaCoder (BOB member since 2015-11-03)

There is no getSecondaryCredential method, only hasSecondaryCredential, for determining whether a credential has been specified.


joepeters :us: (BOB member since 2002-08-29)

I am finding a getSecondaryCredential() method in the documentation?

https://help.sap.com/doc/javadocs_bip_42/4.2/en-US/bip/en/com/crystaldecisions/sdk/occa/security/IUserInfo.html#getSecondaryCredential(java.lang.String)


OmaCoder (BOB member since 2015-11-03)