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.0Problem Getting GetRolesByUser.PortalIDProblem Getting GetRolesByUser.PortalID
Previous
 
Next
New Post
1/12/2009 10:23 AM
 

I have encountered a problem that is driving me crazy.  I'm running DNN 04.08.02.

When I Dim mRoles As New DotNetNuke.Entities.Users.OnlineUserInfo

and then query mRoles.PortalID I get 0 ... which would be fine if I were logged-into portal 0 ... but I'm logged into PortalID 26!  I get this same result whether I am the HOST account or whether I am myself (an administrative account.)

Am I doing something wrong, or is there a known bug in this release, or is there some other reason (that totally escapes me) why this is not working?

 
New Post
1/12/2009 10:31 AM
 

Hey Bryan,

When you're logged in as yourself - what portals does your user have access to? (you can query the UserPortals table to find out). I'm not sure what the behavior here is if you're in multiple portals.

As for the host user - I don't think that particular account has an entry in UserPortals.

Take care,

Ian


Software Engineer
Co-Founder, dnnGallery
Stack Overflow: Ian Robinson
Twitter: @irobinson
Linked In: Ian Robinson
 
New Post
1/13/2009 3:15 PM
 

This user has access to 16 different portals on the installation according to the UserPortals table.  Now the ironic thing is that I also used to have access to PortalID=0 but thought that might be causing the problem so I removed myself from that portal.  (So I am getting a 0 even though my account doesn't even have access to PortalID 0.)

 
New Post
1/14/2009 10:17 AM
 

Hey Bryan,

Do you have the "users online" functionality enabled? I think the property you are using is only populated when that is turned on - and it also looks like its turned off by default. There are other ways to grab the user's current portal ID that may be a little more straight forward - using the UserInfo object from PortalModuleBase may be a good alternative.

Take care,

Ian

 


Software Engineer
Co-Founder, dnnGallery
Stack Overflow: Ian Robinson
Twitter: @irobinson
Linked In: Ian Robinson
 
New Post
1/14/2009 10:21 AM
 

Hey Bryan,

Upon closer inspection, I'm really not sure what exactly you're having trouble with. Let me know if that has anything to do with your question or if that was a typo.

Firstly, in the subject you mention "getrolesbyuser.portalid" - and in the body you mention OnlineUserInfo.PortalId. If you're actually using the code you put in your body, its no wonder the PortalId resolves to 0 - you're creating a _new_ instance of OnlineUserInfo and then asking what the portal ID is - and it'll be 0 until you set it to something else.

Sorry for the confusion on my part :)

Take care,

Ian


Software Engineer
Co-Founder, dnnGallery
Stack Overflow: Ian Robinson
Twitter: @irobinson
Linked In: Ian Robinson
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Problem Getting GetRolesByUser.PortalIDProblem Getting GetRolesByUser.PortalID


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