I've recently upgraded a site from 3.6 to 5.2 and have some legacy custom code that I'm struggling to get working.
Basically to reset a users password on a custom page, the user is deleted and recreated, and then added to the 'Member' role.
To retrieve the user I do the following
UserManager um = Telerik.Sitefinity.Security.UserManager.GetManager("OpenAccessMembership37Provider"
user = um.GetUser(iMemberNumber.ToString());
This works fine and I can delete and recreate the users without any issues.
The problem is when trying to assign the user to the 'Member' role. The site appears to only have one role I can assign users to (Moderators (forums)). I can see this by calling the GetRoleNames on the role manager.
If I go into site administration though, I can see the user belongs to the 'Members' role as part of the OpenAccessMembership37Provider.
I am guessing that my problem is in the instanciation of the role manager. I use GetManager() with no parameter passed in. Passing in the OpenAccessMembership37Provider string (like I do for the user manager) throws an error.
RoleManager roleManager = Telerik.Sitefinity.Security.RoleManager
Role role = roleManager.GetRole("Member");
returns a null for the role object.
Is anyone able to tell me what I might be doing wrong here? Any help much appreciated.