1
Vote

Problem when User Profile Service is enabled

description

When User Profile Service is enabled and you try to log in with a user who has a profile, the following method throws an exception:
 
    public void SetCurrentUser(string userName)
    {
        CurrentUser = Users.Where(usr => usr.Name.ToLower() == userName.ToLower()).FirstOrDefault();
        if (CurrentUser == null)
            throw new Exception("Unknown current user.");
 
        Common.Filters = ListFilters.GetFilters();
    }
 
 
The usr.Name contains the full name (Firstname Lastname) and not the login name.

comments