Building a Server Application for an Internet Cafe
If you're building an Internet access control application, such as you might find in an Internet cafe, you can't do it without some way to keep track of the staff members who log users into the computers. This article, the second part of a six-part series that covers the entire application, will deal with user authentication, including the setting up of a database to track the important information.
Building a Server Application for an Internet Cafe - User Authentication (Page 2 of 4 )
Now that we know what the database and its table looks like, let's take a look at user authentication. This application is the gateway to the server. If you are successfully authenticated, you will be redirected to the server application; otherwise you will be asked to re-enter your details.
It is also important to realize that this part of the server application was not created for security purposes; instead it was implemented for employee management, so to speak. So if you want to add security code to this application, please do; the application itself is general enough for you to do so. Below is a screen shot of what the login application looks like when you start up the server application:
And here is the message that appears if your login name or password is incorrect:
The login application has only one form, the one in the image above, and it is the only UI that you will see for as long as you are not authenticated. It is also the only form that has database components in the entire setup. So, to build it is very easy -- simply add a TADOQuery, a data source component, two buttons and two edits to the form and resize it so that it resembles the one in the image above. Below is the code outline for the entire application: