Topic: Presenting user data

How can I present user data on a form like:

Username :  admin
Userrole    :  admin
Last loging:  02-12-2020
etc.

Application.User.Username;
Application.User.Email;
Application.User.First_name;
Application.User.Last_name;
Application.User.Role;
Application.User.RoleId;
Application.User.is_admin;
Application.User.is_active;
Application.User.is_logged;
Application.User.Last_login;
Application.User.Date_joined;

Re: Presenting user data

Hello kees.krause

It lacks details
Is it a question to simply create the form that will contain all these fields?
Is it something more complex?
Is the table already created?

JB

Re: Presenting user data

Hallo Jean, thanks for your reaction. Yes it is very simple. II just want present some of the information from the table “_user “ (part of user&rules). I tried the script entry: “form1.label1.caption := _user.role” to present the role on form1, but it did not work. Can you help me?

Re: Presenting user data

Maybe this is what you are looking for

form1.label1.caption := Application.User.Role;

Application.User do handle the details of logged in user.

brian

5 (edited by derek 2020-11-27 21:17:21)

Re: Presenting user data

Hi Kees, Jean, Brian,
Yes, agree with the others - do it something like in the attached (userid = Kees, Password = kees).  I've done it as a label, as per your earlier post, but it's just the same if you use a separate form or a pop-up panel etc.
If I remember correctly (which I don't too often these days - LOL!), 'application.user.xxxxxx' was introduced in 6.3, so if you're using an earlier version, I think you need to just use 'user.xxxxx'.
Stay safe,
Derek.

Post's attachments

Attachment icon applicationuser.zip 336.05 kb, 333 downloads since 2020-11-27 

Re: Presenting user data

Hello Derek. I do not know what your attached example does. Can you please gif some more info

Re: Presenting user data

Kees,


Quite simply Derek's program shows you how to use the application.user.xxxxx . In his example he has attached them to a label, you could instead display them in a form caption or an edit box.


Your question was , "How can I present user data on a form?", and Derek's program shows you one way of doing this. I assume you have run his program.


I take it from your question, that you are wanting to do more than just display a user on a form or are you wanting display a selection of users?


I suggest if you need an answer closer to your requirements either attach your program so far to a post and state what it is you are hoping to achieve or explain more precisely what it is your are trying to do.

On a clear disk you can seek forever

Re: Presenting user data

Sorry Derek and CDB, I am so stupid. I did not look at Derek's application, but at an other. It works.