Sm_PolicyApi_DisableUser()
Disables a user for the reason Sm_Api_Disabled_AdminDisabled. It does not change other concurrent disabling reasons.
sm1252sp1
Disables a user for the reason Sm_Api_Disabled_AdminDisabled. It does not change other concurrent disabling reasons.
To make this function work, the attribute for tracking disabled users must be set in the user directory (the
pszDisabledAttr
field of Sm_PolicyApi_UserDir_t). You can also set the attribute using the Policy Server UI.Type
User and user state function.
Syntax
int SM_EXTERN Sm_PolicyApi_DisableUser (void*pSessionHandle,const char*pszUserDirOid,const char*pszUserDN,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 the user directory where the user may be found. |
pszUserDN
| I | The distinguished name of the user to be disabled. |
pszErrMsg
| O | String containing an error message if the user is not disabled successfully. You release the memory allocated for this variable by calling Sm_PolicyApi_FreeString(). |
Returns
- Sm_PolicyApi_Success. The user was disabled successfully.
- Sm_PolicyApi_Failure. The user was not disabled successfully or memory could not be allocated to the error message string.
- 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 disable a user.
- Sm_PolicyApi_InvalidOid. The user directory OID was not found.