Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion phpBB/includes/acp/acp_users.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function main($id, $mode)
$dropdown_modes = array();
while ($row = $db->sql_fetchrow($result))
{
if (!$this->p_master->module_auth($row['module_auth']))
if (!$this->p_master->module_auth_self($row['module_auth']))
{
continue;
}
Expand Down
22 changes: 17 additions & 5 deletions phpBB/includes/functions_module.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function list_modules($p_class)
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;
Expand Down Expand Up @@ -315,9 +315,23 @@ function loaded($module_basename, $module_mode = false)
}

/**
* 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;
Expand Down Expand Up @@ -365,8 +379,6 @@ function module_auth($module_auth, $forum_id = false)
// Make sure $id seperation 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) . ');');

Expand Down