You are not logged in.
Pages: 1
Hello everybody,
my task is to post a message in messages database table.
the table contains user_id field.
I create a message on the client side:
var
FClient: TSQLHttpClient;
msg := TMessage.Create;
msg.Text := 'Hello';
msg.user_id := ... ;
FClient.Add(msg, true);
I have user name as FClient.SessionUser.LogonName after FClient.SetUser().
How can I get user's ID if I logged on with User group permission... I can not just Create User from the server by his name because I have no permissions to TSQLAuthUser table.
Does the client-side way exist?
If no, then what is server-side way?
Thanks a lot.
Offline
Thanks for the answer.
After Client.setuser I can get partically filled client.sessionuser.
It has filled name and so... But user.id=0.
How can I get id of current session user and ids of other
users if I have names of users?
User := tuser.create(client, 'logonname=?', [client.sessionuser.logonname]);
Is it possible?
Thanks?
Offline
You do not have access to the ID from the client side.
In fact, LogonName is a primary key also, so you can use this value to identify the user.
For client-side application level information corresponding to the client, you should better use a dedicated table, not TUser/TSQLAuthUser.
Offline
Pages: 1