Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Help changing user role without logging out.Help changing user role without logging out.
Previous
 
Next
New Post
9/20/2006 4:43 PM
 

I am using version 4.0 of DDN and we created a password change module.  We don't want the user to be able to see the rest of the site unless he changes his password.  So our current solution involves assigning the user a specific role that only sees the password change module and after he changes his password, then we change his role to the role that is allowed to see the rest of the site, but the problem we are facing is that it seems that the user has to log out before the new role takes place.  The question is, how can I change the user's role without making him log out?

Thanks

 
New Post
9/21/2006 12:24 AM
 

Do you reload the page after you assign the user to new role?

Something like this:

Response.Redirect(NavigateURL())

 


Robert Tango
www.workcontrol.com
Custom Modules: UserManager|UserDirectory|UserImport|PortalSSO
 
New Post
9/21/2006 10:00 AM
 

Yes...at the end of the function, we reload the page.  Here is the code.

Private Sub ChangeUserRole()

dim roleInfo as new Security.Roles.RoleInfo

dim rc as new Security.Roles.RoleController

'Get the role Information

roleInfo = rc.GetRoleByName(PortalId,"RoleName")

'Assign role to the user

rc.AddUserRole(PortalId, UserId, roleInfo.RoleID, Nothing)

rc.SynchronizeRoles(PortalId)

Response.Redirect( NavigateURL())

End Sub

 

Thanks.

 
New Post
9/21/2006 11:10 AM
 

Never mind.  We found the solution.  We just had to expire the cookies, and automatically the new role is in effect using:

Response.Cookies.("portalroles").Expires = DateTime.Now.AddDays(-1)

Response.Cookies.(".ASPXROLES").Expires = DateTime.Now.AddDays(-1)

Thanks.

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Help changing user role without logging out.Help changing user role without logging out.


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out