Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Chris Mahoney 242 posts 454 karma points
    Jul 08, 2013 @ 03:25
    Chris Mahoney
    0

    Get current user ID

    Hi,

    I have a feedback form that I've built in Contour 3.0.12 and I'd like to record the current user's details (e.g. name or network logon - it's an internal site). We have another internal site that I didn't develop where this is all working; there's a field on the form with the default value set to [%UserID].

    I've set a default value of [%UserID] on my form but the field still shows up blank. After comparing the Web.config across both sites, I've made a few changes to my <system.web> section:

    I've added <identity impersonate="true" />
    I've changed <allow users=?" /> to <deny users="?" /> in the <authorization> section
    I've changed <authentication mode="Forms"> to <authentication mode="Windows">

    I've also added the following to <system.webServer>:

    <security>
    <authorization>
    <add accessType="Deny" users="?" />
    </authorization>
    </security>

    That seems to cover everything authentication-related in Web.config so I'm not sure where else to look. Google isn't finding much when I search for "umbraco contour [%userid]" so I'm at a bit of a loss as to where to go now. I've probably missed something simple; can anyone tell me what?

    Thanks :)

  • Comment author was deleted

    Jul 08, 2013 @ 13:27

    Hmm looks like they are fetching the UserID session variable so that needs to be populated...

    Contour should store the member id by default if you are using Umbraco members...

  • Chris Mahoney 242 posts 454 karma points
    Jul 08, 2013 @ 23:45
    Chris Mahoney
    0

    Aha! I didn't realise that [%UserID] was something custom so I hadn't been looking in the right place. I found a staff DLL plus a UserID.xslt which I copied onto my new site and it's all working now. I probably "should" be using members but at the moment I'm just happy to have it working.

    Thanks :)

  • Comment author was deleted

    Jul 09, 2013 @ 13:00

    Ok glad it's working now :)

Please Sign in or register to post replies

Write your reply to:

Draft