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  |  

PortalWebHosting
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Webhost4Life - $4.95 Windows Hosting
 


  Sponsors  

Meet Our Sponsors

Mad Development is a full service interactive agency focusing on the merge of design, technology, e-commerce, and affiliate marketing by providing total website solutions.
MadCap Software, Inc.
AspDotNetStoreFront - E-Commerce by Design - The Leading ASP.NET shopping cart platform for developers!
Click here to go to dev.live.com for Windows Live developer resources
SteadyRain
DataSprings - Great Ideas. Always Flowing.
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Adding a role to a user programatically.
Previous Previous
 
Next Next
New Post 1/28/2008 2:02 PM
User is offline cathal connolly
2375 posts
www.cathal.co.uk
5th Ranked










Re: Adding a role to a user programatically. 

no, the cookie will be automatically created if it doesn't exist but the user is logged in. During login dotnetnuke creates the portalroles cookie to store the user role(s) in it. This cookie has a lifetime of 1 minute, ensuring it never get's too stale. The existance of the cookie is checked for on each page refresh and it's repopulated automatically if the user is still logged in. The redirect is necessary as you need a new page request to be processed.

I've just realised that you probably need to ensure the user values aren't also in cache currently and remove them if necessary e.g.

Dim objUser As UserInfo = UserController.GetCachedUser(_portalSettings.PortalId, Context.User.Identity.Name)

'Remove user from cache
                    If objUser IsNot Nothing Then
                        DataCache.ClearUserCache(_portalSettings.PortalId, Context.User.Identity.Name)
                    End If
                    ' Redirect browser back to home page
                    Response.Redirect(Request.RawUrl, True)
                    Exit Sub

 
New Post 1/29/2008 6:43 AM
User is offline Gregg Froelich
17 posts
10th Ranked


Re: Adding a role to a user programatically. 

Awesome, i think that's what i was looking for.  I will try that. 

Thanks for all of your help.

Gregg

 

 
New Post 1/29/2008 7:46 AM
User is offline Gregg Froelich
17 posts
10th Ranked


Re: Adding a role to a user programatically. 

Ok, one more thing...

Is there a way to remove the user cache in dnn 3.x?  ClearUserCache doesn't not show up in datacache.  DataCache has the removecache, clearportalcache, cleartabcache options.  Any suggestions?

I'm in the process of updating the web app to use dnn 4.x, but haven't got there quite yet.

Gregg

 

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Adding a role to a user programatically.
 


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.

 


Bring2mind
Document Centric DNN Module Solutions
www.bring2mind.net
WEBPC™ DotNetNuke® sites for Small Business
WEBPC™ are internet consultants and web hosters catering to the small business market.
www.webpc.biz
Perpetual Motion Interactive Systems Inc.
A solutions company specializing in Microsoft enterprise technologies.
www.perpetualmotion.ca

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