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  |  

AppTheory specializes in solutions based on the DotNetNuke platform and has 2 employees on the DotNetNuke Core Team.
  Ads  
Iron Speed Designer is a software development tool for building database, reporting, and forms applications for .NET without hand-coding.
 


  Sponsors  

Meet Our Sponsors

Verndale
The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
Red-Gate Software
MaximumASP
SourceGear - Tools for Developers
 


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.

 


Module Development by Engage Software
Specializing in custom module development, training and skinning.
www.engagesoftware.com
BataviaSoft DotNetNuke Solutions
BataviaSoft offers custom DotNetNuke solutions especially for the European and the South East Asian market.
www.bataviasoft.com
Viva Portals, L.L.C.
Expert module development and graphic design.
www.continure.com

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