Copied to clipboard

Flag this post as spam?

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


  • carlu 42 posts 131 karma points
    Jan 14, 2017 @ 10:28
    carlu
    0

    Umbraco User Information

    Can you help me please to get the Umbraco User Information in Template?

  • Alex Skrypnyk 6182 posts 24284 karma points MVP 8x admin c-trib
    Jan 14, 2017 @ 10:38
    Alex Skrypnyk
    0

    Hi Carlu,

    Do you mean admin user or member?

    Thanks,

    Alex

  • carlu 42 posts 131 karma points
    Jan 15, 2017 @ 10:58
    carlu
    0

    I mean Admin user.

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Jan 15, 2017 @ 10:35
    Dennis Aaen
    0

    Hi carlu

    Try to see Mortens answer in this thread.

    https://our.umbraco.org/forum/developers/api-questions/54120-Check-if-back-office-user-is-logged-in-using-UserService

    Here your will get the current backoffice user and then you can get the data from this.

    Hope this helps,

    /Dennis

  • carlu 42 posts 131 karma points
    Jan 15, 2017 @ 10:58
    carlu
    0

    Thank you

  • carlu 42 posts 131 karma points
    Jan 15, 2017 @ 11:14
    carlu
    0

    Hi Denis,Can you give me suggestion which namespace is required to use above code?

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Jan 15, 2017 @ 11:27
    Dennis Aaen
    0

    Hi Carlu,

    The namespace that you should use when you are using one of the services. https://our.umbraco.org/documentation/Reference/Management/Services/

    Namespace: Umbraco.Core.Services

    Assembly: Umbraco.Core.dll

    The user service is not documented yet.

    Hope this helps,

    /Dennis

  • carlu 42 posts 131 karma points
    Jan 15, 2017 @ 12:05
    carlu
    0

    I finally sloved using @using Umbraco.Core; @using Umbraco.Core.Models.Membership; @using Umbraco.Core.Security;

    var ticket = new System.Web.HttpContextWrapper(System.Web.HttpContext.Current).GetUmbracoAuthTicket(); if (ticket != null) { var userName = new HttpContextWrapper(HttpContext.Current).GetUmbracoAuthTicket().Name;

    }

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies