Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

Affordable ASP.NET Hosting Service
  Ads  
r2i.ntegrated
 


  Sponsors  

Meet Our Sponsors

WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
Salaro -- Skins and more
OnyakTech
CrystalTech Web Hosting™
Webhost4life, specialists in DNN hosting
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Help changing user role without logging out.
Previous Previous
 
Next Next
New Post 9/20/2006 2:43 PM
User is offline Guillermo Jordan
3 posts
10th Ranked


Help changing user role without logging out. 

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/20/2006 10:24 PM
User is offline workcontrol
124 posts
www.workcontrol.com
9th Ranked


Re: Help changing user role without logging out. 

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 8:00 AM
User is offline Guillermo Jordan
3 posts
10th Ranked


Re: Help changing user role without logging out. 

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 9:10 AM
User is offline Guillermo Jordan
3 posts
10th Ranked


Re: Help changing user role without logging out. 

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 Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Help changing user role without logging out.
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


UK DotNetNuke CMS installation, hosting & support
UK based installation, branding, customising, integration, hosting, training, support and maintenance services for DotNetNuke
www.deburca.co.uk
Need Help with your DotNetNuke website?
Jango Studios offers exclusive DotNetNuke Skin Design, Module Development, Web Marketing and Web Hosting.
www.jangostudios.net
Where Every Home is an Investment
Where Every Home is an Investment
www.nestbrokers.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP