コード例 #1
0
  public static boolean isValidLogin(String userName, String password) {

    // is the user on file?

    if (AdminUsers.getPassword(userName) == null) {
      return false;
    }
    // does the password match passeod from table?

    String passwordFromDB = AdminUsers.getPassword(userName);
    if (password.equals(passwordFromDB)) {
      return true;
    }

    return false;
  }
コード例 #2
0
  public static boolean isUserNameInUse(String userName) {

    if (AdminUsers.getUser(userName) == null) {
      return false;
    }

    return true;
  }
コード例 #3
0
  public static User getUser(String userName) {

    return AdminUsers.getUser(userName);
  }
コード例 #4
0
  public static void setUser(String userName, String password, String firstName, String lastName) {

    AdminUsers.addUser(userName, firstName, lastName, password);
  }