admin 发表于 2015-1-21 14:48:11

teamcenter二次开发ITK源码分享:设置用户的激活状态

teamcenter二次开发ITK源码分享:设置用户的激活状态


static void do_it(void)
{
    int
      status = 0,
      new_status = 0;
    tag_t
      user = NULLTAG;
    char
      user_id = "plmhome",
      status_string = {"active", "inactive"},
      person_name = "";

   ITK_CALL(SA_find_user(user_id, &user));
   ITK_CALL(AOM_load(user));
   ITK_CALL(SA_ask_user_person_name(user, person_name));
   ITK_CALL(SA_get_user_status(user, &status));
    ECHO("Person Name: %s - %s\n", person_name, status_string);

    /* reverse it */
    if (status == ACTIVE) new_status = INACTIVE;
    if (status == INACTIVE) new_status = ACTIVE;

   ITK_CALL(AOM_lock(user));
   ITK_CALL(SA_set_user_status(user, new_status));
   ITK_CALL(AOM_save(user));
   ITK_CALL(AOM_unlock(user));
   ITK_CALL(AOM_unload(user));
}









页: [1]
查看完整版本: teamcenter二次开发ITK源码分享:设置用户的激活状态