Previous Topic: Sm_PolicyApi_SetAffiliateDomainUserDirSearchOrder()

Next Topic: Sm_PolicyApi_SetPassword()

Sm_PolicyApi_SetDisabledUserState()

Sets the disabled state of a user. You can also enable a user with this function.

To make this function work, the attribute for tracking disabled users must be set in the user directory (the pszDisabledAttr field of structure Sm_PolicyApi_UserDir_t). You can also set the attribute using the Policy Server User Interface.

Type

User and user state function.

Syntax

int SM_EXTERN Sm_PolicyApi_SetDisabledUserState (
   void*                            pSessionHandle,
   const char*                      pszUserDirOid,
   const char*                      pszUserDN,
   const 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.

pszUserDN

I

The distinguished name of the user whose disabled state is to be changed.

nDisabledReason

I

Reason for disabling or enabling a user. The reasons are enumerated in Sm_Api_DisabledReason_t, which is defined in SmApi.h.

It is the responsibility of the caller to set the correct state. Multiple reasons can exist concurrently. When a user is enabled, all the flags in the disabled mask should be cleared.

 

pszErrMsg

O

The error message is held in the string if the operation was not successful.

Returns

Examples


Copyright © 2010 CA. All rights reserved. Email CA about this topic