90 likes | 366 Views
Project Phase II. Login New User Email UserName with Password Before Class Thursday. Login. Public Function Login( ByVal UserName As String, ByVal Password As String ) As String Return Value:
E N D
Project Phase II Login New User Email UserName with Password Before Class Thursday
Login Public Function Login( ByVal UserName As String, ByVal Password As String ) As String Return Value: “Admin” : Found admin in database “User” : Found user in database “NotFound” : Not found in database
Badger One/Two Dim UserName, Password, Role As String ‘ Check input to get UserName and Password ‘ Role = Login( UserName, Password ) Role = UserName If Role = “Admin” Then ‘ Accessing all pages Else If Role = “User” Then ‘ Accessing user pages only Else ‘ Error message ‘ Cannot access any pages End If
New User Public Function NewUser( ByVal UserName As String, ByVal Password As String, ByVal FirstName As String, ByVal LastName As String, ByVal Email As String ) As String Return Value: “ExistingUser” : Same UserName found in database “ExistingEmail”: Same Email found in database, optional “UserCreated”: New user created “Sorry” : Database down?
Badger One/Two ‘ Check input to get UserName, Password, FirstName, LastName, Email UserName 6 – 10 Letters, Digits, _ Case sensitive: yes to save, no to compare Password 6 - 20 Any chars, no: ‘ ‘ “ “ , . [ ] { } ( ) $ & SPACE ! Case sensitive: yes
Badger One/Two ‘ Check input to get UserName, Password, FirstName, LastName, Email Dim Result As String ‘ Result = NewUser(UserName, Password, FirstName, LastName, Email) Result = UserName If Result = “ExistingUser” Then ‘ Error message Else If Result = “ExistingEmail” Then ‘ Send username and password Else If Result = “UserCreated” Then ‘ Go to user pages Else ‘ Come back later End If
Email UserName with Password Public Sub GetUser (ByVal Email As String, ByRef UserName As String, ByRef Password As String ) If not found, set UserName and Password to “”
Badger One/Two ‘ Check input to get Email Dim UserName, Password As String GetUser (Email, UserName, Password) If UserName <> “” and Password <> “” Then Send email Else ‘ Email not found
Badger One/Two Ajax Java Script VB or C#?