Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

I would like to get the user name of the computer. Is it possible?

Avatar

Level 4

Hi guys!

Is there some function I can to get the user name of the computer that is using/opening my form?


I would like to surprise the user, greeting your name on the form

Thanks!

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi Rafael,

It can be done, but you will need to work within Adobe's security policy. It is considered a security risk for the form to use script to harvest information about the computer user. You need to use a trusted function, which is inside a JavaScript file (.js file). This .js file is then placed in a specific folder on every computer using the form.

See a thread and examples here: Re: Keep user from printing and seeing certain pages

This can be very difficult to maintain and you will run into problems if the form is Reader enabled in Acrobat.

Overall, it cna be done, but is a pain and if you form is going to be used on many computers (outside of your control), then it is probably not worth the effort.

Good luck,

Niall

Assure Dynamics

View solution in original post

3 Replies

Avatar

Level 4

Hi.

I found out this script em javascript. It works very well on browser, but I cant to do it works on Adobe LiveCycle

  1. <html> 
  2.     <head> 
  3.         <script language="javascript"
  4.         function mostra() { 
  5.                 var wshShell = new ActiveXObject("WScript.Shell"); 
  6.                 var usuario = wshShell.ExpandEnvironmentStrings("%USERNAME%"); 
  7.                 alert(usuario); 
  8.         } 
  9.         </script> 
  10.     </head> 
  11.     <body> 
  12.         <form><input type="button" value="Teste" onclick="mostra();"/></form> 
  13.     </body> 
  14. </html> 

Avatar

Correct answer by
Level 10

Hi Rafael,

It can be done, but you will need to work within Adobe's security policy. It is considered a security risk for the form to use script to harvest information about the computer user. You need to use a trusted function, which is inside a JavaScript file (.js file). This .js file is then placed in a specific folder on every computer using the form.

See a thread and examples here: Re: Keep user from printing and seeing certain pages

This can be very difficult to maintain and you will run into problems if the form is Reader enabled in Acrobat.

Overall, it cna be done, but is a pain and if you form is going to be used on many computers (outside of your control), then it is probably not worth the effort.

Good luck,

Niall

Assure Dynamics

Avatar

Level 4

Hi.

How are you?

Thanks for information. So I think is better doesn't use it.

See you!