Delphi-PRAXiS
Seite 1 von 2  1 2      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Datenbanken (https://www.delphipraxis.net/15-datenbanken/)
-   -   Delphi Mysql passing Login data to another form (https://www.delphipraxis.net/181781-delphi-mysql-passing-login-data-another-form.html)

drama22 9. Sep 2014 00:00

Datenbank: Mysql • Version: 5 • Zugriff über: Delphi xe5

Delphi Mysql passing Login data to another form
 
i have created 2 forms A login form & A main form i successfully logged in To the main form
here is the code that i use to login

Delphi-Quellcode:
 SQL := Tloginclass.Create;
  try
    SQL.Login:= trim(Usrnm.Text);
    SQL.passwd := trim(passwd.Text);
    if SQl.logins then
     begin
      LoginSuccess := True;
     end
i retrieve and validate logins from a unit class wich is Tloginclass ,,

but now how to i set the data for each user logged in to the main form ?

i try somthing like this after login
Delphi-Quellcode:
Mainform.listusers.Items.Add(SQL.Login);
but this is not logical because this showing only text how the application know the differents between user who loggedin like there is bob and martin and james ,etc are online now and read there user names ? any idea about this iam trying to understand the logic of this concept.


i ask this question on here : http://stackoverflow.com/questions/2...o-another-form

Sir Rufo 9. Sep 2014 00:03

AW: Delphi Mysql passing Login data to another form
 
Crosspost http://stackoverflow.com/questions/2...o-another-form

drama22 9. Sep 2014 00:07

AW: Delphi Mysql passing Login data to another form
 
getting no answer there so i thought posting here will help me more .

Sir Rufo 9. Sep 2014 00:11

AW: Delphi Mysql passing Login data to another form
 
Zitat:

Zitat von drama22 (Beitrag 1271718)
getting no answer there so i thought posting here will help me more .

It is no problem to post the question here too but next time you should add the crosspost link by yourself ;)

drama22 9. Sep 2014 00:15

AW: Delphi Mysql passing Login data to another form
 
Zitat:

Zitat von Sir Rufo (Beitrag 1271719)
Zitat:

Zitat von drama22 (Beitrag 1271718)
getting no answer there so i thought posting here will help me more .

It is no problem to post the question here too but next time you should add the crosspost link by yourself ;)

question updated , any help with it ? ..

mkinzler 9. Sep 2014 05:19

AW: Delphi Mysql passing Login data to another form
 
You could store a reference to the corresponding login intance into the object field of the list element

Dejan Vu 9. Sep 2014 07:12

AW: Delphi Mysql passing Login data to another form
 
Maybe this helps:
Delphi-Quellcode:
Mainform.listusers.Items.AddObject(SQL.Login, SQL);
Now you see the name in the list and have access to the login instance.

BTW: 'SQL' is not a good name for an instance of your TLoginClass. You should not name neither a class nor an instance after its implementation details. It is unimportant how your login class verifies the user.

drama22 9. Sep 2014 15:16

AW: Delphi Mysql passing Login data to another form
 
Zitat:

Zitat von Dejan Vu (Beitrag 1271733)
Maybe this helps:
Delphi-Quellcode:
Mainform.listusers.Items.AddObject(SQL.Login, SQL);
Now you see the name in the list and have access to the login instance.

BTW: 'SQL' is not a good name for an instance of your TLoginClass. You should not name neither a class nor an instance after its implementation details. It is unimportant how your login class verifies the user.

this will only show the text input , thats will not implement the tracking of online users i think i have to use indy udp to allow the users see who is joind to the chat but i have no idea about how to store those user names who logged in

plus also i dont get the point on how to enable/disable some functionality of the application based on the specific user

drama22 9. Sep 2014 15:18

AW: Delphi Mysql passing Login data to another form
 
Zitat:

Zitat von mkinzler (Beitrag 1271724)
You could store a reference to the corresponding login intance into the object field of the list element

is there any example about how that can be done ?

baumina 9. Sep 2014 15:28

AW: Delphi Mysql passing Login data to another form
 
mysql can show you all actually logged-in-users with

SQL-Code:
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST


Alle Zeitangaben in WEZ +1. Es ist jetzt 05:45 Uhr.
Seite 1 von 2  1 2      

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz