From e3cba9ceba4994bbc4006f7107a3f5baee21e71d Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Fri, 10 Jan 2014 13:14:50 -0600 Subject: [PATCH] [ticket/12006] Add module_auth event PHPBB3-12006 --- phpBB/includes/functions_module.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index ea3b3356bb..88e3fbce2f 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -361,6 +361,20 @@ class p_master 'ext_([a-zA-Z0-9_/]+)' => 'array_key_exists(\'\\1\', $phpbb_extension_manager->all_enabled())', ); + /** + * Alter tokens for module authorisation check + * + * @event core.module_auth + * @var array valid_tokens Valid tokens and their auth check + * replacements + * @var string module_auth The module_auth of the current + * module + * @var int forum_id The current forum_id + * @since 3.1-A3 + */ + $vars = array('valid_tokens', 'module_auth', 'forum_id'); + extract($phpbb_dispatcher->trigger_event('core.module_auth', compact($vars))); + $tokens = $match[0]; for ($i = 0, $size = sizeof($tokens); $i < $size; $i++) {