Get and Check User Domain name - InfoPath Dev
in

InfoPath Dev

Get and Check User Domain name

Last post 02-06-2009 05:10 PM by Hilary Stoupa. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 02-06-2009 01:39 AM

    Get and Check User Domain name

    Hi,

    How can I get and check The domain name where the form is run ?

    I Have designed a template (.xsn) that will be send to my customer (outside the our network domain)

    I want to hide a part of this template (a section) when the customer create a new form, and display it when I open the customer form.

    So I thought that testing the domain at the open event will be the best way to hide this section.

    The problem it's That I don't know how to do that.

    I saw that in the Tool -> Programming -> On Load Event, we can write some code but I'm not so good developper so any help will be welcomed

     

     

  • 02-06-2009 02:59 AM In reply to

    Re: Get and Check User Domain name

    I already find out, in the following post, how to show/hide a control using script :

    http://www.infopathdev.com/forums/t/3267.aspx

    remain how to get and Check Domain name

  • 02-06-2009 08:52 AM In reply to

    Re: Get and Check User Domain name

    nobody has an idea ?

  • 02-06-2009 05:10 PM In reply to

    Re: Get and Check User Domain name

    Well, this will get you the full user name, including the domain, but requires full trust:

    System.Security.Principal.WindowsIdentity.GetCurrent().Name

    So, you'd be able to substring off the domain by getting the info before the '\'. But again, since it would require your form to be full trust, I wonder if it would be worth it.

    What about using user roles? Do you have an AD group that includes all the people who you would want to have *see* the section? You could have a user role that was the default, and hide the section if the user belonged to that role (i.e., a customer) and another role with the people who work at your company... the section will show for them.

    Hilary Stoupa

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.