Examples of UserModel


Examples of com.gitblit.models.UserModel

    @Test
    public void testAuthenticate() throws Exception {
      RedmineAuthProvider redmine = newRedmineAuthentication();
        redmine.setTestingCurrentUserAsJson(JSON);
        UserModel userModel = redmine.authenticate("RedmineAdminId", "RedmineAPIKey".toCharArray());
        assertThat(userModel.getName(), is("redmineadminid"));
        assertThat(userModel.getDisplayName(), is("baz foo"));
        assertThat(userModel.emailAddress, is("baz@example.com"));
        assertNotNull(userModel.cookie);
    }
View Full Code Here

Examples of com.gitblit.models.UserModel

    }

    @Test
    public void testAuthenticationManager() throws Exception {
      AuthenticationManager auth = newAuthenticationManager();
        UserModel userModel = auth.authenticate("RedmineAdminId", "RedmineAPIKey".toCharArray());
        assertThat(userModel.getName(), is("redmineadminid"));
        assertThat(userModel.getDisplayName(), is("baz foo"));
        assertThat(userModel.emailAddress, is("baz@example.com"));
        assertNotNull(userModel.cookie);
    }
View Full Code Here

Examples of com.pku.judgeonline.common.UserModel

    if (!UserModel.isLoginned(paramHttpServletRequest))
    {
      ErrorProcess.Error("Please login first.", localPrintWriter);
      return;
    }
    UserModel localUserModel = UserModel.getCurrentUser(paramHttpServletRequest);
    Timestamp localTimestamp1 = ServerConfig.getSystemTime();
    if (localUserModel.getLastSubmitTime() + 3000L > localTimestamp1.getTime())
    {
      ErrorProcess.Error("Sorry,please don't submit again within 3 seconds.", localPrintWriter);
      return;
    }
    localUserModel.setLastSubmitTime(localTimestamp1.getTime());
    localConnection = DBConfig.getConn();
    try
    {
      PreparedStatement localPreparedStatement;
      ResultSet localResultSet;
      if (cid != 0 && l1 <= 26)
      {
        localPreparedStatement = localConnection.prepareStatement("select problem_id from contest_problem where contest_id=? and num=?");
        localPreparedStatement.setLong(1, cid);
        localPreparedStatement.setLong(2, l1);
        localResultSet = localPreparedStatement.executeQuery();
        if (!localResultSet.next())
        {
          ErrorProcess.Error((new StringBuilder()).append("Can not find contest problem (ID:").append(l1).append(")<br><br>").toString(), localPrintWriter);
          localPreparedStatement.close();
          localConnection.close();
          return;
        }
        l1 = localResultSet.getInt("problem_id");
      }
      String str3 = localUserModel.getUser_id();
      String str4 = localUserModel.getNick();
      localPreparedStatement = localConnection.prepareStatement("select problem.* from problem where problem_id = ? AND UPPER(problem.defunct) = 'N'");
      localPreparedStatement.setLong(1, l1);
      localResultSet = localPreparedStatement.executeQuery();
      if (!localResultSet.next())
      {
View Full Code Here

Examples of com.softserve.academy.food.model.UserModel

        role = user.getRole();
        enable = user.getEnable();
    }

    public UserModel toModel() {
        return new UserModel(this);
    }
View Full Code Here

Examples of com.softserve.academy.food.model.UserModel

  public void testUpdate()
  {
    User user = new User("Vasa", "1234");
    user = userDao.add( user );
   
    UserModel change = new UserModel( user );
    change.setPhone("3434995");
   
    uService.update( change );
    assertEquals( userDao.get(1).getPhone(), "3434995" );
  }
View Full Code Here

Examples of com.sparc.knappsack.models.UserModel

            return showRegistrationPage(request, response, model, null);
        }

//        invalidateSession(request, response);

        UserModel userModel = new UserModel();
        userModel.setEmail(registrationForm.getEmail().trim());
        userModel.setFirstName(registrationForm.getFirstName().trim());
        userModel.setLastName(registrationForm.getLastName().trim());
        userModel.setPassword(registrationForm.getFirstPassword().trim());

        User user = registrationService.registerUser(userModel, false);
        if (user != null && user.getId() != null && user.getId() > 0) {
            try {
                EventDelivery deliveryMechanism = eventDeliveryFactory.getEventDelivery(EventType.USER_ACCOUNT_ACTIVATION);
View Full Code Here

Examples of jetbrains.communicator.core.users.UserModel

    if (file == null || editor == null) return EMPTY_ARRAY;


    List<AnAction> result = new ArrayList<AnAction>();
    final UserModel userModel = getUserModel();
    String[] groups = userModel.getGroups();
    List<String> groupsWithUsers = new ArrayList<String>();
    for (String group : groups) {
      if (userModel.getUsers(group).length > 0) {
        groupsWithUsers.add(group);
      }
    }

    if (groupsWithUsers.size() == 1 ) {
      User[] users = userModel.getUsers(groupsWithUsers.get(0));
      fillWithUserActions(users, result, file, editor);
    }
    else {
      for (String groupsWithUser : groupsWithUsers) {
View Full Code Here

Examples of lounge.misc.UserModel

  public AbstractLoungeModel(JFrame window, User currentUser) {
    this.window = window;
    this.currentUser = currentUser;

    userModel = new UserModel(this, currentUser);
  }
View Full Code Here

Examples of open.dolphin.infomodel.UserModel

           
            logger.info("Host Service を取得しました。");
           
            // Admin Model
            FacilityModel facility = new FacilityModel();
            UserModel admin = new UserModel();
            admin.setFacilityModel(facility);

            // 施設OID
            facility.setFacilityId(DEFAULT_FACILITY_OID);

            facility.setFacilityName(prop.get("facility.name"));
            facility.setZipCode(prop.get("facility.zipcode"));
            facility.setAddress(prop.get("facility.address"));
            facility.setTelephone(prop.get("facility.telephone"));
            facility.setUrl(prop.get("facility.url"));
            Date date = new Date();
            facility.setRegisteredDate(date);
            facility.setMemberType(MEMBER_TYPE);

            //admin.setUserId(prop.get("admin.id"));
            //admin.setPassword(prop.get("admin.password"));
            if (userId == null || userId.equals("")) {
                admin.setUserId(prop.get("admin.login.id"));
            } else {
                admin.setUserId(userId);
            }
            if (password == null || password.equals("")) {
                admin.setPassword(prop.get("admin.login.password"));
            } else {
                admin.setPassword(password);
            }
            //String Algorithm = "MD5";
            //String encoding = "hex";
            //String charset = null;
            //String hashPass = CryptoUtil.createPasswordHash(Algorithm, encoding, charset, admin.getUserId(), admin.getPassword());
            String hashPass = HashUtil.MD5(admin.getPassword());
            admin.setPassword(hashPass);
            admin.setSirName(prop.get("admin.sir.name"));
            admin.setGivenName(prop.get("admin.given.name"));
            admin.setCommonName(admin.getSirName() + " " + admin.getGivenName());

            // 医療資格
            LicenseModel license = new LicenseModel();
            license.setLicense("doctor");
            license.setLicenseDesc("医師");
            license.setLicenseCodeSys("MML0026");
            admin.setLicenseModel(license);

            // 診療科
            DepartmentModel dept = new DepartmentModel();
            dept.setDepartment("01");
            dept.setDepartmentDesc("内科");
            dept.setDepartmentCodeSys("MML0028");
            admin.setDepartmentModel(dept);

            // Email
            String email = prop.get("admin.email");
            if (email == null || email.equals("")) {
                admin.setEmail(prop.get("someone@some-clinic.jp"));
            } else {
                admin.setEmail(email);
            }

            // MemberTpe
            admin.setMemberType(MEMBER_TYPE);

            // 登録日
            admin.setRegisteredDate(date);

            // 登録
            service.addFacilityAdmin(admin);

            logger.info("管理者を登録しました。");
View Full Code Here

Examples of org.apache.hadoop.hbase.stargate.auth.ZooKeeperAuthenticator.UserModel

      new JSONJAXBContext(JSONConfiguration.natural().build(),
          UserModel.class);
    JSONMarshaller marshaller = context.createJSONMarshaller();
    if (zk.exists(ZooKeeperAuthenticator.USERS_ZNODE_ROOT + "/" +
          ADMIN_TOKEN, null) == null) {
      UserModel model = new UserModel();
      model.name = ADMIN_USERNAME;
      model.admin = true;
      ByteArrayOutputStream os = new ByteArrayOutputStream();
      marshaller.marshallToJSON(model, os);
      zk.create(ZooKeeperAuthenticator.USERS_ZNODE_ROOT + "/" + ADMIN_TOKEN,
        os.toByteArray(), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
    }
    if (zk.exists(ZooKeeperAuthenticator.USERS_ZNODE_ROOT + "/" +
          USER_TOKEN, null) == null) {
      UserModel model = new UserModel();
      model.name = USER_USERNAME;
      ByteArrayOutputStream os = new ByteArrayOutputStream();
      marshaller.marshallToJSON(model, os);
      zk.create(ZooKeeperAuthenticator.USERS_ZNODE_ROOT + "/" + USER_TOKEN,
        os.toByteArray(), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
    }
    if (zk.exists(ZooKeeperAuthenticator.USERS_ZNODE_ROOT + "/" +
          DISABLED_TOKEN, null) == null) {
      UserModel model = new UserModel();
      model.name = DISABLED_USERNAME;
      model.disabled = true;
      ByteArrayOutputStream os = new ByteArrayOutputStream();
      marshaller.marshallToJSON(model, os);
      zk.create(ZooKeeperAuthenticator.USERS_ZNODE_ROOT + "/" +DISABLED_TOKEN,
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.