EssListUsersInfoEx

特定のEssbaseサーバー、アプリケーションまたはデータベースへのアクセスを持つすべてのユーザーをリストします。EssListUsersに似ていますが、ユーザー・リスト構造体には、ユーザー・ディレクトリおよび一意のID属性を含められます。

構文

            ESS_FUNC_M EssListUsersInfoEx (
            hCtx
            , 
            AppName
            , 
            DbName
            , 
            pCount
            , 
            ppUserList
            );
         
パラメータデータ型説明

hCtx

ESS_HCTX_T

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

AppName

ESS_STR_T

アプリケーション名(入力)。NULLの場合は、すべてのユーザーがリストされます。

DbName

ESS_STR_T

データベース名(入力)。NULLの場合は、アプリケーション内のすべてのデータベースのユーザーがリストされます。

pCount

ESS_PUSHORT_T

ユーザーのカウントを受け取る変数のアドレス(出力)。

ppUserList

ESS_PPUSERINFOID_T

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

戻り値

正常終了の場合は、ユーザー数のカウントがpCountに、指定したアプリケーションおよびデータベースへのアクセス権を持つユーザーのリストがppUserListに戻されます。

アクセス

この関数を使用するのに、特別な権限は必要ありません。

         
void DisplayUserInfoID2(ESS_USERINFOID_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: %ld\n", userInfo.LoginId);
   printf( "\n");   
}

ESS_STS_T ESS_ListUsersInfo (ESS_HCTX_T  hCtx, ESS_HINST_T hInst)

{
   ESS_STS_T sts  = ESS_STS_NOERR;
   ESS_USHORT_T count, i;
   ESS_PUSERINFOID_T pUserList;

   
   sts = EssListUsersInfoEx(hCtx, AppName, "", &count, &pUserList);
   printf("EssListUsersInfoEx sts: %ld\n", sts);
   if(!sts)
   {	
   	printf("\tNumber of users: %d\n\n", count);
   	for(i = 0; i < count; i++)
   	{
   		DisplayUserInfoID2(pUserList[i]);
   	}
   }

   return (sts);
}
      

関連トピック