Package org.fao.geonet.exceptions

Examples of org.fao.geonet.exceptions.UserNotFoundEx


  public static User updatePasswordWithNew(boolean matchOldPassword, String oldPassword,
      String newPassword, Integer iUserId, ApplicationContext appContext) throws SQLException, UserNotFoundEx {
      UserRepository repo = appContext.getBean(UserRepository.class);
        User user = repo.findOne(iUserId);
        if (user == null) {
            throw new UserNotFoundEx(""+iUserId);
        }

        PasswordEncoder encoder = encoder(appContext);
    return updatePasswordWithNew(matchOldPassword, oldPassword, newPassword, user, encoder, repo);
  }
View Full Code Here


      req.addParam("password", params.password);

      Element response = req.execute();

      if (!response.getName().equals("ok"))
        throw new UserNotFoundEx(params.username);
    }

    //--- search

    result = new GeonetResult();
View Full Code Here

      req.addParam("password", password);

      Element response = req.execute();

      if (!response.getName().equals("ok"))
        throw new UserNotFoundEx(username);

      req.setAddress(addr);
    }
  }
View Full Code Here

    String username = Util.getParam(params, Params.USERNAME);
    String template = Util.getParam(params, Params.TEMPLATE, CHANGE_EMAIL_XSLT);

        final User user = context.getBean(UserRepository.class).findOneByUsername(username);
    if (user == null) {
      throw new UserNotFoundEx(username);
        }

    // only let registered users change their password 
    if (user.getProfile() != Profile.RegisteredUser) {
      // Don't throw OperationNotAllowedEx because it is not related to not having enough priviledges
View Full Code Here

   
    // check valid user
        final UserRepository userRepository = context.getBean(UserRepository.class);
        User elUser = userRepository.findOneByUsername(username);
    if (elUser == null) {
      throw new UserNotFoundEx(username);
        }

    // only let registered users change their password this way 
    if ( elUser.getProfile() != Profile.RegisteredUser) {
      throw new OperationNotAllowedEx("Only users with profile RegisteredUser can change their password using this option");
View Full Code Here

    // check old password
    UserSession session = context.getUserSession();
    String      userId  = session.getUserId();

    if (userId == null)
      throw new UserNotFoundEx(null);

        final UserRepository userRepository = context.getBean(UserRepository.class);
        final User user = userRepository.findOne(userId);

        user.setName(name)
View Full Code Here

    String newPassword = Util.getParam(params, Params.NEW_PASSWORD);

    UserSession session = context.getUserSession();
    String      currentUserId  = session.getUserId();

    if (currentUserId == null) throw new UserNotFoundEx(null);

    int iUserId = Integer.parseInt(currentUserId);
        ApplicationContext appContext = context.getApplicationContext();
    PasswordUtil.updatePasswordWithNew(true, password, newPassword, iUserId, appContext);
View Full Code Here

TOP

Related Classes of org.fao.geonet.exceptions.UserNotFoundEx

Copyright © 2018 www.massapicom. 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.