Examples of User


Examples of com.tek42.perforce.model.User

   *
   * @see com.tek42.perforce.parse.AbstractFormBuilder#buildForm(java.util.Map)
   */
  @Override
  public User buildForm(Map<String, String> fields) throws PerforceException {
    User user = new User();
    user.setUsername(getField("User", fields));
    user.setEmail(getField("Email", fields));
    user.setFullName(getField("FullName", fields));
    user.setPassword(getField("Password", fields));
    user.setJobView(getField("JobView", fields));
    user.setReviews(getField("Review", fields));
    return user;
  }
View Full Code Here

Examples of com.thinkgem.jeesite.modules.sys.entity.User

    if(Global.isDemoMode()){
      addMessage(redirectAttributes, "演示模式,不允许操作!");
      return "redirect:"+Global.getAdminPath()+"/sys/role/assign?id="+roleId;
    }
    Role role = systemService.getRole(roleId);
    User user = systemService.getUser(userId);
    if (user.equals(UserUtils.getUser())) {
      addMessage(redirectAttributes, "无法从角色【" + role.getName() + "】中移除用户【" + user.getName() + "】自己!");
    }else {
      Boolean flag = systemService.outUserInRole(role, userId);
      if (!flag) {
        addMessage(redirectAttributes, "用户【" + user.getName() + "】从角色【" + role.getName() + "】中移除失败!");
      }else {
        addMessage(redirectAttributes, "用户【" + user.getName() + "】从角色【" + role.getName() + "】中移除成功!");
      }     
    }
    return "redirect:"+Global.getAdminPath()+"/sys/role/assign?id="+role.getId();
  }
View Full Code Here

Examples of com.tll.model.User

  @Override
  @Transactional
  public User create(Account account, String emailAddress, String password) throws ValidationException,
      EntityExistsException {
    final User user = entityAssembler.assembleEntity(User.class, new EntityCache(account));

    String encPassword = null;
    try {
      encPassword = encodePassword(password, emailAddress);
    }
    catch(final IllegalArgumentException iae) {
      throw new ValidationException("Invalid password");
    }

    user.setEmailAddress(emailAddress);
    user.setPassword(encPassword);

    // set default expiry date to 1 day from now
    final Calendar clndr = Calendar.getInstance();
    clndr.add(Calendar.DAY_OF_MONTH, 1);
    final Date expires = clndr.getTime();
    user.setExpires(expires);

    // set the user as un-locked by default
    user.setLocked(false);

    // set the role as user by default
    Authority userAuth =
        dao.load(new NameKey<Authority>(Authority.class, AuthorityRoles.ROLE_USER.toString(),
            Authority.FIELDNAME_AUTHORITY));
    user.addAuthority(userAuth);

    persist(user);

    return user;
  }
View Full Code Here

Examples of com.tobedevoured.modelcitizen.model.User

    @Test
    public void alwaySetFieldPolicy() throws ModelFactoryException {
        modelFactory.addPolicy(new SkipReferenceFieldPolicy("username", User.class));

        User user1 = modelFactory.createModel(User.class);
        User user2 = modelFactory.createModel(user1);

        assertNotSame(user1.getUsername(), user2.getUsername());
        assertEquals(user1.getEmails(), user2.getEmails());
    }
View Full Code Here

Examples of com.uip.tatar.model.user.User

        }
    }

    private User getTestUser() {
        try {
            User user = new User();
            Field field = User.class.getDeclaredField("id");
            field.setAccessible(true);
            field.set(user, "50d308f5dc490ef10e00000d");

            return user;
View Full Code Here

Examples of com.uphea.domain.User

    try {
      id = Long.valueOf(cookieData[0]);
    } catch (NumberFormatException ignore) {
      return null;
    }
    User user = userAuthManager.findUser(id, cookieData[1]);
    if (user == null) {
      return null;
    }
    userAuthManager.login(user);
    return new UserSession(user);
View Full Code Here

Examples of com.ursu.shared.User

          "\n Username: "+ action.getUserToCreate().getUsername()+
          "\n Recieved password: "+ action.getUserToCreate().getHashedPassword()+
          "\n Email: " +action.getUserToCreate().getEmail());
    String sessionId = null;
    String dataStoreId = null;
    User userToCreate = action.getUserToCreate();
   
    if(userToCreate == null )
    {
      log.severe("\nreturned because userToCreate was null!!!");
      return new CreateUserResult(sessionId, dataStoreId);
    }
    else {
      dataStoreId =  dao.createUser(userToCreate);
      log.severe("\n From dao.CreateUser(), the datastoreId is: " +dataStoreId);
      if (dataStoreId != null) {
        HttpSession session = requestProvider.get().getSession();
        session.setAttribute("login.authenticated", userToCreate.getUsername());
        sessionId = session.getId();
        return new CreateUserResult(sessionId, dataStoreId);
      }
      else return new CreateUserResult(sessionId, dataStoreId) ;
    }
View Full Code Here

Examples of com.ustc.SSHDemo.user.to.User

  @Override
  public User getUserById(Integer id) throws Exception {
//    List l = (List)this.getHibernateTemplate().find("from User u where u.id=?", id);
//    User u = (User) l.get(0);
//    return u;
    User u=(User)this.getHibernateTemplate().get(User.class, id);
    return u;
  }
View Full Code Here

Examples of com.vmware.bdd.entity.User

         jaxbContext = JAXBContext.newInstance(Users.class);
         Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
         Users users =
               (Users) jaxbUnmarshaller.unmarshal(FileUtils.getConfigFile(
                     UserService.UsersFile, "Users"));
         User userDTO = null;
         boolean exsiting = false;
         boolean anonymous = false;
         if (users != null) {
            for (User user : users.getUsers()) {
               if (user.getName().equals(username)) {
                  exsiting = true;
                  userDTO = user;
                  break;
               } else if (user.getName().trim().equals("*")) {
                  anonymous = true;
                  userDTO = user;
                  userDTO.setName("Guest");
               }
            }
         }
         if (!exsiting && !anonymous) {
            throw new UsernameNotFoundException("unauthorized user");
         }

         ArrayList<GrantedAuthority> roleList = new ArrayList<GrantedAuthority>();
         roleList.add(new SimpleGrantedAuthority(ADMIN_ROLE));
         return new org.springframework.security.core.userdetails.User(
               userDTO.getName(), "", roleList);
      } catch (UsernameNotFoundException userNotFoundEx) {
         throw userNotFoundEx;
      } catch (Exception e) {
         logger.error("Authorized error :" + e.getMessage());
         throw new UsernameNotFoundException("unauthorized");
View Full Code Here

Examples of com.vst.model.User

        request.addParameter("username", "tomcat");

        mv = c.handleRequest(request, new MockHttpServletResponse());

        assertEquals("userForm", mv.getViewName());
        User editUser = (User) mv.getModel().get(c.getCommandName());
        assertEquals("Tomcat User", editUser.getFullName());
    }
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.