Public Class ianda 'ianda = Identification And Authentication #Region " Public Methods " 'Generate random password: ' Returns a randomly generated password. Public Shared Function ReturnRandomPassword() As String Return "P@$$W0rd" End Function Public Shared Function CreateUserAccount(ByVal userName As String, ByVal password As String) As String 'Verify proposed username is unique. 'If so, create new row with username, salt, and composite MD5 password CreateUserAccount = "Account created successfully." End Function Public Shared Function DeleteUserAccount(ByVal userName As String, ByVal password As String, Optional ByVal absolute As Boolean = False) As String 'if info passed in matches, delete the row 'if absolute is true, delete the row even if password doesn't match (admin delete) DeleteUserAccount = "Account deleted successfully." End Function Public Shared Function ResetUserAccount(ByVal userName As String, ByVal oldPassword As String, ByVal newPassword As String, Optional ByVal absolute As Boolean = False) As String 'if info passed in matches, update password 'if absolute is true, force an immediate password reset) ResetUserAccount = "Password successfully reset." End Function Public Shared Function IsValidUser(ByVal userName As String, ByVal password As String) As Boolean 'grab row for the specified user for salt and saved password. 'combine passed in password with salt, convert to md5 and compare with stored password IsValidUser = True End Function #End Region End Class