Hi all... new here but hoping maybe someone has had a similar issue to mine.
Some of the users of my Portal are experiencing login problems when using Internet Explorer. I've seen the problem on IE 5.5 (win2k), IE 7 & 8 (XP and Vista), but on the majority of machines there is no problem. On the machines that do not work, Google's Chrome also does not work but Firefox does work fine. Any thoughts about what I could do would be very very very appreciated...
My Login structure is a bit strange tho:
My DNN Users are actually a mirror of User accounts from an external site. My auto-Login script updates (or creates) a User, their Profile and their Roles based on a QueryString value passed from the external site.
The login script runs and is successful, but when it forwards the user to the homepage, they get kicked back to the login screen.
My Login process is as follows:
1) Check for a proper QueryString value and the presence of the User in the external database
2) Save the pertinent user information in string variables (username, password, external site UserID, a list of RoleIDs, and one other bool value) and attempt to create a User object (DotNetNuke.Entities.Users.UserInfo objUserInfo = DotNetNuke.Entities.Users.UserController.GetUserByName(PortalId,strUserName);)
3) If the User object is found, the password is updated (bool blnUpdatePassword = DotNetNuke.Entities.Users.UserController.ChangePassword(objUserInfo, strOldPassword, strPassword);)
3) If the User object is not found, a new User is created:
objUserInfo = new DotNetNuke.Entities.Users.UserInfo();
objUserInfo.Username = strUserName;
objUserInfo.Membership.Password = strPassword;
objUserInfo.PortalID = PortalId;
objUserInfo.Email = reader.GetValue(reader.GetOrdinal("Email")).ToString().Trim();
objUserInfo.FirstName = reader.GetValue(reader.GetOrdinal("FirstName")).ToString().Trim();
objUserInfo.LastName = reader.GetValue(reader.GetOrdinal("LastName")).ToString().Trim();
objUserInfo.DisplayName = reader.GetValue(reader.GetOrdinal("FirstName")).ToString().Trim() + " " + reader.GetValue(reader.GetOrdinal("LastName")).ToString().Trim();
DotNetNuke.Security.Membership.UserCreateStatus objUserCreateStatus = DotNetNuke.Entities.Users.UserController.CreateUser(ref objUserInfo);
4) The Profile Properties for the User are then created:
ProfilePropertyDefinitionCollection ppdc = UserInfo.Profile.ProfileProperties.GetByCategory("MyCategory");
ProfilePropertyDefinitionCollection myProps = ProfileController.GetPropertyDefinitionsByCategory(PortalId,"MyCategory");
UserInfo.Profile.ProfileProperties.AddRange(myProps);
ppdc = UserInfo.Profile.ProfileProperties.GetByCategory("MyCategory");
5) ...and values assigned:
for (int i = 0; i < ppdc.Count; i++)
{
string strName = ppdc.PropertyName;
ProfilePropertyDefinition ppd2 = objUserInfo.Profile.ProfileProperties.GetByName(strName);
switch (strName)
{
case "PropName":
ppd2.PropertyValue = myValue;
break;
etc, etc...
}
UserInfo.Profile.SetProfileProperty(strName, ppd2.PropertyValue);
ProfileController.UpdateUserProfile(objUserInfo, objUserInfo.Profile.ProfileProperties);
}
6) Roles to which the User is assigned in DNN but not the external site are removed:
DotNetNuke.Security.Roles.RoleController rc2 = new DotNetNuke.Security.Roles.RoleController();
while (reader.Read())
{
rc2.DeleteUserRole(PortalId, UserId, Int32.Parse(reader.GetValue(0).ToString()));
}
7) Roles to which the User is assigned in the external site but not DNN are added:
while (reader2.Read())
{
DateTime dt = new DateTime();
rc2.AddUserRole(objUserInfo.PortalID, objUserInfo.UserID, Int32.Parse(reader2.GetValue(0).ToString()), dt);
}
8) The User is logged in:
string strPortalName = DotNetNuke.Entities.Portals.PortalSettings.Current.PortalName.ToString();
DotNetNuke.Entities.Users.UserController.UserLogin(objUserInfo.PortalID, objUserInfo, strPortalName, Request.ServerVariables["REMOTE_ADDR"].ToString(), true);
9) The logged in user is forwarded to the homepage: Response.Redirect("~" + strDirect);
a million thanks... |