HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


OCP4B8 - Javascript and Group Permissions [SOLVED]

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#41053 (In Topic #9164)
Avatar

Community saint

Hello All!

I have a head scratcher here that is making me mental. On a site I'm developing, I have the following groups:

Guest
"The Moderators"
Staff #1
Staff #2
Customers
Newbie

The site is setup with a combined welcome and site zone. I'm using some Javascript to create tabbed boxes on my welcome:start page. The problem is that unless the user is in a highly priviledged group, the javascript nor the accompanying css (which is in global.css) will render. I'm working with the Customers group and unless I create that group based off of the Moderators (Super-Moderators, Super-Members) I cannot for the life of me get the Javascript to go. There are two calls:

Code

<script type="text/javascript" src="ocp/js/tabber.js"></script>
<script type="text/javascript">document.write('<style type="text/css">.tabber{display:none;}<\/style>');</script>
Pathing is AOK as it works dandy for the higher priveldged groups, however my Customers group does not create the tabbed box (css not being parsed. first clue is the tabbed box uses h2 tags for the tab title, however, the page is being rendered with OCP's h2 css instead) and produces the following at the top of where the tabbed box should be:

Code

document.write('.tabber{display:none;}<\/style>');
I have been up and down the permissions and cannot find anything that would relate to this issue.
Any thoughts?

TIA!
SD

Edit: if I put the code to build the tabbed box in custom comcode, it works fine for all groups. I may end up doing this, however, when I include a comcode page as the tab content, the top 1/3 is cut off, so I'd have to muck up my templates and I'd prefer not to do that at this point.


Last edit: by SoccerDad

"no violence, no hate, no pain, no enemies
just peace, unity, tolerance and love" - The Beloved

OCP V7 | Advocating monetary reform - FreeOurMoney

Need OCP friendly hosting? Look no further:
Web Hosting, Reseller Hosting, and Dedicated Servers w/cPanel - Elief! - Official hosting partner for ocPortal.
Back to the top
 
Posted
Rating:
#41058
Avatar

Hi,

You've found a bug.
Line 2166 of sources/comcode_text.php needs to be changed from:

Code

   if ((!$as_admin) && (!has_specific_permission(get_member(),'use_very_dangerous_comcode')))
to:

Code

   if ((!$as_admin) && (!has_specific_permission($source_member,'use_very_dangerous_comcode')))


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#41059
Avatar

Community saint

Thanks mucho Chris, that was the ticket! FYI: in my installation, it was line 2143.

"no violence, no hate, no pain, no enemies
just peace, unity, tolerance and love" - The Beloved

OCP V7 | Advocating monetary reform - FreeOurMoney

Need OCP friendly hosting? Look no further:
Web Hosting, Reseller Hosting, and Dedicated Servers w/cPanel - Elief! - Official hosting partner for ocPortal.
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: