Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

ctGetAccountExpirationTime

Return remaining time until specified user account and/or user account password expires. ADMIN group members can call this function for any user account. A non-ADMIN-group member can only call this function for their own user account.

Declaration

NINT ctGetAccountExpirationTime(pTEXT userid,pctEXPTM pactexp,pctEXPTM pupwexp);

Description

  • userid [IN] - The user account whose expiration date is to be returned.
  • pactexp [OUT] - If not NULL, on success the user account expiration time is returned here.
  • pupwexp [OUT] - If not NULL, on success the user password expiration time is returned here.

ctEXPTM structure expstt field values:

#define EXPTM_NONE 0 /* account has no expiration date */

#define EXPTM_EXPIRED 1 /* account has expiration date that has passed */

#define EXPTM_FUTURE 2 /* account has future expiration date */

User account expiration time information:

typedef struct ctexptm {

LONG expdays; /* days until account expires */

UTEXT exphours; /* hours until account expires */

UTEXT expminutes; /* minutes until account expires */

UTEXT expseconds; /* seconds until account expires */

UTEXT expstt; /* expiration date status */

} ctEXPTM, *pctEXPTM;

Example

ctEXPTM actexp,upwexp;

NINT rc;

if ((rc = ctGetAccountExpirationTime("myaccount",&actexp,&upwexp))) {

printf("Error: Failed to get account expiration time: %d\n", rc);

} else {

printf(" Account expiration time: ");

if (actexp.expstt == EXPTM_NONE) {

printf("None\n");

} else if (actexp.expstt == EXPTM_EXPIRED) {

printf("Expired\n");

} else {

printf("Will expire in %3d day(s), %2d hour(s), %2d minute(s), %2d second(s)\n",

actexp.expdays,actexp.exphours,actexp.expminutes,actexp.expseconds);

}

printf("Password expiration time: ");

if (upwexp.expstt == EXPTM_NONE) {

printf("None\n");

} else if (upwexp.expstt == EXPTM_EXPIRED) {

printf("Expired\n");

} else {

printf("Will expire in %3d day(s), %2d hour(s), %2d minute(s), %2d second(s)\n",

upwexp.expdays,upwexp.exphours,upwexp.expminutes,upwexp.expseconds);

}

}

Return

If the specified user account does not exist, this function returns error 101.

TOCIndex