Is there a way to determine which user has logged on to the LM.
Would like to change the value of an Object to identify which user is logged in, so that various controls can be set to Read-Only depending on which user has logged on.
I have a script that enable and disable objects, so just need the bit to find the user ?
Thanks for help engineer1 grp.write('1/1/1',1) engineer2 grp.write('1/1/1',2)
09.06.2020, 10:25 (This post was last modified: 09.06.2020, 10:27 by Erwin van der Zwart.)
Hi,
Run this script to create the user.lp inside the user ftp folder:
Code:
123456789101112
-- use this path for request: http://192.168.0.10/user/user.lp-- make sure to enable password for the user folder in the user access settings otherwise it shows 'anonymous'dst = '/www/user/user.lp'io.writefile(dst, [[<?require('apps')clientuser = request.username or 'anonymous'print(clientuser)?>]])
script.disable(_SCRIPTNAME)
Then use this in your custom JS to fetched the logged in user: