Copied to clipboard

Flag this post as spam?

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


  • Pete 213 posts 285 karma points
    Feb 09, 2012 @ 11:53
    Pete
    0

    GetUser for users not members (umbraco.providers.UsersMembershipProvider)

    I'm currently using a class to override bool ValidateUser(string username, string password), and using it validation against Active directory, all works fine.

    However i'd like to check if the user exists in the users area first before doing any validation. ( i'm just validating password against AD ).

    So i'm using:

    if (Membership.GetUser(username) == null)
                {
                    return false;
                }

    But when I debug - GetUser doesn't seem to look up the users store, only the members store, even if I have the user added in the users store.

    I would have thought umbraco would be looking up the users from the Umbraco.UserMembership.Provider and not the Members.Membership provider.

    Am I using the correct command to check if a user exists in the users store?

    Pete

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Feb 09, 2012 @ 14:13
    Tom Fulton
    0

    Hi Pete,

    Have a look at umbraco.BusinessLogic.User - this is the class to interact with back-end users.  There's probably a few methods there you can use depending on what you need, maybe GetUserId(lname)

    -Tom

  • Pete 213 posts 285 karma points
    Feb 11, 2012 @ 12:46
    Pete
    0

    Thanks tom, GetUserID was the one to do it.

    Pete

Please Sign in or register to post replies

Write your reply to:

Draft