Announcement

Collapse
No announcement yet.

PHP module - no permissions?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PHP module - no permissions?

    I have been building a small PHP module on the article pages. It would be useful if it could set so certain usergroups could view it and others not.

    As an example scenario, say I wanted to write code that enabled admins only to see recent infractions and not the whole world see them. Or, I may want only admins & mods to see recently added comments that required attention. Perhaps I've got a certain bit of code that only guests need to see and not registered members.. etc.

    Is it possible to use code to show only x-usergroups or will permission selection boxes be added in future releases?
    VB 5.4.1 - PHP 7..2.4 - MySQL 5.5.56
    No Addons - none at all.

  • #2
    Ad modules have permissions for usergroups. If you need to use php, the best scenario would be to build a custom package and use templates to pull your data. You can control which user groups see what that way. You may be able to check permissions via php from the php module and display info based on whether or not the user passes the permissions test. I've never bothered using php modules, so I can't be sure if it would work or not.


    Comment


    • #3
      Absolutely, the reason I was hoping to see usergroup permissions as oppose using hard-coding as I've typically done in previous incarnations of VB is because when using the permissions tick-boxes as supplied, the excluded groups don't see the wrapper nor the content but when using usergroup as written manually within the PHP module the module still shows up to excluded groups whilst the enclosed code is ignored.

      That probably sounds way more complicated than it should.. but its' 443am and I'm typing on coffee & nicotine.
      VB 5.4.1 - PHP 7..2.4 - MySQL 5.5.56
      No Addons - none at all.

      Comment


      • #4
        Originally posted by karlm View Post
        the excluded groups don't see the wrapper nor the content but when using usergroup as written manually within the PHP module the module still shows up to excluded groups whilst the enclosed code is ignored.
        Which is why I tend to do it in templates. If the user doesn't have permission, nothing of the is shown.


        Comment

        Related Topics

        Collapse

        Working...
        X