Examples of UserData


Examples of org.eclipse.xcde.backend.UserData

        newReg.getUserList().addChangeListener(this);
        viewer.setInput(newReg.getUserList());
        viewer.refresh();
        for (int i = 0; i < table.getItemCount(); ++i)
          {
          UserData data = (UserData)table.getItem(i).getData();
          table.getItem(i).setForeground(new Color(table.getDisplay(),data.getColour()));
          }
        }
      else
        {
        viewer.setInput(new UserDataList(null));
View Full Code Here

Examples of org.eclipse.xcde.backend.UserData

  //no javadoc for this, the super has a great javadoc, we just implement
  //what it says in this case
  public int compare(Viewer viewer, Object o1, Object o2)
    {
    int toReturn = 0;
    UserData one = (UserData)o1;
    UserData two = (UserData)o2;
    switch(criteria)
      {
      case NAME:
        toReturn = collator.compare(one.getUsername(),two.getUsername());
        break;
      case RGB:
        RGB left = one.getColour();
        RGB right = two.getColour();
        toReturn = (left.blue + left.red + left.green) - (right.blue + right.red + right.green);
        break;
      case BUILD:
          //same or not so do XOR and return appropriately (same gets 0)
        toReturn = (one.getBuild() ^ two.getBuild()) ? -1 : 0;
        break;
      case TEST:
        //same or not so do XOR and return appropriately (same gets 0)
        toReturn = (one.getTest() ^ two.getTest()) ? -1 : 0;
        break;
      case LOCATION:
        toReturn = collator.compare(one.getConcatPath(),two.getConcatPath());
        break;
      }
    return toReturn * order;
    }
 
View Full Code Here

Examples of org.eclipse.xcde.backend.UserData

    {
    if (property.equals("colour"))
      return true;
    if (property.equals("location"))
      return false;
    UserData user = (UserData)element;
    //restrict to users matching the current user
    if (XCDERegisterProvider.getProvider().getCurrentRegister() != null &&
      user.getUsername().equals(XCDERegisterProvider.getProvider().getCurrentRegister().getUsername()))
      return true;
    return false;
    }
View Full Code Here

Examples of org.eclipse.xcde.backend.UserData

   * objects to be rendered by the different table cells.  They must match
   * the datatype expected by the CellEditor.
   */
  public Object getValue(Object element, String property)
    {
    UserData data = (UserData)element;
    if (property.equals("username"))
      return data.getUsername();
    else if (property.equals("colour"))
      return data.getColour();
    else if (property.equals("build"))
      return new Boolean(data.getBuild());
    else if (property.equals("test"))
      return new Boolean(data.getTest());
    return null;
    }
View Full Code Here

Examples of org.eclipse.xcde.backend.UserData

     * @parma value The new value of for the cell in question
   */
  public void modify(Object element, String property, Object value)
    {
    TableItem ti = (TableItem)element;
    UserData data = (UserData)ti.getData();
    if (property.equals("username"))
      {
      //update current user to the new name or we lose the ability to
      //edit
      if (XCDERegisterProvider.getProvider().getCurrentRegister() != null)
        XCDERegisterProvider.getProvider().getCurrentRegister().setUsername((String)value);
      }
    else if (property.equals("colour"))
      {
      UserData old = new UserData(data);
      data.setColour((RGB)value);
      ti.setForeground(new Color(ti.getDisplay(),(RGB)value));
      XCDERegisterProvider.getProvider().getCurrentRegister().getUserList().updateUserFromServer(old,data);
      }
    else if (property.equals("build"))
      {
      UserData old = new UserData(data);
      data.setBuild(((Boolean)value).booleanValue());
      XCDERegisterProvider.getProvider().getCurrentRegister().getUserList().updateUser(old,data);
      }
    else if (property.equals("test"))
      {
      UserData old = new UserData(data);
      data.setTest(((Boolean)value).booleanValue());
      XCDERegisterProvider.getProvider().getCurrentRegister().getUserList().updateUser(old,data);
      }
    //notify the backend
    viewer.refresh();
View Full Code Here

Examples of org.ejbca.core.ejb.ra.UserData

*/
public class UserDataTest {

  @Test
    public void test01UserPassword() throws Exception {
      UserData data = new UserData();
      data.setPassword("foo123");
      String hash = data.getPasswordHash();
      // Check that it by default generates a strong bcrypt password hash
      assertTrue(hash.startsWith("$2"));
      assertFalse(data.comparePassword("bar123"));
      assertTrue(data.comparePassword("foo123"));
      // Set the same password again, it should be another hash this time
      data.setPassword("foo123");
      String hash1 = data.getPasswordHash();
      assertTrue(hash1.startsWith("$2"));
      assertFalse(hash1.equals(hash));

      // Now check that we can still use old password hashes transparently usgin the old fixed sha1 hash of foo123
      data.setPasswordHash("3b303d8b0364d9265c06adc8584258376150c9b5");
      assertEquals("3b303d8b0364d9265c06adc8584258376150c9b5", data.getPasswordHash());
      assertFalse(data.comparePassword("bar123"));
      assertTrue(data.comparePassword("foo123"));

      // Check that set clear text password works as well
      data.setOpenPassword("primekey");
      hash = data.getPasswordHash();
      // Check that it by default generates a strong bcrypt password hash
      assertTrue(hash.startsWith("$2"));
      assertFalse(data.comparePassword("foo123123"));
      assertTrue(data.comparePassword("primekey"));
      assertEquals("primekey", data.getClearPassword());

    }
View Full Code Here

Examples of org.ejbca.core.ejb.ra.UserData

  }

  public void testUserData() {
    LOG.trace(">testUserData");
    logMemStats();
    UserData entity = new UserData();
    entity.setCaId(0);
    entity.setCardNumber(VARCHAR_250B);
    entity.setCertificateProfileId(0);
    entity.setClearPassword(VARCHAR_250B);
    entity.setEndEntityProfileId(0);
    entity.setExtendedInformationData(CLOB_1MiB);
    entity.setHardTokenIssuerId(0);
    entity.setKeyStorePassword(VARCHAR_250B);
    entity.setPasswordHash(VARCHAR_250B);
    entity.setRowProtection(CLOB_10KiB);
    entity.setRowVersion(0);
    entity.setStatus(0);
    entity.setSubjectAltName(VARCHAR_250B);
    entity.setSubjectDN(VARCHAR_250B);
    entity.setSubjectEmail(VARCHAR_250B);
    entity.setTimeCreated(0L);
    entity.setTimeModified(0L);
    entity.setTokenType(0);
    entity.setType(0);
    entity.setUsername(VARCHAR_250B);
    storeAndRemoveEntity(entity);
    LOG.trace("<testUserData");
  }
View Full Code Here

Examples of org.ejbca.core.ejb.ra.UserData

      if (log.isTraceEnabled()) {
            log.trace(">authenticateUser(" + username + ", hiddenpwd)");
      }
        try {
            // Find the user with username username, or throw FinderException
            final UserData data = UserData.findByUsername(entityManager, username);
            if (data == null) {
              throw new ObjectNotFoundException("Could not find username " + username);
            }
            // Decrease the remaining login attempts. When zero, the status is set to STATUS_GENERATED
             userAdminSession.decRemainingLoginAttempts(admin, username);
             final int status = data.getStatus();
            if ( (status == UserDataConstants.STATUS_NEW) || (status == UserDataConstants.STATUS_FAILED) || (status == UserDataConstants.STATUS_INPROCESS) || (status == UserDataConstants.STATUS_KEYRECOVERY)) {
              if (log.isDebugEnabled()) {
                log.debug("Trying to authenticate user: username="+username+", dn="+data.getSubjectDN()+", email="+data.getSubjectEmail()+", status="+status+", type="+data.getType());
              }
                if (!data.comparePassword(password)) {
                  final String msg = intres.getLocalizedMessage("authentication.invalidpwd", username);             
                  logSession.log(admin, data.getCaId(), LogConstants.MODULE_CA, new Date(),username, null, LogConstants.EVENT_ERROR_USERAUTHENTICATION,msg);
                  throw new AuthLoginException(msg);
                }
                // Resets the remaining login attempts as this was a successful login
                userAdminSession.resetRemainingLoginAttempts(admin, username);
              // Log formal message that authentication was successful
                final String msg = intres.getLocalizedMessage("authentication.authok", username);             
                logSession.log(admin, data.getCaId(), LogConstants.MODULE_CA, new Date(),username, null, LogConstants.EVENT_INFO_USERAUTHENTICATION, msg);
              if (log.isTraceEnabled()) {
                    log.trace("<authenticateUser("+username+", hiddenpwd)");
              }
                return data.toUserDataVO();
            }
          final String msg = intres.getLocalizedMessage("authentication.wrongstatus", UserDataConstants.getStatusText(status), Integer.valueOf(status), username);             
          logSession.log(admin, data.getCaId(), LogConstants.MODULE_CA, new Date(),username, null, LogConstants.EVENT_INFO_USERAUTHENTICATION, msg);
            throw new AuthStatusException(msg);
        } catch (ObjectNotFoundException oe) {
          final String msg = intres.getLocalizedMessage("authentication.usernotfound", username);             
          logSession.log(admin, admin.getCaId(), LogConstants.MODULE_CA, new Date(),username, null, LogConstants.EVENT_INFO_USERAUTHENTICATION, msg);
            throw oe;
View Full Code Here

Examples of org.hdiv.logs.UserData

    return keyFactory;
  }

  @Bean
  public IUserData securityUserData() {
    UserData userData = new UserData();
    return userData;
  }
View Full Code Here

Examples of org.nasutekds.quicksetup.UserData

      }
    }

    boolean userApproved = false;

    UserData uData = new UserData();
    while (!userApproved)
    {
      try
      {
        if (isInteractive())
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.