Delphi-Kylix
  Home arrow Delphi-Kylix arrow Page 4 - Building a Server Application for an Inter...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DELPHI-KYLIX

Building a Server Application for an Internet Cafe
By: David Web
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2008-08-25

    Table of Contents:
  • Building a Server Application for an Internet Cafe
  • User Authentication
  • Code Explained
  • Code explanation continued

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Building a Server Application for an Internet Cafe - Code explanation continued


    (Page 4 of 4 )

    Now we need to update form1 and its variables. Form1 is the main server interface where we will allocate sessions for clients. The first update we make is to display the name of the just-logged-in staff member in the form's caption:

    form1.caption:='iCafeStation 1.0 - Current user: '+q.fieldbyname('username').Text;


    Then we set the access level of the staff member, which will either be admin or normal and we also set the userid:


    form1.level:=q.fieldbyname('Alevel').Text;

    form1.uid:=q.fieldbyname('iud').AsInteger;


    Now, staff with an access level of "normal" will not have access to certain parts of the application, such as the application settings and the ability to add new staff members. These privileges are reserved for staff members with "admin" status. This is where those restrictions are set:

    if form1.level = 'Normal' then begin

    form1.Settings1.Enabled:=false;

    form1.newOp.Enabled:=false;

    end;

    Then the logon screen is made invisible. We cannot close down the logon screen because if we do, then the entire server application will be terminated and that's not what we want to do at this stage:

    form3.Visible:=false;


    We then show the main server screen available, by showing form1:


    form1.show;


    and then clear the entries in the logon screen:

    uname.Clear;

    upass.Clear;

    isLogon:=true;

    end

    The next part of the authentication process deals with what happens when the staff member enters incorrect logon credentials. First we check to see if the recordcount is less than one:

    else

    begin

    if q.recordcount < 1 then begin

    If the recordcount is indeed less than one, then it means that the staff member details could not be found in the database, so the user is informed of this:

    MessageDlg('Your Username or password is not found, please try again.', mtInformation,

    [mbOk], 0);


    Then the username and password fields are cleared:


    uname.Clear;

    upass.Clear;

    end;

    end;

    end;

    Conclusion

    That's it for the authentication application. I would like to emphasis that it is not written with security in mind, but rather for staff management. In the next article we will discuss the main server interface and also the user management module.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

     

    DELPHI-KYLIX ARTICLES

    - Loading an XML Document into the DOM
    - Delphi Wrapper Classes and XML
    - Delphi and the DOM
    - Delphi and XML
    - Internet Access: Client Service
    - Finishing the Client for an Internet Access ...
    - The Client for an Internet Access Control Ap...
    - User Management for an Internet Access Contr...
    - Important Procedures for an Internet Access ...
    - Server Code for an Internet Access Control A...
    - Constructing the Interface for an Internet A...
    - Building a Server Application for an Interne...
    - Building an Internet Access Control Applicat...
    - Client Dataset: Working with Data Packets an...
    - Using the Client Dataset in an N-Tiered Appl...







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek