Skip to Content Skip to Menu

[SOLVED] GJ Custom Plug-in

  • drdehart
  • drdehart
  • OFFLINE
  • Posts: 253
  • Thanks: 2
  • Karma: 1
12 years 5 months ago - 12 years 5 months ago #199716 by drdehart
[SOLVED] GJ Custom Plug-in was created by drdehart
We are migrating a custom gj plug-in from gj2.4 to gj2.5.1 and have a problem with hiding our tab from non-members of a group.

can you suggest where in the code and how we would address this. The plug-in has a parameter for Public = Yes/No, but we are having problems trying to figure out how to implement it so that if the parameter is set to "No", then non-members will not see the tab.
Last edit: 12 years 5 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8277
  • Karma: 1443
12 years 5 months ago #199757 by krileon
Replied by krileon on topic Re: GJ Custom Plug-in
Review existing integrations and their usage of the authorization function. There is also a trigger in each integration to extend the authorization function based off the integrations parameters.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • drdehart
  • drdehart
  • OFFLINE
  • Posts: 253
  • Thanks: 2
  • Karma: 1
12 years 5 months ago #199786 by drdehart
Replied by drdehart on topic Re: GJ Custom Plug-in
If we choose the current Files integration to study, this works beautifully: when editing a group, if we set Public = Yes for the files integration, then the tab is visible to non-members; if we set Public = No, then the tab is not visible to non-members.

In the code, we find over 50 references to the $authorized function. Can you narrow down the lines that control the visibility of the tab and the referenced trigger?

Our code (that isn't working) is attached (kunena wouldn't allow it in the posting).

but setting our Public = Yes/No parameter, $posting_public, (Yes = 1, No = 0) to Yes or No is not affecting the tab visibility. Apparently, we are missing something crucial.
Attachments:

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8277
  • Karma: 1443
12 years 5 months ago #199794 by krileon
Replied by krileon on topic Re: GJ Custom Plug-in
Don't just GREP or REGEX the file. Actually open it and slowly review the code. You're not going to build a GJ integration overnight with no prior experience to its usage. You need to become familiar with the authorization function and its usage as it's used to pull a list of user permissions and then another function is used to parse through it. You can extend that list with a trigger. All of this is shown in the integrations.

For example in getAuthorization of the file integration it checks the parameters and sets new authorization variables (e.g. file_show), which can be checked against later. Then in getFiles we immediately grab the authorization of a user with cbgjClass::getAuthorization( $category, $group, $user ) followed by checking if they've access to see the files using cbgjClass::hasAccess( 'file_show', $authorized ).


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • drdehart
  • drdehart
  • OFFLINE
  • Posts: 253
  • Thanks: 2
  • Karma: 1
12 years 5 months ago #199814 by drdehart
Replied by drdehart on topic Re: GJ Custom Plug-in
found the problem - thanks!

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum