Home arrow Delphi-Kylix arrow Page 2 - User Management for an Internet Access Control Application
DELPHI-KYLIX

User Management for an Internet Access Control Application


In this part of the Internet access control application, we are going to discuss the last section of the server application that deals with user management. The term "user management" is somewhat misleading in the context of our application because it is not actually users of the Internet café that we are referring to, but rather the staff members. This section will deal with how staff members allocate Internet sessions to users and also how staff members with administration level access can add, remove and change new staff member details.

Author Info:
By: David Web
Rating: 5 stars5 stars5 stars5 stars5 stars / 4
September 22, 2008
TABLE OF CONTENTS:
  1. · User Management for an Internet Access Control Application
  2. · User Management Module
  3. · User Management Module Explained
  4. · Stats Page

print this article
SEARCH DEVARTICLES

User Management for an Internet Access Control Application - User Management Module
(Page 2 of 4 )



The user management module has the following options:

  • Add new user

  • Change user password

  • View user profile (not implemented)

The “add new user” option allows an administrator to add a new staff member to the database. This procedure essentially sends the new staff member's name, username, password and access level to the database. The code below demonstrates how this is achieved:

unit newUser;


interface


uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls, Buttons, DB, ADODB;


type

TForm6 = class(TForm)

edname: TEdit;

StaticText1: TStaticText;

StaticText2: TStaticText;

StaticText3: TStaticText;

StaticText4: TStaticText;

StaticText5: TStaticText;

cb: TComboBox;

edupass2: TEdit;

edupass: TEdit;

eduname: TEdit;

BitBtn1: TBitBtn;

BitBtn2: TBitBtn;

ado1: TADOTable;

procedure BitBtn1Click(Sender: TObject);

procedure FormShow(Sender: TObject);

procedure ado1AfterPost(DataSet: TDataSet);

private

{ Private declarations }

public

{ Public declarations }

end;


var

Form6: TForm6;


implementation


uses Logon;


{$R *.dfm}


procedure TForm6.BitBtn1Click(Sender: TObject);

begin

if (edname.Text = '') OR (eduname.Text = '') OR (edupass.Text = '') OR (edupass2.Text = '') OR (edupass.Text <> edupass2.Text) then begin

messagedlg('Please ensure that you fill in all the fields and that the password fields are the same.',mtInformation,[mbOK],0);

exit;

end

else begin

ado1.TableName:='users';

ado1.Active := True;

ado1.Insert;

ado1.FieldByName('name').AsString := edname.Text;

ado1.FieldByName('username').AsString :=eduname.text;

ado1.FieldByName('password').AsString := edupass.text;

ado1.FieldByName('Alevel').AsString :=cb.Text;

ado1.Post;

end;

end;


procedure TForm6.FormShow(Sender: TObject);

begin

form3.q.close;

form3.q.SQL.Text:='SELECT * from Levels';

form3.q.Open;

while not form3.q.Eof do begin

cb.Items.Add(form3.q.fieldbyname('level').AsString);

form3.q.Next;

end;

end;


procedure TForm6.ado1AfterPost(DataSet: TDataSet);

begin

messagedlg(edname.Text + ' has now been created.',mtinformation,[mbOK],0);

end;


end.



blog comments powered by Disqus
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...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials