Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: 1c3m4n on October 15, 2010, 11:50:24 pm

Title: Determine user
Post by: 1c3m4n on October 15, 2010, 11:50:24 pm
Hi,

i get the currently logged in user by using the command

Code: [Select]
repository.GetCurrentLoginUser(false);
Is it possible to determine the forename and surname of this user?

Have a nice weekend.

Florian
Title: Re: Determine user
Post by: Geert Bellekens on October 16, 2010, 12:52:48 am
Florian,

I think the only way is to query the t_secuser table.
You can use Repository.SQLQuery to execute a query to the database.

Geert
Title: Re: Determine user
Post by: 1c3m4n on October 18, 2010, 05:34:08 pm
Hi Geert,

thank you for your answer. Can you please specify what i need to write in the SQL string parameter of the SQLQuery function.

Thanks.

Florian
Title: Re: Determine user
Post by: Geert Bellekens on October 18, 2010, 05:56:20 pm
Something like
Code: [Select]
"Select u.FirstName, u.Surname from t_secuser u
where u.UserLogin = '" + loginVariable + "'"
should do the trick.

Geert
Title: Re: Determine user
Post by: 1c3m4n on October 18, 2010, 06:21:05 pm
It works !

Thank you !

Florian