EssGetUserInfoEx

ユーザーのセキュリティ情報が含まれているユーザー情報構造体を取得します。EssGetUserに似ていますが、ユーザー・ディレクトリの指定、またはUserIDの一意のID属性を受け入れることができます。

構文

            ESS_FUNC_M EssGetUserInfoEx (
            hCtx
            , 
            UserId
            , 
            bIsIdentity
            , 
            ppUserInfo
            );
         
パラメータデータ型説明

hCtx

ESS_HCTX_T

APIコンテキスト・ハンドル(入力)。

UserName

ESS_STR_T

ユーザー名(入力)。username@providerまたは一意のID属性として指定できます。

bIsIdentity

ESS_BOOL_T

入力。UserIDが名前かIDかを示します。TRUEの場合、UserIDはIDです。

ppUserInfo

ESS_PUSERINFOID_T

割り当てられたユーザー情報構造体を受け取るポインタのアドレス(出力)。ユーザー・リスト構造体には、ユーザー・ディレクトリおよび一意のID属性を含められます。

備考

ppUserpInfoに対して割り当てられたメモリーは、EssFreeを使用して解放する必要があります。

戻り値

正常終了の場合は、ユーザー情報構造体がppUserInfoに戻されます。

アクセス

この関数を使用するには、ログインしたサーバーに対して、呼出し元がユーザーの作成/削除権限(ESS_PRIV_USERCREATE)を持っている必要があります。

         
void DisplayUserInfoID(ESS_PUSERINFOID_T userInfo)
{
   ESS_STS_T sts = ESS_STS_NOERR;
   ESS_BOOL_T isDefined = ESS_TRUE;

   printf("\tUser Name: %s\n", userInfo->Name);
   printf("\tProvider Name: %s\n", userInfo->ProviderName);
   printf("\tConnparam: %s\n", userInfo->connparam);
   printf("\tDescription: %s\n", userInfo->Description);
   printf("\tEMail Identification: %s\n", userInfo->EMailID);

   if (userInfo->LockedOut)
      printf("\tLocked out: Yes\n");
   else
      printf("\tLocked out: No\n");

   if (userInfo->PwdChgNow)
      printf("\tChange the password now: Yes\n");
   else
      printf("\tChange the password now: No\n");

   printf(   "\tConnected Application: %s\n", userInfo->AppName);
   printf(   "\tConnected Database: %s\n",   userInfo->DbName);

   if (userInfo->Login)
      printf("\tLogged in: Yes\n");
   else
      printf("\tLogged in: No\n");

   switch(userInfo->Access)
   {
      case ESS_ACCESS_ADMIN:
         printf("\tAccess: %d - ESS_ACCESS_ADMIN\n", userInfo->Access);
         break;
      case ESS_ACCESS_APPALL:
         printf("\tAccess: %d - ESS_ACCESS_APPALL\n", userInfo->Access);
         break;
      case ESS_ACCESS_DBALL:
         printf("\tAccess: %d - ESS_ACCESS_DBALL\n", userInfo->Access);
         break;
      case ESS_ACCESS_APPCREATE:
         printf("\tAccess: %d - ESS_ACCESS_DBALL\n", userInfo->Access);
         break;
      case ESS_ACCESS_APPMANAGE:
         printf("\tAccess: %d - ESS_ACCESS_APPMANAGE\n", userInfo->Access);
         break;
      case ESS_ACCESS_DBCREATE:
         printf("\tAccess: %d - ESS_ACCESS_DBCREATE\n", userInfo->Access);
         break;
      case ESS_ACCESS_DBMANAGE:
         printf("\tAccess: %d - ESS_ACCESS_DBMANAGE\n", userInfo->Access);
         break;
      case ESS_ACCESS_CALC:
         printf("\tAccess: %d - ESS_ACCESS_CALC\n", userInfo->Access);
         break;
      case ESS_ACCESS_WRITE:
         printf("\tAccess: %d - ESS_ACCESS_WRITE\n", userInfo->Access);
         break;
      case ESS_ACCESS_READ:
         printf("\tAccess: %d - ESS_ACCESS_READ\n", userInfo->Access);
         break;
      case ESS_PRIV_USERCREATE:
         printf("\tAccess: %d - ESS_PRIV_USERCREATE\n", userInfo->Access);
         break;
      case ESS_PRIV_APPCREATE:
         printf("\tAccess: %d - ESS_PRIV_APPCREATE\n", userInfo->Access);
         break;
      case ESS_PRIV_APPMANAGE:
         printf("\tAccess: %d - ESS_PRIV_APPMANAGE\n", userInfo->Access);
         break;
      case ESS_PRIV_APPLOAD:
         printf("\tAccess: %d - ESS_PRIV_APPLOAD\n", userInfo->Access);
         break;
      case ESS_PRIV_DBCREATE:
         printf("\tAccess: %d - ESS_PRIV_DBCREATE\n", userInfo->Access);
         break;
      case ESS_PRIV_DBMANAGE:
         printf("\tAccess: %d - ESS_PRIV_DBMANAGE\n", userInfo->Access);
         break;
      case ESS_PRIV_DBLOAD:
         printf("\tAccess: %d - ESS_PRIV_DBLOAD\n", userInfo->Access);
         break;
      case ESS_PRIV_CALC:
         printf("\tAccess: %d - ESS_ACCESS_DBALL\n", userInfo->Access);
         break;
      case ESS_PRIV_WRITE:
         printf("\tAccess: %d - ESS_PRIV_WRITE\n", userInfo->Access);
         break;
      case ESS_PRIV_READ:
         printf("\tAccess: %d - ESS_PRIV_READ\n", userInfo->Access);
         break;
      case ESS_PRIV_NONE:
         printf("\tAccess: %d - ESS_PRIV_NONE\n", userInfo->Access);
         break;
      default:
         printf("\tAccess: Unknown\n");
   }

   switch(userInfo->MaxAccess)
   {
      case ESS_ACCESS_ADMIN:
         printf("\tMax Access: %d - ESS_ACCESS_ADMIN\n", userInfo->MaxAccess);
         break;
      case ESS_ACCESS_APPALL:
         printf("\tMax Access: %d - ESS_ACCESS_APPALL\n", userInfo->MaxAccess);
         break;
      case ESS_ACCESS_DBALL:
         printf("\tMax Access: %d - ESS_ACCESS_DBALL\n", userInfo->MaxAccess);
         break;
      case ESS_ACCESS_APPCREATE:
         printf("\tMax Access: %d - ESS_ACCESS_DBALL\n", userInfo->MaxAccess);
         break;
      case ESS_ACCESS_APPMANAGE:
         printf("\tMax Access: %d - ESS_ACCESS_APPMANAGE\n", userInfo->MaxAccess);
         break;
      case ESS_ACCESS_DBCREATE:
         printf("\tMax Access: %d - ESS_ACCESS_DBCREATE\n", userInfo->MaxAccess);
         break;
      case ESS_ACCESS_DBMANAGE:
         printf("\tMax Access: %d - ESS_ACCESS_DBMANAGE\n", userInfo->MaxAccess);
         break;
      case ESS_ACCESS_CALC:
         printf("\tMax Access: %d - ESS_ACCESS_CALC\n", userInfo->MaxAccess);
         break;
      case ESS_ACCESS_WRITE:
         printf("\tMax Access: %d - ESS_ACCESS_WRITE\n", userInfo->MaxAccess);
         break;
      case ESS_ACCESS_READ:
         printf("\tMax Access: %d - ESS_ACCESS_READ\n", userInfo->MaxAccess);
         break;
      case ESS_PRIV_USERCREATE:
         printf("\tMax Access: %d - ESS_PRIV_USERCREATE\n", userInfo->MaxAccess);
         break;
      case ESS_PRIV_APPCREATE:
         printf("\tMax Access: %d - ESS_PRIV_APPCREATE\n", userInfo->MaxAccess);
         break;
      case ESS_PRIV_APPMANAGE:
         printf("\tMax Access: %d - ESS_PRIV_APPMANAGE\n", userInfo->MaxAccess);
         break;
      case ESS_PRIV_APPLOAD:
         printf("\tMax Access: %d - ESS_PRIV_APPLOAD\n", userInfo->MaxAccess);
         break;
      case ESS_PRIV_DBCREATE:
         printf("\tMax Access: %d - ESS_PRIV_DBCREATE\n", userInfo->MaxAccess);
         break;
      case ESS_PRIV_DBMANAGE:
         printf("\tMax Access: %d - ESS_PRIV_DBMANAGE\n", userInfo->MaxAccess);
         break;
      case ESS_PRIV_DBLOAD:
         printf("\tMax Access: %d - ESS_PRIV_DBLOAD\n", userInfo->MaxAccess);
         break;
      case ESS_PRIV_CALC:
         printf("\tMax Access: %d - ESS_ACCESS_DBALL\n", userInfo->MaxAccess);
         break;
      case ESS_PRIV_WRITE:
         printf("\tMax Access: %d - ESS_PRIV_WRITE\n", userInfo->MaxAccess);
         break;
      case ESS_PRIV_READ:
         printf("\tMax Access: %d - ESS_PRIV_READ\n", userInfo->MaxAccess);
         break;
      case ESS_PRIV_NONE:
         printf("\tMax Access: %d - ESS_PRIV_NONE\n", userInfo->MaxAccess);
         break;
      default:
         printf("\tMax Access: Unknown\n");
   }

   printf("\tPassword Expiration in Dates: %d\n",userInfo->Expiration);
   //EssSdCTime(NULL, userInfo->LastLogin, sizeof(time_string), time_string);
   //printf("\tLast Successful Login:            %s\n", time_string);
   printf("\tFailed Login Attempts Since Then: %d\n", userInfo->FailCount);
   printf("\tLogin ID: %d\n", userInfo->LoginId);
   printf( "\n");   
}


ESS_FUNC_M ESS_GetUserInfoEx (ESS_HCTX_T hCtx)

{
   ESS_STS_T sts  = ESS_STS_NOERR;
   ESS_STR_T userId;
   ESS_BOOL_T bUsingIdentity;
   ESS_PUSERINFOID_T userInfo = NULL;
   
   bUsingIdentity = ESS_TRUE;
   sts = EssGetUserInfoEx (hCtx, userId, bUsingIdentity, &userInfo);
   printf("EssGetUserInfoEx sts: %ld\n", sts);   
   if (userInfo)
   {
      DisplayUserInfoID(userInfo);
   }

   
   return (sts);
}
      

関連トピック

  • EssListUsersInfoEx