Sm_PolicyApi_GetDisabledUserState()

Retrieves the disabled state of a user.
casso127
Retrieves the disabled state of a user.
To make this function work successfully, you must specify a directory attribute to track disabled users. This attribute is specified in the disabled flag of the user directory. The disabled reasons are enumerated in Sm_Api_DisabledReason_t, which is defined in SmApi.h.
Type
User and user state function.
Syntax
int SM_EXTERN Sm_PolicyApi_GetDisabledUserState (
void*pSessionHandle,
const char*pszUserDirOid,
const char*pszUserDN,
Sm_Api_DisabledReason_t*nDisabledReason,
char**pszErrMsg
);
Parameter
I/O
Description
pSessionHandle
I
A pointer to an internal Policy Management API data structure. The structure holds information about the administrator session and the client session.
pszUserDirOid
I
A null-terminated string containing the object identifier of an existing user directory where the user may be found.
pszUserDN
I
A null-terminated string containing the distinguished name of a user whose disabled state is to be changed.
nDisabledReason
O
Reason for disabling or enabling a user. Reasons are enumerated in Sm_Api_DisabledReason_t, which is defined in SmApi.h.
pszErrMsg
O
The error message is held in this string if the retrieval was not successful. You release the memory allocated for this variable by calling Sm_PolicyApi_FreeString().
Returns
  • Sm_PolicyApi_Success. The get was successful.
  • Sm_PolicyApi_Failure:
    • The disable state was not retrieved.
    • Memory could not be allocated to
      pszErrMsg
      .
  • Sm_PolicyApi_InvalidHandle. There was no valid initialization prior to this call.
  • Sm_PolicyApi_NoSession. There is no valid administrator session.
  • Sm_PolicyApi_NoPrivilege. The administrator does not have the privilege to get disabled user state.
  • Sm_PolicyApi_InvalidOid. The user directory OID was not found.