//# __________ PROTOCOL :: PUBLIC (LOGIN) __________ #// public VmUser ValidateLogin(String userName, String password) { userName = userName.ToLower(); VmUser user = null; JwList<String> airports = VmAccountData.Default.GetDeviceAirports(); foreach( String airportCode in airports ) { VmAirportData ad = new VmAirportData(VmAccountData.Default.AccountInputData,airportCode); user = ad.GetUser(userName); if( user != null ) break; } if( user == null ) return null; String sha1Hash = JwUtility.ToSha1Hash( userName, password); return ( JwUtility.IsEqual(sha1Hash, user.PasswordHash ) ) ? user : (VmUser)null; }
public JwList<String> GetAirportCodesForUser(String userName) { userName = userName.ToLower(); JwList<String> userAirportCodes = new JwList<String>(); JwList<String> airports = VmAccountData.Default.GetDeviceAirports(); foreach( String airportCode in airports ) { VmAirportData ad = new VmAirportData(VmAccountData.Default.AccountInputData,airportCode); VmUser user = ad.GetUser(userName); if( user != null ) userAirportCodes.Add(airportCode); } return userAirportCodes; }