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?
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)
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:
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
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
Thanks tom, GetUserID was the one to do it.
Pete
is working on a reply...