コード例 #1
0
  /**
   * Adds the new user. Event is logged.
   *
   * @param p bean containing the information for the new user
   * @return MID of the new user.
   * @throws FormValidationException
   * @throws iTrustException
   */
  public long add(PersonnelBean p) throws FormValidationException, iTrustException {
    new AddPersonnelValidator().validate(p);
    long newMID = personnelDAO.addEmptyPersonnel(Role.ER);
    p.setMID(newMID);
    personnelDAO.editPersonnel(p);
    String pwd = authDAO.addUser(newMID, Role.ER, RandomPassword.getRandomPassword());
    p.setPassword(pwd);

    return newMID;
  }