aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_module.php
diff options
context:
space:
mode:
authorVjacheslav Trushkin <arty@phpbb.com>2012-03-24 11:45:53 +0200
committerVjacheslav Trushkin <arty@phpbb.com>2012-03-24 11:45:53 +0200
commit583da4274f91d3e8228ce58e8a849aa861ef66f8 (patch)
treed1841433f1d54768c3fc9f01af138adff6fc50c9 /phpBB/includes/functions_module.php
parentf17449e5ffb87c4a63e6c27c52036c5812f970d7 (diff)
parentcc13bac412442a1d72affcc3222b6bfca094e92a (diff)
downloadforums-583da4274f91d3e8228ce58e8a849aa861ef66f8.tar
forums-583da4274f91d3e8228ce58e8a849aa861ef66f8.tar.gz
forums-583da4274f91d3e8228ce58e8a849aa861ef66f8.tar.bz2
forums-583da4274f91d3e8228ce58e8a849aa861ef66f8.tar.xz
forums-583da4274f91d3e8228ce58e8a849aa861ef66f8.zip
Merge branch 'develop' into feature/prosilver-cleanup/duplicate-colors
* develop: (117 commits) [task/travis] Refactor php version check for dbunit install [task/travis] Exclude functional and slow tests [ticket/10719] Revert "Skip functional tests on PHP 5.2" [task/travis-develop2] Update version from 5.3 to 5.3.2 [task/travis] Dropping support for 5.2 in develop branch [task/travis] Some more small travis fixes [task/travis] Rename travis phpunit config files [task/travis] Fixing some travis issues [ticket/10684] Adjust function and parameter name, minor changes. [task/travis] Add automated testing to readme [task/travis] Removing development information [task/travis] Adding Travis Continuous Intergration Support [ticket/10704] minor typo in a comment [ticket/10717] Fix profile field sample in prosilver“s memberlist_view.html [ticket/10691] Fixed the speed of creating search index [task/php54-ascraeus] Bring p_master#module_auth into PHP 5 era. [task/php54] Disable E_STRICT in Olympus when running on PHP 5.4. [task/php54] Refactor error_reporting call slightly. [ticket/10690] Fix undefined UNAPPROVED_POSTS_ZERO_TOTAL in queue [ticket/10689] Fix "First character"-option in "Find a member"-search ... Conflicts: phpBB/styles/prosilver/theme/cp.css
Diffstat (limited to 'phpBB/includes/functions_module.php')
-rw-r--r--phpBB/includes/functions_module.php26
1 files changed, 19 insertions, 7 deletions
diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php
index b7bb770031..ad76be9f2f 100644
--- a/phpBB/includes/functions_module.php
+++ b/phpBB/includes/functions_module.php
@@ -128,7 +128,7 @@ class p_master
foreach ($this->module_cache['modules'] as $key => $row)
{
// Not allowed to view module?
- if (!$this->module_auth($row['module_auth']))
+ if (!$this->module_auth_self($row['module_auth']))
{
unset($this->module_cache['modules'][$key]);
continue;
@@ -315,9 +315,23 @@ class p_master
}
/**
- * Check module authorisation
+ * Check module authorisation.
+ *
+ * This is a non-static version that uses $this->acl_forum_id
+ * for the forum id.
+ */
+ function module_auth_self($module_auth)
+ {
+ return self::module_auth($module_auth, $this->acl_forum_id);
+ }
+
+ /**
+ * Check module authorisation.
+ *
+ * This is a static version, it must be given $forum_id.
+ * See also module_auth_self.
*/
- function module_auth($module_auth, $forum_id = false)
+ static function module_auth($module_auth, $forum_id)
{
global $auth, $config;
global $request;
@@ -362,11 +376,9 @@ class p_master
$module_auth = implode(' ', $tokens);
- // Make sure $id seperation is working fine
+ // Make sure $id separation is working fine
$module_auth = str_replace(' , ', ',', $module_auth);
- $forum_id = ($forum_id === false) ? $this->acl_forum_id : $forum_id;
-
$is_auth = false;
eval('$is_auth = (int) (' . preg_replace(array('#acl_([a-z0-9_]+)(,\$id)?#', '#\$id#', '#aclf_([a-z0-9_]+)#', '#cfg_([a-z0-9_]+)#', '#request_([a-zA-Z0-9_]+)#'), array('(int) $auth->acl_get(\'\\1\'\\2)', '(int) $forum_id', '(int) $auth->acl_getf_global(\'\\1\')', '(int) $config[\'\\1\']', '$request->variable(\'\\1\', false)'), $module_auth) . ');');
@@ -923,6 +935,6 @@ class p_master
*/
protected function is_full_class($basename)
{
- return (substr($basename, 0, 6) === 'phpbb_' || substr($basename, 0, strlen($this->p_class) + 1) === $this->p_class . '_');
+ return (preg_match('/^(phpbb|ucp|mcp|acp)_/', $basename));
}
}