package edu.gatech.nutrack.model;

import android.content.Context;
import edu.gatech.nutrack.database.UserDataSource;

public class Authenticator {
	private Context context;
	
	public Authenticator(Context context) {
		this.context = context;
	}
	
	public boolean isUserValid(User u) {
		UserDataSource uds = new UserDataSource(context);
		uds.open();
		User good = uds.getUser(u.getUsername(), u.getPassword(), u.getEmail(), u.getType());
		uds.close();
		return good == null;
	}
}

@@ -462,17 +462,237 @@
 rn good 
-=
+!= null;%0A%09%7D%0A%09%0A%09public boolean isUserValid(String username, String password) %7B%0A%09%09UserDataSource uds = new UserDataSource(context);%0A%09%09uds.open();%0A%09%09User good = uds.getUser(username, password);%0A%09%09uds.close();%0A%09%09return good !
 = null;%0A

check user name and password with authenticator