Examples of User


Examples of org.jboss.seam.wiki.core.model.User

                );
            }
        }
        uploader.reset();

        User adminUser = (User)Component.getInstance("adminUser");
        User guestUser = (User)Component.getInstance("guestUser");

        if ( !getInstance().getId().equals(adminUser.getId()) &&
             !getInstance().getId().equals(guestUser.getId()) &&
             roles != null && roles.size() > 0) {
            // Roles
            getInstance().setRoles(new ArrayList<Role>()); // Clear out the collection
            getInstance().getRoles().addAll(roles);
        }

        // Preferences
        if (preferenceEditor != null) {
            String editorFailed = preferenceEditor.save();
            if (editorFailed != null) return null;
        }

        boolean loginCredentialsModified = false;

        // User wants to change his password
        if (getPassword() != null && getPassword().length() != 0) {
            if (!passwordAndControlNotNull() ||
                !passwordMatchesRegex() ||
                !passwordMatchesControl()) {

                // Force re-entry
                setPassword(null);
                setPasswordControl(null);

                return null;
            } else {
                // Set password hash
                getInstance().setPasswordHash(hashUtil.hash(getPassword()));
                loginCredentialsModified = true;
            }
        }

        // User changed his username
        if (!getInstance().getUsername().equals(oldUsername)) {
            loginCredentialsModified = true;

            // Validate
            if (!isUniqueUsername()) return null;
        }

        if (Identity.instance().hasPermission("User", "isAdmin", Component.getInstance("currentUser"))) {
            // Current user is admin and activated an account
            if (getInstance().isActivated()) {
                getInstance().setActivationCode(null);
            }
        }

        String outcome = super.update();
        if (outcome != null) {

            org.jboss.seam.core.Events.instance().raiseEvent("User.updated", getInstance());

            User currentUser = (User)Component.getInstance("currentUser");
            if (getInstance().getId().equals(currentUser.getId())) {
                // Updated profile of currently logged-in user
                Contexts.getSessionContext().set("currentUser", getInstance());
               
                // TODO: If identity.logout() wouldn't kill my session, I could call it here...
                // And I don't have cleartext password in all cases, so I can't relogin the user automatically
View Full Code Here

Examples of org.jboss.soa.esb.services.security.principals.User

    }

    private SecurityContext getSecurityContext()
    {
        Subject subject = new Subject();
        subject.getPrincipals().add(new User("Mr.Poon"));
        return new SecurityContext(subject, 5000l);
    }
View Full Code Here

Examples of org.jboss.test.hibernate.model.User

      return user;
   }

   public void deleteUser(Long userId) throws HibernateException
   {
      User user = loadUser(userId);
      getSession().delete(user);
      getSession().flush();
   }
View Full Code Here

Examples of org.jbpm.api.identity.User

}

  public List<User> findUsersById(String... userIds) {
    List<User> users = new ArrayList<User>();
  for (String userId : userIds){
    User user = findUserById(userId);
    if (user != null) {
      users.add(user);
    }
  }
   
View Full Code Here

Examples of org.jbpm.identity.User

            final Object userNameValue = userNameExpression.getValue(elContext);
            if (userNameValue == null) {
                context.setError("Error creating user", "The user name value is null");
                return;
            }
            final User user = new User(userNameValue.toString());
            if (passwordExpression != null) {
                final Object passwordValue = passwordExpression.getValue(elContext);
                if (passwordValue == null) {
                    context.setError("Error creating user", "The password value is null");
                    return;
                }
                if (passwordConfirmExpression != null) {
                    final Object passwordConfirmValue = passwordConfirmExpression.getValue(elContext);
                    if (! passwordValue.equals(passwordConfirmValue)) {
                        context.setError("Error creating user", "The password confirmation value does not match the password value");
                        return;
                    }
                }
                user.setPassword(passwordValue.toString());
            }
            if (emailExpression != null) {
                final Object emailValue = emailExpression.getValue(elContext);
                if (emailValue == null) {
                    context.setError("Error creating user", "The email value is null");
                    return;
                }
                user.setEmail(emailValue.toString());
            }
            identitySession.saveUser(user);
            if (targetExpression != null) {
                targetExpression.setValue(elContext, user);
            }
View Full Code Here

Examples of org.jbpm.task.User

    String actorId = (String) workItem.getParameter("ActorId");
    if (actorId != null && actorId.trim().length() > 0) {
      String[] actorIds = actorId.split(",");
      for (String id: actorIds) {
        potentialOwners.add(new User(id.trim()));
      }
            //Set the first user as creator ID??? hmmm might be wrong
            if (potentialOwners.size() > 0){
                taskData.setCreatedBy((User)potentialOwners.get(0));
            }
        }
   
        String groupId = (String) workItem.getParameter("GroupId");
    if (groupId != null && groupId.trim().length() > 0) {
      String[] groupIds = groupId.split(",");
      for (String id: groupIds) {
        potentialOwners.add(new Group(id.trim()));
      }
    }

        assignments.setPotentialOwners(potentialOwners);
    List<OrganizationalEntity> businessAdministrators = new ArrayList<OrganizationalEntity>();
    businessAdministrators.add(new User("Administrator"));
    assignments.setBusinessAdministrators(businessAdministrators);
    task.setPeopleAssignments(assignments);
       
    task.setTaskData(taskData);
View Full Code Here

Examples of org.jbpm.userprofile.User

    return null;
  }
 
  public List<Group> getGroups() {
    List<OrganizationalEntity> members = new ArrayList<OrganizationalEntity>();
    members.add(new User());
   
    Group group = new Group();
    group.setMembers(members);

    List<Group> result = new ArrayList<Group>();
View Full Code Here

Examples of org.jclouds.abiquo.domain.enterprise.User

    * TODO: Using the painUserContext, modifying the user returns this error:
    * HTTP/1.1 401 Unauthorized
    **/
   @Test(enabled = false)
   public void testListEventsFilteredByUser() {
      User current = env.plainUserContext.getAdministrationService().getCurrentUser();
      current.setEmail("test@test.com");
      current.update();

      EventOptions options = EventOptions.builder().dateFrom(new Date()).userName(current.getName()).build();
      assertEvents(options);
   }
View Full Code Here

Examples of org.jclouds.cloudstack.domain.User

   @Test
   public void testCreateContextUsingUserAndPasswordAuthentication() {
      skipIfNotGlobalAdmin();

      Account testAccount = null;
      User testUser = null;

      String prefix = this.prefix + "-session";
      try {
         testAccount = createTestAccount(globalAdminClient, prefix);
         testUser = createTestUser(globalAdminClient, testAccount, prefix);

         String expectedUsername = prefix + "-user";
         assertEquals(testUser.getName(), expectedUsername);

         checkLoginAsTheNewUser(expectedUsername);

         ApiKeyPair expected = globalAdminClient.getUserClient().registerUserKeys(testUser.getId());
         ApiKeyPair actual = ApiKeyPairs.loginToEndpointAsUsernameInDomainWithPasswordAndReturnApiKeyPair(
            URI.create(endpoint), prefix + "-user", "password", "");

         assertEquals(actual, expected);

      } finally {
         if (testUser != null)
            globalAdminClient.getUserClient().deleteUser(testUser.getId());
         if (testAccount != null)
            globalAdminClient.getAccountClient().deleteAccount(testAccount.getId());
      }
   }
View Full Code Here

Examples of org.jclouds.enterprisechef.domain.User

      // See: http://tickets.opscode.com/browse/CHEF-2477
      super.testSearchClientsWithOptions();
   }

   public void testGetUser() {
      User user = api.getUser(identity);
      assertEquals(user.getUsername(), identity);
      assertNotNull(user.getPublicKey());
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.