Archi Forum

Archi Plug-ins => jArchi => Topic started by: JoCriSem on May 25, 2020, 11:13:02 AM

Title: Exporting current logged on user
Post by: JoCriSem on May 25, 2020, 11:13:02 AM
Hi, is there a way to export the current logged on Windows user to a variable so that info can be used in a "created by" note on a view?
Quite a newbie in JS and jArchi.

Txs.
Title: Re: Exporting current logged on user
Post by: Jean-Baptiste Sarrodie on May 25, 2020, 12:24:03 PM
Hi,

You can get the current logged in user through java.lang.System:

var System = Java.type('java.lang.System');
console.log(System.getProperty("user.name"));


Regards,

JB
Title: Re: Exporting current logged on user
Post by: JoCriSem on May 25, 2020, 13:06:09 PM
Super, thanks.  Works perfectly.