[SOLVED] $user in debug

Author: alessandro.brena@cortislentini.it (brenaa)

Hello to all, debugging a client server environment $user returns the login user (in this case "userver"). Debugging a Uniface Web Service $user returns "USER" and not "userver" how defined in web.xml. This is the web.xml configuration:        <Param-value> UV8: ServerName + 13001 | domainName\UserName|Password|ewebdbg </ param-value> where UserName is "userver". Can anyone explain to me why? thank you Alessandro

5 Comments

  1. Hello Alessandro, The function $user is working a bit different in a web environment: > Uniface Reference > Proc: Functions > $user:

    In a Web environment, if Path is omitted, $user returns:

    Authenticated user name used when connecting to the Web server

    Empty string (""), if no user authentication has taken place between server and browser or if there is a license problem

    (Within the Web environment, Uniface does support spaces in user names; this is handled by the authentication process.) I guess you are not using any authentication. Not sure why $user is not empty in this case. Luckily there is another way to get the user name of the current process: $processinfo("user") If I remember correctly then the mentioned function was introduced with the version 9.4.01 patch R110. I hope this helps. Kind regards, Daniel


    Author: diseli (daniel.iseli@uniface.com)
  2. Thank you Daniel, $processinfo(“user”) returns the right user. I have another problem with PdfCreator and I thought it depended on it. I will open another discussion about it. Regards, Alessandro


    Author: brenaa (alessandro.brena@cortislentini.it)
  3. Hello Alessandro, Thank you for your reply. And you are welcome. I'll set this post to solved now. Regards, Daniel


    Author: diseli (daniel.iseli@uniface.com)
  4. diseli said Luckily there is another way to get the user name of the current process: $processinfo("user") If I remember correctly then the mentioned function was introduced with the version 9.4.01 patch R110.  

    Okay, you got the pure user name But what about the domain the user belongs to, any way to get this information ? Ingo


    Author: istiller (i2stiller@gmx.de)
  5. Hi Ingo, Uniface currently has no statement or function to retrieve the user domain. But on Windows there are other possibilities: You could (for example) use the WshNetwork Object that is part of the Windows Scripting Host. It can be accessed using the COM Call-out interface. The mentioned object provides a property to retrieve the user domain. You can import the COM signatures for the WshNetwork Object as follows: > idf.exe /sti /mwr=com /pid WScript.Network After import you should find a COM signature called WSHNETWORK and (amongst others) a operation called GET_USERDOMAIN. Hope this helps. Daniel


    Author: diseli (daniel.iseli@uniface.com)