Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Global Hook Request
if($mybb->usergroup['canview'] != 1)
	// Check pages allowable even when not allowed to view board
	$allowable_actions = array(
		"member.php" => array(
		"usercp2.php" => array(
	if(!($current_page == "member.php" && in_array($mybb->input['action'], $allowable_actions['member.php'])) && !($current_page == "usercp2.php" && in_array($mybb->input['action'], $allowable_actions['usercp2.php'])) && $current_page != "captcha.php")

In globals.php there is that section which will prevent a page access. It would be nice to see a hook there to allow plugin authors access to add more there.
Agreed ^
All my plugins are available for free at MyBB Extend and on my GitHub. has been closed and none of my plugins are officially maintained or supported.
Supported Smile
My Company - I am Microsoft Certified in HTML5, CSS3 and JS
Why not.
I'm not here often, shoot a PM or whatever if you want my discord.
(2009-08-29, 12:33 AM)T0m Wrote: Why not.
Cause you can't put hooks everywhere. It's ugly, bad coding practice, and affects performance.
So you have to make a judgement over whether it's really worthwhile to put something at a particular place.
Well i find, for newbs like me, that things keep on getting easier. So why stop the flow? I'm not sayinh everywhere, i know some files completely lack things that are needed.
I'm not here often, shoot a PM or whatever if you want my discord.
(2009-08-29, 04:23 AM)T0m Wrote: So why stop the flow?
Just because it works that way for you doesn't necessarily mean it does so for everyone.

(2009-08-29, 04:23 AM)T0m Wrote: I'm not sayinh everywhere
I'm not either.

(2009-08-29, 04:23 AM)T0m Wrote: i know some files completely lack things that are needed.
That's very nice to know.
I still have this issue with this but I have thought of a possible solution that might be accepted by MyBB Dev. At least I hope.

There doesn't appear to be a good bypass method unless you are hooking into one a few scripts which for a plugin author may not be appropriate.

However why not allow a define?

define("ALLOWABLE_PAGE", 1);

This could be placed on the custom page such my myipn.php. Then you can alter the if statement.
if($mybb->usergroup['canview'] != 1 && !ALLOWABLE_PAGE)

This can allow a plugin author to allow a page even if the group isn't allowed to view board (canview). Another example use would be contact plugins.

Anyways...please consider. I really think some method for plugin authors to allow their custom pages to bypass the canview permission would be great.

The good news about this too is that this can be used by other mybb core pages to avoid that insane if statement. Similar to the NO_ONLINE define.
That's a good idea

Forum Jump:

Users browsing this thread: 1 Guest(s)