Long ago somebody on our team developed a bunch of InfoPath forms that used the following code to figure out who the user is:
somevariable = Environment.UserName
works and is simple, but causes a lot of security issues depending on how the user's pc is setup. Also makes it necessary to add the URL to IE security.
Now these forms ...