Exemple #1
0
 public String signUp() {
   if (ProcessUser.selectUser(username) != null) {
     result = LOGIN;
   } else {
     User user = new User();
     user.setFullname(fullName);
     user.setUsername(username);
     user.setPassword(password);
     ProcessUser.insertUser(user);
     setSession(user);
     result = SUCCESS;
   }
   return result;
 }
Exemple #2
0
  public String execute() throws SQLException {
    User user = ProcessUser.selectUser(username);
    if (user != null) {
      if (password.equals(user.getPassword())) {
        setSession(user);
        result = SUCCESS;
      } else result = LOGIN;

    } else {
      result = LOGIN;
      return LOGIN;
    }
    return result;
  }