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  |  

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


  Ads  
 


  Sponsors  

Meet Our Sponsors

Portal Webhosting - Hosting For Developers
Red-Gate Software
MaximumASP
SourceGear - Tools for Developers
.: CounterSoft :.
telerik
 


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
2377 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.

 


OnyakTech
Modules for Help Desks, Live Chat, Project Management, CRM, Charting, Reporting, Scrolling Text/Images, Portal Community tools and much more.
www.OnyakTech.com
IHostASP.NET Provides the Ideal DNN Hosting
We will help you with the installation, configuration, and troubleshooting of your DNN portal, no task is too big or small for us. Unlike other companies we are not just providing a reliable hosting service, but we are also focused on providing the best DotNetNuke hosting service on the internet.
www.ihostasp.net
$7.16/mo - Powerful DotNetNuke Hosting
Powerful DotNetNuke Hosting starting at under $8/mo with FREE SQL 2005, FREE Installation and expert support.
www.re-invent.com

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