Examples of User


Examples of org.joget.directory.model.User

    public Employment getEmployment(String id) {
        return getEmploymentDao().getEmployment(id);
    }

    public boolean authenticate(String username, String password) {
        User user = getUserByUsername(username);

        String userPassword = (user != null) ? user.getPassword() : null;

        // temporary code to check for unencrypted password and encrypt it for comparison
        if (userPassword != null && userPassword.length() != 32) {
            userPassword = StringUtil.md5Base16(userPassword);
        }

        // compare passwords
        boolean validLogin = (user != null && userPassword != null && password != null && userPassword.equals(StringUtil.md5Base16(password)));

        if (!validLogin) {
            validLogin = (user != null && userPassword != null && user.getLoginHash().equalsIgnoreCase(password));
        }

        // check for active flag
        boolean active = (user != null && user.getActive() == User.ACTIVE);

        if (!validLogin || !active) {
            return false;
        } else {
            return true;
View Full Code Here

Examples of org.jresearch.flexess.umi.api.impl.User

    return createNewUser(RandomStringUtils.randomAlphabetic(10));
  }

  @Nonnull
  public IUser createNewUser(@Nonnull final String id) {
    User result = users.get(id);
    if (result == null) {
      users.put(id, result = new User(id));
    }
    return result;
  }
View Full Code Here

Examples of org.jresearch.gossip.beans.user.User

        try {
            st = connection.prepareStatement(dbDriver.getQueries()
                    .getUserQueries().getSql_GET_USER_BY_ID());
            st.setInt(1, Integer.parseInt(uid));

            User user = new User();
            fillUser(st, user, false);
            st = connection.prepareStatement(dbDriver.getQueries()
                    .getUserQueries().getSql_DELETE_USER());
            st.setInt(1, Integer.parseInt(uid));
            st.execute();
            st = connection.prepareStatement(dbDriver.getQueries()
                    .getForumQueries().getSql_CLEAN_USER_MOD());
            st.setString(1, user.getName());
            st.execute();
            st = connection.prepareStatement(dbDriver.getQueries()
                    .getForumQueries().getSql_CLEAN_USER_SUBSCR());
            st.setString(1, user.getName());
            st.execute();
            st = connection.prepareStatement(dbDriver.getQueries()
                    .getForumQueries().getSql_MARK_USER_MESS());
            st.setString(1, "<" + user.getName() + ">");
            st.setString(2, user.getName());
            st.execute();
        } finally {
            st.close();
            connection.close();
        }
View Full Code Here

Examples of org.jrest4guice.sample.contact.entity.User

  @Inject
  private BaseEntityManager<String, Role> roleEntityManager;

  @Transactional(type = TransactionalType.READOLNY)
  public boolean authUser(String name, String password) {
    User user = this.userEntityManager.load(
        "named:byNameAndPassword", name, MD5Util.toMD5(password));
    return user != null;
  }
View Full Code Here

Examples of org.jrest4guice.security.User

  @Path("auth")
  public boolean authUser(String userName, String userPassword) {
    boolean result = this.domain.authUser(userName, userPassword);
    if (result) {
      UserRole userRole = new UserRole();
      User user = new User();
      List<Role> roles = this.listUserRoles(userName);
      userRole.setUser(user);
      userRole.setRoles(roles);
     
      //缓存当前用户的权限信息
View Full Code Here

Examples of org.jsondoc.sample.pojo.User

  @ApiMethod(path = "/users/{id}", verb = ApiVerb.GET, description = "Gets a user with the given ID", produces = { MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE })
  @ApiErrors(apierrors = { @ApiError(code = "3000", description = "User not found"), @ApiError(code = "9000", description = "Illegal argument") })
  @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  public @ResponseBody @ApiResponseObject
  User user(@PathVariable @ApiParam(name = "id", description = "The user's ID", required = true, paramType=ApiParamType.PATH) Integer id) {
    return new User(id, "jsondoc-user", 30, "M");
  }
View Full Code Here

Examples of org.jtalks.common.model.entity.User

    /**
     * {@inheritDoc}
     */
    @Override
    public User getCommonUserByUsername(String username) throws NotFoundException {
        User user = this.getDao().getCommonUserByUsername(username);
        if (user == null) {
            String msg = "Common User [" + username + "] not found.";
            LOGGER.info(msg);
            throw new NotFoundException(msg);
        }
View Full Code Here

Examples of org.jtalks.jcommune.plugin.auth.poulpe.dto.User

        server.stop();
    }

    @Test
    public void testSendRegistrationRequestShouldBeSuccessful() throws Exception {
        User user = createUser("username", "passwordHash", "email@email.ru");
        whenHttp(server).match(post(regUrl)).then(status(HttpStatus.OK_200));

        ClientResource clientResource = service.sendRegistrationRequest(user, true);

        assertEquals(clientResource.getStatus().getCode(), HttpStatus.OK_200.getStatusCode());
View Full Code Here

Examples of org.kie.api.task.model.User

        if (required && (users.length == 0) && (groups.length == 0)) {
            throw KieRemoteRestOperationException.badRequest("At least 1 query parameter (either 'user' or 'group') is required for the '" + operation + "' operation.");
        }
       
        for( String user : users ) {
            User newuser = TaskModelProvider.getFactory().newUser();
            ((InternalOrganizationalEntity) newuser).setId(user);
            orgEntList.add(newuser);
        }
        for( String group : groups ) {
            Group newuser = TaskModelProvider.getFactory().newGroup();
View Full Code Here

Examples of org.krams.domain.User

  @Autowired
  private UserRepository repository;
 
  public Boolean create(User user) {
    User existingUser = repository.findByUsername(user.getUsername());
    if (existingUser != null)
      return false;
   
    user.getRole().setUser(user);
    User saved = repository.save(user);
    if (saved == null)
      return false;
   
    return true;
  }
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.