phpBB

Code Changes

File: includes/acp/auth.php

  Unmodified   Added   Modified   Removed
Line 266Line 266
	*/
function display_mask($mode, $permission_type, &$hold_ary, $user_mode = 'user', $local = false, $group_display = true)
{

	*/
function display_mask($mode, $permission_type, &$hold_ary, $user_mode = 'user', $local = false, $group_display = true)
{

		global $template, $user, $db, $phpbb_root_path, $phpEx, $phpbb_container;



		global $template, $user, $db, $phpbb_container;

/* @var $phpbb_permissions \phpbb\permissions */

		$phpbb_permissions = $phpbb_container->get('acl.permissions');

		$phpbb_permissions = $phpbb_container->get('acl.permissions');

 

/** @var \phpbb\group\helper $group_helper */
$group_helper = $phpbb_container->get('group_helper');


// Define names for template loops, might be able to be set
$tpl_pmask = 'p_mask';


// Define names for template loops, might be able to be set
$tpl_pmask = 'p_mask';

Line 300Line 305
		$ug_names_ary = array();
while ($row = $db->sql_fetchrow($result))
{

		$ug_names_ary = array();
while ($row = $db->sql_fetchrow($result))
{

			$ug_names_ary[$row['ug_id']] = ($user_mode == 'user') ? $row['ug_name'] : (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['ug_name']] : $row['ug_name']);

			$ug_names_ary[$row['ug_id']] = ($user_mode == 'user') ? $row['ug_name'] : $group_helper->get_name($row['ug_name']);

		}
$db->sql_freeresult($result);


		}
$db->sql_freeresult($result);


Line 408Line 413
			{
foreach ($memberships as $row)
{

			{
foreach ($memberships as $row)
{

					if ($groups[$row['group_id']]['group_type'] == GROUP_SPECIAL)
{
$user_groups_default[$row['user_id']][] = $user->lang['G_' . $groups[$row['group_id']]['group_name']];
}
else
{
$user_groups_custom[$row['user_id']][] = $groups[$row['group_id']]['group_name'];
}

					$user_groups_default[$row['user_id']][] = $group_helper->get_name($groups[$row['group_id']]['group_name']);








				}
}
unset($memberships, $groups);

				}
}
unset($memberships, $groups);

Line 467Line 465
				{
// Build role dropdown options
$current_role_id = (isset($cur_roles[$ug_id][$forum_id])) ? $cur_roles[$ug_id][$forum_id] : 0;

				{
// Build role dropdown options
$current_role_id = (isset($cur_roles[$ug_id][$forum_id])) ? $cur_roles[$ug_id][$forum_id] : 0;

 

$role_options = array();


$s_role_options = '';


$s_role_options = '';

 
					$current_role_id = (isset($cur_roles[$ug_id][$forum_id])) ? $cur_roles[$ug_id][$forum_id] : 0;


@reset($roles);
while (list($role_id, $role_row) = each($roles))


@reset($roles);
while (list($role_id, $role_row) = each($roles))

Line 478Line 479

$title = ($role_description) ? ' title="' . $role_description . '"' : '';
$s_role_options .= '<option value="' . $role_id . '"' . (($role_id == $current_role_id) ? ' selected="selected"' : '') . $title . '>' . $role_name . '</option>';


$title = ($role_description) ? ' title="' . $role_description . '"' : '';
$s_role_options .= '<option value="' . $role_id . '"' . (($role_id == $current_role_id) ? ' selected="selected"' : '') . $title . '>' . $role_name . '</option>';

 

$role_options[] = array(
'ID' => $role_id,
'ROLE_NAME' => $role_name,
'TITLE' => $role_description,
'SELECTED' => $role_id == $current_role_id,
);

					}

if ($s_role_options)

					}

if ($s_role_options)

Line 505Line 513

$template->assign_block_vars($tpl_pmask . '.' . $tpl_fmask, array(
'NAME' => $ug_names_ary[$ug_id],


$template->assign_block_vars($tpl_pmask . '.' . $tpl_fmask, array(
'NAME' => $ug_names_ary[$ug_id],

						'S_ROLE_OPTIONS'	=> $s_role_options,

 
						'UG_ID'				=> $ug_id,

						'UG_ID'				=> $ug_id,

 
						'S_ROLE_OPTIONS'	=> $s_role_options,

						'S_CUSTOM'			=> $s_custom_permissions,

						'S_CUSTOM'			=> $s_custom_permissions,

						'FORUM_ID'			=> $forum_id)
);




						'FORUM_ID'			=> $forum_id,
'S_ROLE_ID' => $current_role_id,
));

$template->assign_block_vars_array($tpl_pmask . '.' . $tpl_fmask . '.role_options', $role_options);


$this->assign_cat_array($ug_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id, ($mode == 'view'), $show_trace);



$this->assign_cat_array($ug_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id, ($mode == 'view'), $show_trace);


Line 554Line 565
					// Build role dropdown options
$current_role_id = (isset($cur_roles[$ug_id][$forum_id])) ? $cur_roles[$ug_id][$forum_id] : 0;


					// Build role dropdown options
$current_role_id = (isset($cur_roles[$ug_id][$forum_id])) ? $cur_roles[$ug_id][$forum_id] : 0;


 
					$role_options = array();

$current_role_id = (isset($cur_roles[$ug_id][$forum_id])) ? $cur_roles[$ug_id][$forum_id] : 0;

					$s_role_options = '';

@reset($roles);

					$s_role_options = '';

@reset($roles);

Line 564Line 578

$title = ($role_description) ? ' title="' . $role_description . '"' : '';
$s_role_options .= '<option value="' . $role_id . '"' . (($role_id == $current_role_id) ? ' selected="selected"' : '') . $title . '>' . $role_name . '</option>';


$title = ($role_description) ? ' title="' . $role_description . '"' : '';
$s_role_options .= '<option value="' . $role_id . '"' . (($role_id == $current_role_id) ? ' selected="selected"' : '') . $title . '>' . $role_name . '</option>';

 

$role_options[] = array(
'ID' => $role_id,
'ROLE_NAME' => $role_name,
'TITLE' => $role_description,
'SELECTED' => $role_id == $current_role_id,
);

					}

if ($s_role_options)

					}

if ($s_role_options)

Line 592Line 613
					$template->assign_block_vars($tpl_pmask . '.' . $tpl_fmask, array(
'NAME' => ($forum_id == 0) ? $forum_names_ary[0] : $forum_names_ary[$forum_id]['forum_name'],
'PADDING' => ($forum_id == 0) ? '' : $forum_names_ary[$forum_id]['padding'],

					$template->assign_block_vars($tpl_pmask . '.' . $tpl_fmask, array(
'NAME' => ($forum_id == 0) ? $forum_names_ary[0] : $forum_names_ary[$forum_id]['forum_name'],
'PADDING' => ($forum_id == 0) ? '' : $forum_names_ary[$forum_id]['padding'],

						'S_ROLE_OPTIONS'	=> $s_role_options,

 
						'S_CUSTOM'			=> $s_custom_permissions,
'UG_ID' => $ug_id,

						'S_CUSTOM'			=> $s_custom_permissions,
'UG_ID' => $ug_id,

 
						'S_ROLE_OPTIONS'	=> $s_role_options,

						'FORUM_ID'			=> $forum_id)
);

						'FORUM_ID'			=> $forum_id)
);

 

$template->assign_block_vars_array($tpl_pmask . '.' . $tpl_fmask . '.role_options', $role_options);


$this->assign_cat_array($forum_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id, ($mode == 'view'), $show_trace);
}


$this->assign_cat_array($forum_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id, ($mode == 'view'), $show_trace);
}

Line 611Line 634
	*/
function display_role_mask(&$hold_ary)
{

	*/
function display_role_mask(&$hold_ary)
{

		global $db, $template, $user, $phpbb_root_path, $phpbb_admin_path, $phpEx;


		global $db, $template, $user, $phpbb_root_path, $phpEx;
global $phpbb_container;


if (!sizeof($hold_ary))
{
return;
}


if (!sizeof($hold_ary))
{
return;
}

 

/** @var \phpbb\group\helper $group_helper */
$group_helper = $phpbb_container->get('group_helper');


// Get forum names
$sql = 'SELECT forum_id, forum_name


// Get forum names
$sql = 'SELECT forum_id, forum_name

Line 673Line 700
				{
$template->assign_block_vars('role_mask.groups', array(
'GROUP_ID' => $row['group_id'],

				{
$template->assign_block_vars('role_mask.groups', array(
'GROUP_ID' => $row['group_id'],

						'GROUP_NAME'	=> ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'],

						'GROUP_NAME'	=> $group_helper->get_name($row['group_name']),

						'U_PROFILE'		=> append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=group&amp;g={$row['group_id']}"))
);
}

						'U_PROFILE'		=> append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=group&amp;g={$row['group_id']}"))
);
}

Line 1106Line 1133
	*/
function assign_cat_array(&$category_array, $tpl_cat, $tpl_mask, $ug_id, $forum_id, $s_view, $show_trace = false)
{

	*/
function assign_cat_array(&$category_array, $tpl_cat, $tpl_mask, $ug_id, $forum_id, $s_view, $show_trace = false)
{

		global $template, $user, $phpbb_admin_path, $phpEx, $phpbb_container;

		global $template, $phpbb_admin_path, $phpEx, $phpbb_container;





 
		/* @var $phpbb_permissions \phpbb\permissions */

		$phpbb_permissions = $phpbb_container->get('acl.permissions');

@reset($category_array);
while (list($cat, $cat_array) = each($category_array))
{

		$phpbb_permissions = $phpbb_container->get('acl.permissions');

@reset($category_array);
while (list($cat, $cat_array) = each($category_array))
{

 
			if (!$phpbb_permissions->category_defined($cat))
{
continue;
}


			$template->assign_block_vars($tpl_cat, array(
'S_YES' => ($cat_array['S_YES'] && !$cat_array['S_NEVER'] && !$cat_array['S_NO']) ? true : false,
'S_NEVER' => ($cat_array['S_NEVER'] && !$cat_array['S_YES'] && !$cat_array['S_NO']) ? true : false,

			$template->assign_block_vars($tpl_cat, array(
'S_YES' => ($cat_array['S_YES'] && !$cat_array['S_NEVER'] && !$cat_array['S_NO']) ? true : false,
'S_NEVER' => ($cat_array['S_NEVER'] && !$cat_array['S_YES'] && !$cat_array['S_NO']) ? true : false,

Line 1139Line 1172
			@reset($cat_array['permissions']);
while (list($permission, $allowed) = each($cat_array['permissions']))
{

			@reset($cat_array['permissions']);
while (list($permission, $allowed) = each($cat_array['permissions']))
{

 
				if (!$phpbb_permissions->permission_defined($permission))
{
continue;
}


				if ($s_view)
{
$template->assign_block_vars($tpl_cat . '.' . $tpl_mask, array(

				if ($s_view)
{
$template->assign_block_vars($tpl_cat . '.' . $tpl_mask, array(

Line 1184Line 1222
	*/
function build_permission_array(&$permission_row, &$content_array, &$categories, $key_sort_array)
{

	*/
function build_permission_array(&$permission_row, &$content_array, &$categories, $key_sort_array)
{

		global $user, $phpbb_container;

		global $phpbb_container;





 
		/* @var $phpbb_permissions \phpbb\permissions */

		$phpbb_permissions = $phpbb_container->get('acl.permissions');

foreach ($key_sort_array as $forum_id)

		$phpbb_permissions = $phpbb_container->get('acl.permissions');

foreach ($key_sort_array as $forum_id)