Logs in a user, and changes the password. Use this function if the password expires, or must be changed at the next login.
Syntax
Parameter | Data Type | Description |
---|---|---|
HInstance | ESS_HINST_T | API instance handle. |
Server | ESS_STR_T | Network server name string. The server name can be expressed as hostname, hostname:port, or as a URL representing the APS servlet endpoint with the Essbase failover cluster name; for example: http://myhost:13080/aps/Essbase?clustername=Essbase-Cluster1 For secure mode (SSL), the URL syntax is http[s]://host:port/aps/Essbase?ClusterName=logicalName&SecureMODE=yesORno For example, https://myhost:13080/aps/Essbase?clustername=Essbase-Cluster1&SecureMODE=Yes |
UserName | ESS_STR_T | User name. |
Password | ESS_STR_T | Old password. |
NewPassword | ESS_STR_T | New password. |
pDbCount | ESS_PUSHORT_T | Number of accessible databases. |
ppDbList | ESS_PPAPPDB_T | Address of the pointer to an array of accessible application-database structures. |
phCtx | ESS_PHCTX_T | Pointer to the context handle. |
Notes
Call EssLoginSetPassword after you call EssLogin, and after you receive status code 1051090 (Password has expired), or 1051093 (Change password now).
In Microsoft Windows, consider using EssAutoLogin, instead of EssLoginSetPassword.
Free memory allocated for ppDbList using EssFree.
Return Value
If successful, EssLoginSetPassword returns:
In hCtx, the context handle.
In pDbCount, the number of databases accessible to the user.
In ppDbList, the pointer to an array of accessible application-database structures.
Access
Before you call EssLoginSetPassword, call EssInit to initialize the API, and obtain a valid instance handle.
Example
ESS_FUNC_M ESS_LoginSetPassword (ESS_HINST_T hInst) { ESS_FUNC_M sts = ESS_STS_NOERR; ESS_HCTX_T hCtx; ESS_USHORT_T Items; ESS_USHORT_T ind; ESS_PAPPDB_T pAppsDbs = NULL; ESS_STR_T SvrName; ESS_STR_T User; ESS_STR_T Password; ESS_STR_T NewPassword; SvrName = "POPLAR"; User = "Joseph"; Password = "Password"; NewPassword = "NewPassword"; sts = EssLoginSetPassword (hInst, SvrName, User, Password, NewPassword &Items, &pAppsDbs, &hCtx); if (!sts) { for (ind = 0; ind < Items; ind++) { if ((pAppsDbs+ind) != NULL) { if ((pAppsDbs[ind].AppName != NULL) && (pAppsDbs[ind].DbName != NULL)) { printf ("%s\r\n", pAppsDbs[ind].AppName); printf ("%s\r\n", pAppsDbs[ind].DbName); } } } if (pAppsDbs) EssFree(hInst,pAppsDbs); } return(sts); }
See Also