help in making a Log-in system

guys, i am a begginer in delphi 7 and i am currently working on a project where in a user will log in and an application at the server will let the administrator know that this particular user has logged in.

How do i do this in delphi 7? where can i get resources related to this topic/project?

Somebody help!

Comments

  • I am very new to Delphi but my first project required that I do something close to what you are doing.

    Here is the code I ended up with, I hope it helps there is most likely a better way to write this but for me it works.

    As far as notification when some one logs in I would write to an active users table and have a small app monitor that table.

    [color=Blue]procedure TForm1.bloginMouseDown(Sender: TObject; Button: TMouseButton;
    Shift: TShiftState; X, Y: Integer);
    begin
    mySQLTable1.Active := true;
    pass := '';

    if MySQLTable1.locate('UserName',vuser.text, []) then
    LUserID:=mySQLTable1.FieldByName('UserName').asString;
    pass:=mySQLTable1.FieldByName('UserPassword').asString;
    LTheme:=mySQLTable1.FieldByName('Theme').asString;
    LThemeSup:=mySQLTable1.FieldByName('ThemeSup').asboolean;
    LRights:=mySQLTable1.FieldByName('UserRights').asString;

    if (pass = vpass.text) and (LUserID = vuser.text) then
    begin
    if LRights = 'True' Then
    begin
    TStatusBar1.Panels[0].text := 'Welcome ' + LUserID;
    TButton2.show;
    vbcreate.Show;
    vbpref.Show;
    vbview.Show;
    blogin.hide;
    vuser.hide;
    TLabel1.hide;
    vpass.hide;
    TLabel2.hide;
    TStatusBar1.Panels[0].text := 'Welcome ' + LUserID;
    mySQLTable1.Active := false;
    end;

    if LRights = 'False' Then
    begin
    TButton2.show;
    vbcreate.Hide;
    vbpref.Show;
    vbview.Show;
    blogin.hide;
    vuser.hide;
    TLabel1.hide;
    vpass.hide;
    TLabel2.hide;
    mySQLTable1.Active := false;
    end;
    end;
    if (pass <> vpass.text) or (LUserID <> vuser.text) then
    begin
    TStatusBar1.Panels[0].text := 'Incorrect user name or password!';
    end;
    end;[/color]
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion