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

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Is Superuser?Is Superuser?
Previous
 
Next
New Post
11/29/2012 12:01 PM
 

I'd like to modify some of the admin pages in DNN (the ASCX files) to hide sections if the logged in user isn't a SuperUser....but I'm not sure of the syntax. (I do the same with the default.aspx to show messages to logged in users regarding maintenance and upgrades).

For those, I use "If Request.IsAuthenticated".  What would I use to check if the visitor is a SuperUser?  I've tried "If UserInfo.IsSuperUser" but that causes errors (and prevents pages from loading).

 
New Post
11/29/2012 5:43 PM
 
You should really avoid making these sorts of changes to dnn - since they break when you try to upgrade the site.If you have pages that you only want the HOST to see - then the best option would be to move the modules over too pages on the HOST menu. This allow them to continue to operate after a DNN upgrade.I would make the same suggestion regarding alterations to default.aspx - again this is asking for problems. In this case I would suggest adding a custom SKIN OBJECT to your site's skin - and using this skin object to handle the display of any messages your want to display. This way your site remains up to date.With regard to your actual question ... where are you actually trying to add the "if (UserInfo.IsSuperUser)" code. It is making the assumption that UserInfo is populated with current user ... this most likely wont be the case.You should instead be looking at "PortalSettings.Current.UserInfo" this holds the current logged in user context.Westa
 
New Post
11/30/2012 11:27 AM
 
Wes,
With 30+ sites running on our installation of DNN and using different skins (that I do not administer), a skin object isn't an option.
Yes, I realize that I have to redo these changes when I upgrade DNN. I've gotten used to doing that (for instance, adding NOCACHE, NOSNIPPET meta tags to ALL pages in our site....removing Payment Configuration options from module and site settings...since we can't allow any e-commerce integration).
 
New Post
12/12/2012 1:24 PM
 
I came up with a solution (my issue was unfamiliarity with C#). Using a DIV with display:none around the content I want to hide, but using code to check IsSuperuser.

<% if (UserInfo.IsSuperUser) { %>

<% }
else
{ %>

<% } %>
 
New Post
12/12/2012 1:25 PM
 
< % if (UserInfo.IsSuperUser) { % >
< div >
< % }
else
{ % >
< div style="display:none;" >
< % } % >
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Is Superuser?Is Superuser?


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