diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html index 3d7d5bcc43..e1f2c69152 100644 --- a/phpBB/adm/style/acp_forums.html +++ b/phpBB/adm/style/acp_forums.html @@ -99,6 +99,12 @@
+ +{L_ALL_YES} • {L_ALL_NO} • {L_ALL_UNSET}
+
+ [{L_ALL_YES}]
+ [{L_ALL_NO}]
+ [{L_ALL_UNSET}]
+
{L_USERS} | +
---|
+ + {role_mask.users.USERNAME} :: + + {L_USERS_NOT_ASSIGNED} + + | +
{L_GROUPS} | +
+ + {role_mask.groups.GROUP_NAME} :: + + {L_GROUPS_NOT_ASSIGNED} + + | +
{L_ROLE_NOT_ASSIGNED}
+ + \ No newline at end of file diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index a193808010..00052b8d23 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -144,6 +144,35 @@ class acp_forums if (!sizeof($errors)) { + $forum_perm_from = request_var('forum_perm_from', 0); + + // Copy permissions? + if ($forum_perm_from && $action == 'add') + { + $sql_ary = array( + 'user_id' => array('user_id'), + 'forum_id' => (int) $forum_data['forum_id'], + 'auth_option_id' => array('auth_option_id'), + 'auth_role_id' => array('auth_role_id'), + 'auth_setting' => array('auth_setting') + ); + + // We copy the permissions the manual way. ;) + $sql = 'INSERT INTO ' . ACL_USERS_TABLE . ' ' . $db->sql_build_array('INSERT_SELECT', $sql_ary) . ' + FROM ' . ACL_USERS_TABLE . ' + WHERE forum_id = ' . $forum_perm_from; + $db->sql_query($sql); + + // Change array for copying settings from the acl groups table + unset($sql_ary['user_id']); + $sql_ary['group_id'] = array('group_id'); + + $sql = 'INSERT INTO ' . ACL_GROUPS_TABLE . ' ' . $db->sql_build_array('INSERT_SELECT', $sql_ary) . ' + FROM ' . ACL_GROUPS_TABLE . ' + WHERE forum_id = ' . $forum_perm_from; + $db->sql_query($sql); + } + $auth->acl_clear_prefetch(); recalc_btree('forum_id', FORUMS_TABLE); @@ -477,6 +506,7 @@ class acp_forums 'S_STATUS_OPTIONS' => $statuslist, 'S_PARENT_OPTIONS' => $parents_list, 'S_STYLES_OPTIONS' => $styles_list, + 'S_FORUM_OPTIONS' => make_forum_select(false, false, false), 'S_SHOW_DISPLAY_ON_INDEX' => $s_show_display_on_index, 'S_FORUM_POST' => ($forum_data['forum_type'] == FORUM_POST) ? true : false, 'S_FORUM_ORIG_POST' => (isset($old_forum_type) && $old_forum_type == FORUM_POST) ? true : false, @@ -1309,7 +1339,7 @@ class acp_forums // Set forum ids to 0 $table_ary = array(DRAFTS_TABLE); - foreach ($tables_ary as $table) + foreach ($table_ary as $table) { $db->sql_query("UPDATE $table SET forum_id = 0 WHERE forum_id = $forum_id"); } diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index 5fa8d8b5fd..644f4f7cf9 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -10,7 +10,6 @@ /** * @package acp -* @todo make sure permissions are met for adding groups and removing groups (a_groupadd, a_groupdel) */ class acp_groups { @@ -164,6 +163,11 @@ class acp_groups switch ($action) { case 'delete': + if (!$auth->acl_get('a_groupdel')) + { + trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action)); + } + $error = group_delete($group_id, $group_row['group_name']); break; @@ -225,6 +229,11 @@ class acp_groups trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action)); } + if ($action == 'add' && !$auth->acl_get('a_groupadd')) + { + trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action)); + } + $error = array(); $user->add_lang('ucp'); @@ -309,7 +318,7 @@ class acp_groups $test_variables = array('rank', 'colour', 'avatar', 'avatar_type', 'avatar_width', 'avatar_height', 'receive_pm', 'message_limit'); foreach ($test_variables as $test) { - if ($action == 'add' || (isset($submit_ary[$test]) && $group_row['group_' . $test] != $submit_ary[$test])) + if (isset($submit_ary[$test]) && ($action == 'add' || $group_row['group_' . $test] != $submit_ary[$test])) { $group_attributes['group_' . $test] = $group_row['group_' . $test] = $submit_ary[$test]; } @@ -317,6 +326,28 @@ class acp_groups if (!($error = group_create($group_id, $group_type, $group_name, $group_description, $group_attributes))) { + $group_perm_from = request_var('group_perm_from', 0); + + // Copy permissions? + if ($group_perm_from && $action == 'add') + { + $sql_ary = array( + 'group_id' => $group_id, + 'forum_id' => array('forum_id'), + 'auth_option_id' => array('auth_option_id'), + 'auth_role_id' => array('auth_role_id'), + 'auth_setting' => array('auth_setting') + ); + + // We copy the permissions the manual way. ;) + $sql = 'INSERT INTO ' . ACL_GROUPS_TABLE . ' ' . $db->sql_build_array('INSERT_SELECT', $sql_ary) . ' + FROM ' . ACL_GROUPS_TABLE . ' + WHERE group_id = ' . $group_perm_from; + $db->sql_query($sql); + + $auth->acl_clear_prefetch(); + } + $message = ($action == 'edit') ? 'GROUP_UPDATED' : 'GROUP_CREATED'; trigger_error($user->lang[$message] . adm_back_link($this->u_action)); } @@ -398,6 +429,7 @@ class acp_groups $template->assign_vars(array( 'S_EDIT' => true, + 'S_ADD_GROUP' => ($action == 'add') ? true : false, 'S_INCLUDE_SWATCH' => true, 'S_CAN_UPLOAD' => $can_upload, 'S_ERROR' => (sizeof($error)) ? true : false, @@ -414,6 +446,7 @@ class acp_groups 'GROUP_COLOUR' => (isset($group_row['group_colour'])) ? $group_row['group_colour'] : '', 'S_RANK_OPTIONS' => $rank_options, + 'S_GROUP_OPTIONS' => group_select_options(0), 'AVATAR_IMAGE' => $avatar_img, 'AVATAR_MAX_FILESIZE' => $config['avatar_filesize'], 'GROUP_AVATAR_WIDTH' => (isset($group_row['group_avatar_width'])) ? $group_row['group_avatar_width'] : '', @@ -562,7 +595,7 @@ class acp_groups $template->assign_vars(array( 'U_ACTION' => $this->u_action, - ) + 'S_GROUP_ADD' => ($auth->acl_get('a_groupadd')) ? true : false) ); $sql = 'SELECT g.group_id, g.group_name, g.group_type, COUNT(ug.user_id) AS total_members @@ -609,7 +642,7 @@ class acp_groups 'U_LIST' => "{$this->u_action}&action=list&g=$group_id", 'U_DEFAULT' => "{$this->u_action}&action=default&g=$group_id", 'U_EDIT' => "{$this->u_action}&action=edit&g=$group_id", - 'U_DELETE' => "{$this->u_action}&action=delete&g=$group_id", + 'U_DELETE' => ($auth->acl_get('a_groupdel')) ? "{$this->u_action}&action=delete&g=$group_id" : '', 'S_GROUP_SPECIAL' => ($row['group_type'] == GROUP_SPECIAL) ? true : false, diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php index 39239d8901..fab7731567 100644 --- a/phpBB/includes/acp/acp_modules.php +++ b/phpBB/includes/acp/acp_modules.php @@ -661,7 +661,7 @@ class acp_modules if (!$ignore_acl && $row['module_auth']) { $is_auth = false; - eval('$is_auth = (int) (' . preg_replace(array('#acl_([a-z_]+)(,\$id)?#e', '#\$id#', '#cfg_([a-z_]+)#e'), array('(int) $auth->acl_get("\\1"\\2)', '$this->acl_forup_id', '(int) $config["\\1"]'), trim($row['module_auth'])) . ');'); + eval('$is_auth = (int) (' . preg_replace(array('#acl_([a-z_]+)(,\$id)?#', '#\$id#', '#aclf_([a-z_]+)#', '#cfg_([a-z_]+)#'), array('(int) $auth->acl_get("\\1"\\2)', 'true', '(int) $auth->acl_getf_global("\\1")', '(int) $config["\\1"]'), $row['module_auth']) . ');'); if (!$is_auth) { continue; diff --git a/phpBB/includes/acp/acp_permission_roles.php b/phpBB/includes/acp/acp_permission_roles.php new file mode 100644 index 0000000000..2bf32093f4 --- /dev/null +++ b/phpBB/includes/acp/acp_permission_roles.php @@ -0,0 +1,776 @@ +add_lang('acp/permissions'); + $user->add_lang('acp/permissions_phpbb'); + + $this->tpl_name = 'acp_permission_roles'; + + $submit = (isset($_POST['submit'])) ? true : false; + $role_id = request_var('role_id', 0); + $action = request_var('action', ''); + $action = (isset($_POST['add'])) ? 'add' : $action; + + // Define pre-selection array + $this->pre_selection_array = array( + 1 => array('lang' => 'PRE_ONLY_SPECIAL_GUEST', 'type' => GROUP_SPECIAL, 'name' => array('BOTS', 'GUESTS', 'INACTIVE', 'INACTIVE_COPPA'), 'negate' => false), + 2 => array('lang' => 'PRE_ONLY_SPECIAL_REGISTERED', 'type' => GROUP_SPECIAL, 'name' => array('ADMINISTRATORS', 'SUPER_MODERATORS', 'REGISTERED', 'REGISTERED_COPPA'), 'negate' => false), + 3 => array('lang' => 'PRE_NOT_SPECIAL_GUEST', 'type' => GROUP_SPECIAL, 'name' => array('BOTS', 'GUESTS', 'INACTIVE', 'INACTIVE_COPPA'), 'negate' => true), + 4 => array('lang' => 'PRE_NOT_SPECIAL_REGISTERED', 'type' => GROUP_SPECIAL, 'name' => array('ADMINISTRATORS', 'SUPER_MODERATORS', 'REGISTERED', 'REGISTERED_COPPA'), 'negate' => true), + 5 => array('lang' => 'PRE_ALL_SPECIAL', 'type' => GROUP_SPECIAL, 'negate' => false), + 6 => array('lang' => 'PRE_NOT_SPECIAL', 'type' => GROUP_SPECIAL, 'negate' => true), + 7 => array('lang' => 'PRE_ALL_FREE', 'type' => GROUP_FREE, 'negate' => false), + 8 => array('lang' => 'PRE_NOT_FREE', 'type' => GROUP_FREE, 'negate' => true), + 9 => array('lang' => 'PRE_ALL_CLOSED', 'type' => GROUP_CLOSED, 'negate' => false), + 10 => array('lang' => 'PRE_NOT_CLOSED', 'type' => GROUP_CLOSED, 'negate' => true), + 11 => array('lang' => 'PRE_ALL_HIDDEN', 'type' => GROUP_HIDDEN, 'negate' => false), + 12 => array('lang' => 'PRE_NOT_HIDDEN', 'type' => GROUP_HIDDEN, 'negate' => true), + 13 => array('lang' => 'PRE_ALL_OPEN', 'type' => GROUP_OPEN, 'negate' => false), + 14 => array('lang' => 'PRE_NOT_OPEN', 'type' => GROUP_OPEN, 'negate' => true), + ); + + switch ($mode) + { + case 'admin_roles': + $permission_type = 'a_'; + $this->page_title = 'ACP_ADMIN_ROLES'; + break; + + case 'user_roles': + $permission_type = 'u_'; + $this->page_title = 'ACP_USER_ROLES'; + break; + + case 'mod_roles': + $permission_type = 'm_'; + $this->page_title = 'ACP_MOD_ROLES'; + break; + + case 'forum_roles': + $permission_type = 'f_'; + $this->page_title = 'ACP_FORUM_ROLES'; + break; + + default: + trigger_error('INVALID_MODE'); + } + + $template->assign_vars(array( + 'L_TITLE' => $user->lang[$this->page_title], + 'L_EXPLAIN' => $user->lang[$this->page_title . '_EXPLAIN']) + ); + + // Take action... admin submitted something + if ($submit || $action == 'remove') + { + switch ($action) + { + case 'remove': + + if (!$role_id) + { + trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action)); + } + + $sql = 'SELECT * + FROM ' . ACL_ROLES_TABLE . ' + WHERE role_id = ' . $role_id; + $result = $db->sql_query($sql); + $role_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$role_row) + { + trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action)); + } + + if (confirm_box(true)) + { + $this->remove_role($role_id); + + add_log('admin', 'LOG_' . strtoupper($permission_type) . 'ROLE_REMOVED', $role_row['role_name']); + trigger_error($user->lang['ROLE_DELETED'] . adm_back_link($this->u_action)); + } + else + { + confirm_box(false, 'DELETE_ROLE', build_hidden_fields(array( + 'i' => $id, + 'mode' => $mode, + 'role_id' => $role_id, + 'action' => $action, + ))); + } + + break; + + case 'edit': + if (!$role_id) + { + trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action)); + } + + // Get role we edit + $sql = 'SELECT * + FROM ' . ACL_ROLES_TABLE . ' + WHERE role_id = ' . $role_id; + $result = $db->sql_query($sql); + $role_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$role_row) + { + trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action)); + } + + case 'add': + + $role_name = request_var('role_name', ''); + $role_group_ids = request_var('role_group_ids', array(0)); + $pre_select = request_var('pre_select', 'custom'); + $auth_settings = request_var('setting', array('' => 0)); + + if (!$role_name) + { + trigger_error($user->lang['NO_ROLE_NAME_SPECIFIED'] . adm_back_link($this->u_action)); + } + + // Adjust group array if we have a pre-selection + if ($pre_select != 'custom') + { + $pre_select = (int) $pre_select; + + if (!$pre_select || !isset($this->pre_selection_array[$pre_select])) + { + $role_group_ids = array(0); + } + else + { + $sql = 'SELECT group_id, group_name, group_type + FROM ' . GROUPS_TABLE . ' + ORDER BY group_type DESC, group_name ASC'; + $result = $db->sql_query($sql); + + $groups = array(); + while ($row = $db->sql_fetchrow($result)) + { + $groups[$row['group_type']][$row['group_id']] = $row['group_name']; + } + $db->sql_freeresult($result); + + // Build role_group_ids + $role_group_ids = array(); + + $row = $this->pre_selection_array[$pre_select]; + + if (!$row['negate'] && !isset($row['name'])) + { + foreach ($groups[$row['type']] as $group_id => $group_name) + { + $role_group_ids[] = $group_id; + } + } + else if ($row['negate'] && !isset($row['name'])) + { + $group_types = array(GROUP_OPEN, GROUP_CLOSED, GROUP_HIDDEN, GROUP_SPECIAL, GROUP_FREE); + unset($group_types[array_search($row['type'], $group_types)]); + + foreach ($group_types as $type) + { + foreach ($groups[$type] as $group_id => $group_name) + { + $role_group_ids[] = $group_id; + } + } + } + else if (!$row['negate'] && isset($row['name'])) + { + foreach ($groups[$row['type']] as $group_id => $group_name) + { + if (in_array($group_name, $row['name'])) + { + $role_group_ids[] = $group_id; + } + } + } + else if ($row['negate'] && isset($row['name'])) + { + $group_types = array(GROUP_OPEN, GROUP_CLOSED, GROUP_HIDDEN, GROUP_SPECIAL, GROUP_FREE); + + foreach ($group_types as $type) + { + foreach ($groups[$type] as $group_id => $group_name) + { + if ($type != $row['type']) + { + $role_group_ids[] = $group_id; + } + else if (!in_array($group_name, $row['name'])) + { + $role_group_ids[] = $group_id; + } + } + } + } + } + } + + // if we add/edit a role we check the name to be unique among the settings... + $sql = 'SELECT role_id + FROM ' . ACL_ROLES_TABLE . " + WHERE role_type = '" . $db->sql_escape($permission_type) . "' + AND LOWER(role_name) = '" . $db->sql_escape(strtolower($role_name)) . "'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + // Make sure we only print out the error if we add the role or change it's name + if ($row && ($mode == 'add' || ($mode == 'edit' && strtolower($role_row['role_name']) != strtolower($role_name)))) + { + trigger_error(sprintf($user->lang['ROLE_NAME_ALREADY_EXIST'], $role_name) . adm_back_link($this->u_action)); + } + + // If role_group_ids include "every user/group" we do not need to set it... + if (in_array(0, $role_group_ids)) + { + $role_group_ids = array(0); + } + + $sql_ary = array( + 'role_name' => (string) $role_name, + 'role_type' => (string) $permission_type, + 'role_group_ids' => (string) implode(':', $role_group_ids), + ); + + if ($action == 'edit') + { + $sql = 'UPDATE ' . ACL_ROLES_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE role_id = ' . $role_id; + $db->sql_query($sql); + } + else + { + $sql = 'INSERT INTO ' . ACL_ROLES_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); + $db->sql_query($sql); + + $role_id = $db->sql_nextid(); + } + + // Now add the auth settings + $auth_admin->acl_set_role($role_id, $auth_settings); + + add_log('admin', 'LOG_' . strtoupper($permission_type) . 'ROLE_' . strtoupper($action), $role_name); + + trigger_error($user->lang['ROLE_' . strtoupper($action) . '_SUCCESS'] . adm_back_link($this->u_action)); + + break; + } + } + + // Display screens + switch ($action) + { + case 'add': + + $options_from = request_var('options_from', 0); + + $role_row = array( + 'role_name' => request_var('role_name', ''), + 'role_type' => $permission_type, + 'role_group_ids' => implode(':', request_var('role_group_ids', array(0))), + ); + + if ($options_from) + { + $sql = 'SELECT p.auth_option_id, p.auth_setting, o.auth_option + FROM ' . ACL_ROLES_DATA_TABLE . ' p, ' . ACL_OPTIONS_TABLE . ' o + WHERE o.auth_option_id = p.auth_option_id + AND p.role_id = ' . $options_from . ' + ORDER BY p.auth_option_id'; + $result = $db->sql_query($sql); + + $auth_options = array(); + while ($row = $db->sql_fetchrow($result)) + { + $auth_options[$row['auth_option']] = $row['auth_setting']; + } + $db->sql_freeresult($result); + } + else + { + $sql = 'SELECT auth_option_id, auth_option + FROM ' . ACL_OPTIONS_TABLE . " + WHERE auth_option LIKE '{$permission_type}%' + AND auth_option <> '{$permission_type}' + ORDER BY auth_option_id"; + $result = $db->sql_query($sql); + + $auth_options = array(); + while ($row = $db->sql_fetchrow($result)) + { + $auth_options[$row['auth_option']] = ACL_UNSET; + } + $db->sql_freeresult($result); + } + + case 'edit': + + if ($action == 'edit') + { + if (!$role_id) + { + trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action)); + } + + $sql = 'SELECT * + FROM ' . ACL_ROLES_TABLE . ' + WHERE role_id = ' . $role_id; + $result = $db->sql_query($sql); + $role_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $sql = 'SELECT p.auth_option_id, p.auth_setting, o.auth_option + FROM ' . ACL_ROLES_DATA_TABLE . ' p, ' . ACL_OPTIONS_TABLE . ' o + WHERE o.auth_option_id = p.auth_option_id + AND p.role_id = ' . $role_id . ' + ORDER BY p.auth_option_id'; + $result = $db->sql_query($sql); + + $auth_options = array(); + while ($row = $db->sql_fetchrow($result)) + { + $auth_options[$row['auth_option']] = $row['auth_setting']; + } + $db->sql_freeresult($result); + } + + if (!$role_row) + { + trigger_error($user->lang['NO_PRESET_SELECTED'] . adm_back_link($this->u_action)); + } + + // Build group options array (with pre-selection) + $s_preselect_options = $s_group_options = array(); + $this->build_group_options($role_row['role_group_ids'], $s_preselect_options, $s_group_options); + + $template->assign_vars(array( + 'S_EDIT' => true, + 'S_PRESELECT_OPTIONS' => $s_preselect_options, + 'S_GROUP_OPTIONS' => $s_group_options, + + 'U_ACTION' => $this->u_action . "&action={$action}&role_id={$role_id}", + 'U_BACK' => $this->u_action, + + 'ROLE_NAME' => $role_row['role_name'], + 'L_ACL_TYPE' => $user->lang['ACL_TYPE_' . strtoupper($permission_type)], + ) + ); + + // We need to fill the auth options array with ACL_UNSET options ;) + $sql = 'SELECT auth_option_id, auth_option + FROM ' . ACL_OPTIONS_TABLE . " + WHERE auth_option LIKE '{$permission_type}%' + AND auth_option <> '{$permission_type}' + ORDER BY auth_option_id"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if (!isset($auth_options[$row['auth_option']])) + { + $auth_options[$row['auth_option']] = ACL_UNSET; + } + } + $db->sql_freeresult($result); + + // Unset global permission option + unset($auth_options[$permission_type]); + + // Display auth options + $this->display_auth_options($auth_options); + + // Get users/groups/forums using this preset... + if ($action == 'edit') + { + $hold_ary = $auth_admin->get_role_mask($role_id); + + if (sizeof($hold_ary)) + { + $template->assign_var('S_DISPLAY_ROLE_MASK', true); + $auth_admin->display_role_mask($hold_ary); + } + } + + return; + break; + } + + // Select existing roles + $sql = 'SELECT * + FROM ' . ACL_ROLES_TABLE . " + WHERE role_type = '" . $db->sql_escape($permission_type) . "' + ORDER BY role_name ASC"; + $result = $db->sql_query($sql); + + $roles = $groups = $group_ids = $group_info = array(); + while ($row = $db->sql_fetchrow($result)) + { + $roles[] = $row; + if ($row['role_group_ids']) + { + $groups[$row['role_id']] = explode(':', $row['role_group_ids']); + $group_ids = array_merge($group_ids, $groups[$row['role_id']]); + } + } + $db->sql_freeresult($result); + + if (sizeof($group_ids)) + { + $sql = 'SELECT group_id, group_type, group_name + FROM ' . GROUPS_TABLE . ' + WHERE group_id IN (' . implode(', ', array_map('intval', $group_ids)) . ')'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $group_info[$row['group_id']] = array( + 'group_name' => ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'], + 'group_special' => ($row['group_type'] == GROUP_SPECIAL) ? true : false, + ); + } + $db->sql_freeresult($result); + } + + $s_role_options = ''; + foreach ($roles as $row) + { + $template->assign_block_vars('roles', array( + 'NAME' => $row['role_name'], + + 'S_GROUP' => ($row['role_group_ids']) ? true : false, + + 'U_EDIT' => $this->u_action . '&action=edit&role_id=' . $row['role_id'], + 'U_REMOVE' => $this->u_action . '&action=remove&role_id=' . $row['role_id'], + 'U_DISPLAY_ITEMS' => $this->u_action . '&display_item=' . $row['role_id'] . '#assigned_to') + ); + + if (isset($groups[$row['role_id']]) && sizeof($groups[$row['role_id']])) + { + foreach ($groups[$row['role_id']] as $group_id) + { + $template->assign_block_vars('roles.groups', array( + 'S_SPECIAL_GROUP' => $group_info[$group_id]['group_special'], + 'GROUP_NAME' => $group_info[$group_id]['group_name'], + 'U_GROUP' => $phpbb_root_path . "memberlist.$phpEx$SID&mode=group&g=$group_id") + ); + } + } + + $s_role_options .= ''; + } + + $template->assign_vars(array( + 'S_ROLE_OPTIONS' => $s_role_options) + ); + + // Display assigned items? + $display_item = request_var('display_item', 0); + + if ($display_item) + { + $template->assign_var('S_DISPLAY_ROLE_MASK', true); + + $hold_ary = $auth_admin->get_role_mask($display_item); + $auth_admin->display_role_mask($hold_ary); + } + } + + /** + * Display permission settings able to be set + */ + function display_auth_options($auth_options) + { + global $template, $user; + + $content_array = $categories = array(); + $key_sort_array = array(0); + $auth_options = array(0 => $auth_options); + + // Making use of auth_admin method here (we do not really want to change two similar code fragments) + auth_admin::build_permission_array($auth_options, $content_array, $categories, $key_sort_array); + + $content_array = $content_array[0]; + + $template->assign_var('S_NUM_PERM_COLS', sizeof($categories)); + + // Assign to template + foreach ($content_array as $cat => $cat_array) + { + $template->assign_block_vars('auth', array( + 'CAT_NAME' => $user->lang['permission_cat'][$cat], + 'S_YES' => $cat_array['S_YES'], + 'S_NO' => $cat_array['S_NO'], + 'S_UNSET' => $cat_array['S_UNSET']) + ); + + foreach ($cat_array['permissions'] as $permission => $allowed) + { + $template->assign_block_vars('auth.mask', array( + 'S_YES' => ($allowed == ACL_YES) ? true : false, + 'S_NO' => ($allowed == ACL_NO) ? true : false, + 'S_UNSET' => ($allowed == ACL_UNSET) ? true : false, + + 'FIELD_NAME' => $permission, + 'PERMISSION' => $user->lang['acl_' . $permission]['lang']) + ); + } + } + } + + + /** + * Build user-friendly group options + */ + function build_group_options($role_group_ids, &$s_preselect_options, &$s_group_options) + { + global $db, $user, $template; + + $groups = $selected_groups = array(); + + $sql = 'SELECT group_id, group_name, group_type + FROM ' . GROUPS_TABLE . ' + ORDER BY group_type DESC, group_name ASC'; + $result = $db->sql_query($sql); + + $groups = array(); + while ($row = $db->sql_fetchrow($result)) + { + $groups[$row['group_type']][$row['group_id']] = $row['group_name']; + } + $db->sql_freeresult($result); + + $selected_group_ids = explode(':', $role_group_ids); + + // First of all, build the group options for the custom interface... + $s_group_options = ''; + foreach ($groups as $group_type => $group_row) + { + foreach ($group_row as $group_id => $group_name) + { + if (in_array($group_id, $selected_group_ids)) + { + $selected_groups[$group_type][$group_id] = $group_name; + } + $s_group_options .= ''; + } + } + + // Build preselect array... + $one_selected_item = false; + + $s_preselect_options = ''; + if (!$role_group_ids) + { + $one_selected_item = true; + } + + // Build pre-selection dropdown field + foreach ($this->pre_selection_array as $option_id => $row) + { + if (!$row['negate'] && !isset($row['name'])) + { + $s_selected = false; + if (sizeof($selected_groups) == 1 && isset($selected_groups[$row['type']]) && sizeof($selected_groups[$row['type']]) == sizeof($groups[$row['type']])) + { + $s_selected = true; + } + } + else if ($row['negate'] && !isset($row['name'])) + { + $group_types = array(GROUP_OPEN, GROUP_CLOSED, GROUP_HIDDEN, GROUP_SPECIAL, GROUP_FREE); + unset($group_types[array_search($row['type'], $group_types)]); + + $s_selected = true; + if (isset($selected_groups[$row['type']])) + { + $s_selected = false; + } + + foreach ($group_types as $type) + { + if (!isset($selected_groups[$type]) || sizeof($selected_groups[$type]) != sizeof($groups[$type])) + { + $s_selected = false; + } + } + } + else if (!$row['negate'] && isset($row['name'])) + { + $s_selected = false; + if (sizeof($selected_groups) == 1 && isset($selected_groups[$row['type']]) && sizeof($selected_groups[$row['type']]) == sizeof($row['name'])) + { + $s_selected = true; + + foreach ($row['name'] as $name) + { + if (!in_array($name, $selected_groups[$row['type']])) + { + $s_selected = false; + } + } + } + } + else if ($row['negate'] && isset($row['name'])) + { + $group_types = array(GROUP_OPEN, GROUP_CLOSED, GROUP_HIDDEN, GROUP_SPECIAL, GROUP_FREE); + unset($group_types[array_search($row['type'], $group_types)]); + + $s_selected = true; + if (isset($selected_groups[$row['type']])) + { + foreach ($row['name'] as $name) + { + if (in_array($name, $selected_groups[$row['type']])) + { + $s_selected = false; + } + } + } + + foreach ($group_types as $type) + { + if (!isset($selected_groups[$type]) || sizeof($selected_groups[$type]) != sizeof($groups[$type])) + { + $s_selected = false; + } + } + } + + if ($s_selected) + { + $one_selected_item = true; + } + + $s_preselect_options .= ''; + } + + $s_preselect_options .= ''; + + $template->assign_var('S_CUSTOM_GROUP_IDS', ($one_selected_item) ? false : true); + } + + /** + * Remove role + */ + function remove_role($role_id) + { + global $db; + + $auth_admin = new auth_admin(); + + // First of all, get the role auth settings we need to re-set... + $sql = 'SELECT o.auth_option, r.auth_setting + FROM ' . ACL_ROLES_DATA_TABLE . ' r, ' . ACL_OPTIONS_TABLE . ' o + WHERE o.auth_option_id = r.auth_option_id + AND r.role_id = ' . $role_id; + $result = $db->sql_query($sql); + + $auth_settings = array(); + while ($row = $db->sql_fetchrow($result)) + { + $auth_settings[$row['auth_option']] = $row['auth_setting']; + } + $db->sql_freeresult($result); + + // Get role assignments + $hold_ary = $auth_admin->get_role_mask($role_id); + + // Remove role from users and groups + $sql = 'DELETE FROM ' . ACL_USERS_TABLE . ' + WHERE auth_role_id = ' . $role_id; + $db->sql_query($sql); + + $sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . ' + WHERE auth_role_id = ' . $role_id; + $db->sql_query($sql); + + // Re-assign permisisons + foreach ($hold_ary as $forum_id => $forum_ary) + { + if (isset($forum_ary['users'])) + { + $auth_admin->acl_set('user', $forum_id, $forum_ary['users'], $auth_settings); + } + + if (isset($forum_ary['groups'])) + { + $auth_admin->acl_set('group', $forum_id, $forum_ary['users'], $auth_settings); + } + } + + // Remove role data and role + $sql = 'DELETE FROM ' . ACL_ROLES_DATA_TABLE . ' + WHERE role_id = ' . $role_id; + $db->sql_query($sql); + + $sql = 'DELETE FROM ' . ACL_ROLES_TABLE . ' + WHERE role_id = ' . $role_id; + $db->sql_query($sql); + } +} + +/** +* @package module_install +*/ +class acp_permission_roles_info +{ + function module() + { + return array( + 'filename' => 'acp_permission_roles', + 'title' => 'ACP_PERMISSION_ROLES', + 'version' => '1.0.0', + 'modes' => array( + 'admin_roles' => array('title' => 'ACP_ADMIN_ROLES', 'auth' => 'acl_a_roles'), + 'user_roles' => array('title' => 'ACP_USER_ROLES', 'auth' => 'acl_a_roles'), + 'mod_roles' => array('title' => 'ACP_MOD_ROLES', 'auth' => 'acl_a_roles'), + 'forum_roles' => array('title' => 'ACP_FORUM_ROLES', 'auth' => 'acl_a_roles'), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} + +?> \ No newline at end of file diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php index f47133c7b9..dec3e03170 100644 --- a/phpBB/includes/acp/acp_permissions.php +++ b/phpBB/includes/acp/acp_permissions.php @@ -38,11 +38,14 @@ class acp_permissions $action = (isset($_POST['psubmit'])) ? 'apply_permissions' : $action; $all_forums = request_var('all_forums', 0); - $user_id = request_var('user_id', array(0)); - $group_id = request_var('group_id', array(0)); + $subforum_id = request_var('subforum_id', 0); $forum_id = request_var('forum_id', array(0)); + $username = request_var('username', array('')); $usernames = request_var('usernames', ''); + $user_id = request_var('user_id', array(0)); + + $group_id = request_var('group_id', array(0)); // Map usernames to ids and vice versa if ($usernames) @@ -62,11 +65,45 @@ class acp_permissions } unset($username); + // Build forum ids (of all forums are checked or subforum listing used) + if ($all_forums) + { + $sql = 'SELECT forum_id + FROM ' . FORUMS_TABLE . ' + ORDER BY left_id'; + $result = $db->sql_query($sql); + + $forum_id = array(); + while ($row = $db->sql_fetchrow($result)) + { + $forum_id[] = $row['forum_id']; + } + $db->sql_freeresult($result); + } + else if ($subforum_id) + { + $forum_id = array(); + foreach (get_forum_branch($subforum_id, 'children') as $row) + { + $forum_id[] = $row['forum_id']; + } + } + // Define some common variables for every mode $error = array(); $permission_scope = (strpos($mode, '_global') !== false) ? 'global' : 'local'; + // Showing introductionary page? + if ($mode == 'intro') + { + $template->assign_vars(array( + 'S_INTRO' => true) + ); + + return; + } + switch ($mode) { case 'setting_user_global': @@ -168,11 +205,6 @@ class acp_permissions 'type' => $permission_type) ); - if ($all_forums) - { - $s_hidden_fields .= build_hidden_fields(array('all_forums' => $all_forums)); - } - // Go through the screens/options needed and present them in correct order foreach ($permission_victim as $victim) { @@ -195,19 +227,28 @@ class acp_permissions case 'forums': - if (sizeof($forum_id) || $all_forums) + if (sizeof($forum_id)) { - if (sizeof($forum_id)) - { - $this->check_existence('forum', $forum_id); - } - + $this->check_existence('forum', $forum_id); continue 2; } + $forum_list = make_forum_select(false, false, false, false, true, true); + + // Build forum options + $s_forum_options = ''; + foreach ($forum_list as $f_id => $f_row) + { + $s_forum_options .= ''; + } + + // Build subforum options + $s_subforum_options = $this->build_subforum_options($forum_list); + $template->assign_vars(array( 'S_SELECT_FORUM' => true, - 'S_FORUM_OPTIONS' => make_forum_select(false, false, false), + 'S_FORUM_OPTIONS' => $s_forum_options, + 'S_SUBFORUM_OPTIONS' => $s_subforum_options, 'S_FORUM_ALL' => true, 'S_FORUM_MULTIPLE' => true) ); @@ -263,29 +304,33 @@ class acp_permissions } $sql_forum_id = ($permission_scope == 'global') ? 'AND a.forum_id = 0' : ((sizeof($forum_id)) ? 'AND a.forum_id IN (' . implode(', ', $forum_id) . ')' : 'AND a.forum_id <> 0'); - $sql_permission_option = "o.auth_option LIKE '" . $db->sql_escape($permission_type) . "%'"; + $sql_permission_option = "AND o.auth_option LIKE '" . $db->sql_escape($permission_type) . "%'"; $sql = 'SELECT DISTINCT u.user_id, u.username - FROM ' . USERS_TABLE . ' u, ' . ACL_USERS_TABLE . ' a, ' . ACL_OPTIONS_TABLE . " o - WHERE $sql_permission_option + FROM (' . USERS_TABLE . ' u, ' . ACL_USERS_TABLE . ' a, ' . ACL_OPTIONS_TABLE . ' o) + LEFT JOIN ' . ACL_ROLES_DATA_TABLE . " r ON (a.auth_role_id = r.role_id) + WHERE (a.auth_option_id = o.auth_option_id OR r.auth_option_id = o.auth_option_id) + $sql_permission_option $sql_forum_id - AND a.auth_option_id = o.auth_option_id AND u.user_id = a.user_id ORDER BY u.username, u.user_regdate ASC"; $result = $db->sql_query($sql); $s_defined_user_options = ''; + $defined_user_ids = array(); while ($row = $db->sql_fetchrow($result)) { $s_defined_user_options .= ''; + $defined_user_ids[] = $row['user_id']; } $db->sql_freeresult($result); $sql = 'SELECT DISTINCT g.group_id, g.group_name, g.group_type - FROM ' . GROUPS_TABLE . ' g, ' . ACL_GROUPS_TABLE . ' a, ' . ACL_OPTIONS_TABLE . " o - WHERE $sql_permission_option + FROM (' . GROUPS_TABLE . ' g, ' . ACL_GROUPS_TABLE . ' a, ' . ACL_OPTIONS_TABLE . ' o) + LEFT JOIN ' . ACL_ROLES_DATA_TABLE . " r ON (a.auth_role_id = r.role_id) + WHERE (a.auth_option_id = o.auth_option_id OR r.auth_option_id = o.auth_option_id) + $sql_permission_option $sql_forum_id - AND a.auth_option_id = o.auth_option_id AND g.group_id = a.group_id ORDER BY g.group_type DESC, g.group_name ASC"; $result = $db->sql_query($sql); @@ -299,6 +344,22 @@ class acp_permissions } $db->sql_freeresult($result); + // Now we check the users... because the "all"-selection is different here (all defined users/groups) + $all_users = (isset($_POST['all_users'])) ? true : false; + $all_groups = (isset($_POST['all_groups'])) ? true : false; + + if ($all_users && sizeof($defined_user_ids)) + { + $user_id = $defined_user_ids; + continue 2; + } + + if ($all_groups && sizeof($defined_group_ids)) + { + $group_id = $defined_group_ids; + continue 2; + } + $template->assign_vars(array( 'S_SELECT_USERGROUP' => ($victim == 'usergroup') ? true : false, 'S_SELECT_USERGROUP_VIEW' => ($victim == 'usergroup_view') ? true : false, @@ -346,12 +407,6 @@ class acp_permissions return; } - // Set to all forums if selected - if ($permission_scope == 'local' && $all_forums) - { - $forum_id = array(); - } - // Do not allow forum_ids being set and no other setting defined (will bog down the server too much) if (sizeof($forum_id) && !sizeof($user_id) && !sizeof($group_id)) { @@ -386,6 +441,45 @@ class acp_permissions } } + /** + * Build +subforum options + */ + function build_subforum_options($forum_list) + { + global $user; + + $s_options = ''; + + $forum_list = array_merge($forum_list); + + foreach ($forum_list as $key => $row) + { + $s_options .= ''; + } + + return $s_options; + } + /** * Build dropdown field for changing permission types */ @@ -476,9 +570,12 @@ class acp_permissions $auth_settings = array_map('intval', $_POST['setting'][$ug_id][$forum_id]); - // Do the admin want to set these permissions to other forums too? + // Do we have a role we want to set? + $assigned_role = (isset($_POST['role'][$ug_id][$forum_id])) ? (int) $_POST['role'][$ug_id][$forum_id] : 0; + + // Do the admin want to set these permissions to other items too? $inherit = request_var('inherit', array(0)); - + $ug_id = array($ug_id); $forum_id = array($forum_id); @@ -499,8 +596,17 @@ class acp_permissions $forum_id = array_unique($forum_id); + // If the auth settings differ from the assigned role, then do not set a role... + if ($assigned_role) + { + if (!$this->check_assigned_role($assigned_role, $auth_settings)) + { + $assigned_role = 0; + } + } + // Update the permission set... - $auth_admin->acl_set($ug_type, $forum_id, $ug_id, $auth_settings); + $auth_admin->acl_set($ug_type, $forum_id, $ug_id, $auth_settings, $assigned_role); // Do we need to recache the moderator lists? if ($permission_type == 'm_') @@ -549,8 +655,20 @@ class acp_permissions $forum_id = (int) $forum_id; $forum_ids[] = $forum_id; + // Check role... + $assigned_role = (isset($_POST['role'][$ug_id][$forum_id])) ? (int) $_POST['role'][$ug_id][$forum_id] : 0; + + // If the auth settings differ from the assigned role, then do not set a role... + if ($assigned_role) + { + if (!$this->check_assigned_role($assigned_role, $auth_options)) + { + $assigned_role = 0; + } + } + // Update the permission set... - $auth_admin->acl_set($ug_type, $forum_id, $ug_id, $auth_options); + $auth_admin->acl_set($ug_type, $forum_id, $ug_id, $auth_options, $assigned_role); } } @@ -571,6 +689,44 @@ class acp_permissions trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action)); } + /** + * Compare auth settings with auth settings from role + * returns false if they differ, true if they are equal + */ + function check_assigned_role($role_id, &$auth_settings) + { + global $db; + + $sql = 'SELECT o.auth_option, r.auth_setting + FROM ' . ACL_OPTIONS_TABLE . ' o, ' . ACL_ROLES_DATA_TABLE . ' r + WHERE o.auth_option_id = r.auth_option_id + AND r.role_id = ' . $role_id; + $result = $db->sql_query($sql); + + $test_auth_settings = array(); + while ($row = $db->sql_fetchrow($result)) + { + $test_auth_settings[$row['auth_option']] = $row['auth_setting']; + } + $db->sql_freeresult($result); + + // We need to add any ACL_UNSET setting from auth_settings to compare correctly + foreach ($auth_settings as $option => $setting) + { + if ($setting == ACL_UNSET) + { + $test_auth_settings[$option] = $setting; + } + } + + if (sizeof(array_diff_assoc($auth_settings, $test_auth_settings))) + { + return false; + } + + return true; + } + /** * Remove permissions */ @@ -708,6 +864,8 @@ class acp_permissions_info 'title' => 'ACP_PERMISSIONS', 'version' => '1.0.0', 'modes' => array( + 'intro' => array('title' => 'ACP_PERMISSIONS', 'auth' => 'acl_a_authusers || acl_a_authgroups || acl_a_viewauth'), + 'setting_user_global' => array('title' => 'ACP_USERS_PERMISSIONS', 'auth' => 'acl_a_authusers && (acl_a_aauth || acl_a_mauth || acl_a_uauth)'), 'setting_user_local' => array('title' => 'ACP_USERS_FORUM_PERMISSIONS', 'auth' => 'acl_a_authusers && (acl_a_mauth || acl_a_fauth)'), 'setting_group_global' => array('title' => 'ACP_GROUPS_PERMISSIONS', 'auth' => 'acl_a_authgroups && (acl_a_aauth || acl_a_mauth || acl_a_uauth)'), diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php index ab744990a2..905ab2b7cc 100644 --- a/phpBB/includes/acp/auth.php +++ b/phpBB/includes/acp/auth.php @@ -166,19 +166,19 @@ class auth_admin extends auth } /** - * Get permission mask for presets - * This function only supports getting masks for one preset + * Get permission mask for roles + * This function only supports getting masks for one role */ - function get_preset_mask($preset_id) + function get_role_mask($role_id) { global $db; $hold_ary = array(); - // Get users having this preset set... + // Get users having this role set... $sql = 'SELECT user_id, forum_id FROM ' . ACL_USERS_TABLE . ' - WHERE auth_preset_id = ' . $preset_id . ' + WHERE auth_role_id = ' . $role_id . ' ORDER BY forum_id'; $result = $db->sql_query($sql); @@ -191,7 +191,7 @@ class auth_admin extends auth // Now grab groups... $sql = 'SELECT group_id, forum_id FROM ' . ACL_GROUPS_TABLE . ' - WHERE auth_preset_id = ' . $preset_id . ' + WHERE auth_role_id = ' . $role_id . ' ORDER BY forum_id'; $result = $db->sql_query($sql); @@ -261,6 +261,49 @@ class auth_admin extends auth $forum_names_ary[0] = $l_acl_type; } + // Get available roles + $sql = 'SELECT * + FROM ' . ACL_ROLES_TABLE . " + WHERE role_type = '" . $db->sql_escape($permission_type) . "'"; + $result = $db->sql_query($sql); + + $roles = array(); + while ($row = $db->sql_fetchrow($result)) + { + $roles[$row['role_id']] = $row; + $roles[$row['role_id']]['groups'] = ($row['role_group_ids']) ? explode(':', $row['role_group_ids']) : array(); + } + $db->sql_freeresult($result); + + $cur_roles = $this->acl_role_data($user_mode, $permission_type, array_keys($hold_ary)); + + // Build js roles array (role data assignments) + $s_role_js_array = ''; + + if (sizeof($roles)) + { + $sql = 'SELECT r.role_id, o.auth_option, r.auth_setting + FROM ' . ACL_ROLES_DATA_TABLE . ' r, ' . ACL_OPTIONS_TABLE . ' o + WHERE o.auth_option_id = r.auth_option_id + AND r.role_id IN (' . implode(', ', array_keys($roles)) . ')'; + $result = $db->sql_query($sql); + + $s_role_js_array = array(); + while ($row = $db->sql_fetchrow($result)) + { + if (!isset($s_role_js_array[$row['role_id']])) + { + $s_role_js_array[$row['role_id']] = "\n" . 'role_options[' . $row['role_id'] . '] = new Array();' . "\n"; + } + $s_role_js_array[$row['role_id']] .= 'role_options[' . $row['role_id'] . '][\'' . $row['auth_option'] . '\'] = ' . $row['auth_setting'] . '; '; + } + $db->sql_freeresult($result); + + $s_role_js_array = implode('', $s_role_js_array); + } + + $template->assign_var('S_ROLE_JS_ARRAY', $s_role_js_array); + // Now obtain memberships $user_groups_default = $user_groups_custom = array(); if ($user_mode == 'user' && $group_display) @@ -293,9 +336,10 @@ class auth_admin extends auth unset($memberships, $groups); } - // If we only have one forum id to display, we switch the complete interface to group by user/usergroup instead of grouping by forum + // If we only have one forum id to display or being in local mode and more than one user/group to display, + // we switch the complete interface to group by user/usergroup instead of grouping by forum // To achive this, we need to switch the array a bit - if (sizeof($forum_ids) == 1) + if (sizeof($forum_ids) == 1 || ($local && sizeof($ug_names_ary) > 1)) { $hold_ary_temp = $hold_ary; $hold_ary = array(); @@ -330,10 +374,28 @@ class auth_admin extends auth foreach ($content_array as $ug_id => $ug_array) { + // Build role dropdown options + $current_role_id = (isset($cur_roles[$ug_id][$forum_id])) ? $cur_roles[$ug_id][$forum_id] : 0; + + $s_role_options = ''; + foreach ($roles as $role_id => $role_row) + { + if ($role_id == $current_role_id || !sizeof($role_row['groups']) || ($user_mode == 'group' && in_array($ug_id, $role_row['groups']))) + { + $s_role_options .= ''; + } + } + + if ($s_role_options) + { + $s_role_options = '' . $s_role_options; + } + $template->assign_block_vars($tpl_pmask . '.' . $tpl_fmask, array( - 'NAME' => $ug_names_ary[$ug_id], - 'UG_ID' => $ug_id, - 'FORUM_ID' => $forum_id) + 'NAME' => $ug_names_ary[$ug_id], + 'S_ROLE_OPTIONS' => $s_role_options, + 'UG_ID' => $ug_id, + 'FORUM_ID' => $forum_id) ); $this->assign_cat_array($ug_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id); @@ -371,11 +433,29 @@ class auth_admin extends auth foreach ($content_array as $forum_id => $forum_array) { + // Build role dropdown options + $current_role_id = (isset($cur_roles[$ug_id][$forum_id])) ? $cur_roles[$ug_id][$forum_id] : 0; + + $s_role_options = ''; + foreach ($roles as $role_id => $role_row) + { + if ($role_id == $current_role_id || !sizeof($role_row['groups']) || ($user_mode == 'group' && in_array($ug_id, $role_row['groups']))) + { + $s_role_options .= ''; + } + } + + if ($s_role_options) + { + $s_role_options = '' . $s_role_options; + } + $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'], - 'UG_ID' => $ug_id, - 'FORUM_ID' => $forum_id) + '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, + 'UG_ID' => $ug_id, + 'FORUM_ID' => $forum_id) ); $this->assign_cat_array($forum_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id); @@ -385,9 +465,9 @@ class auth_admin extends auth } /** - * Display permission mask for presets + * Display permission mask for roles */ - function display_preset_mask(&$hold_ary) + function display_role_mask(&$hold_ary) { global $db, $template, $user, $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID; @@ -411,7 +491,7 @@ class auth_admin extends auth foreach ($hold_ary as $forum_id => $auth_ary) { - $template->assign_block_vars('preset_mask', array( + $template->assign_block_vars('role_mask', array( 'NAME' => ($forum_id == 0) ? $user->lang['GLOBAL_MASK'] : $forum_names[$forum_id], 'FORUM_ID' => $forum_id) ); @@ -426,7 +506,7 @@ class auth_admin extends auth while ($row = $db->sql_fetchrow($result)) { - $template->assign_block_vars('preset_mask.users', array( + $template->assign_block_vars('role_mask.users', array( 'USER_ID' => $row['user_id'], 'USERNAME' => $row['username'], 'U_PROFILE' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u={$row['user_id']}") @@ -445,7 +525,7 @@ class auth_admin extends auth while ($row = $db->sql_fetchrow($result)) { - $template->assign_block_vars('preset_mask.groups', array( + $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'], 'U_PROFILE' => $phpbb_root_path . "memberlist.$phpEx$SID&mode=group&g={$row['group_id']}") @@ -566,7 +646,7 @@ class auth_admin extends auth /** * Set a user or group ACL record */ - function acl_set($ug_type, &$forum_id, &$ug_id, &$auth) + function acl_set($ug_type, &$forum_id, &$ug_id, &$auth, $role_id = 0) { global $db; @@ -599,120 +679,70 @@ class auth_admin extends auth $ug_id_sql = 'IN (' . implode(', ', array_map('intval', $ug_id)) . ')'; $forum_sql = 'IN (' . implode(', ', array_map('intval', $forum_id)) . ') '; - // Set any flags as required - foreach ($auth as $auth_option => $setting) - { - $flag = substr($auth_option, 0, strpos($auth_option, '_') + 1); - - if (!isset($auth[$flag]) || !$auth[$flag]) - { - $auth[$flag] = $setting; - } - } - - if ($ug_type == 'user') - { - $sql = 'SELECT o.auth_option_id, o.auth_option, a.forum_id, a.auth_setting - FROM ' . ACL_USERS_TABLE . ' a, ' . ACL_OPTIONS_TABLE . " o - WHERE a.auth_option_id = o.auth_option_id - AND a.forum_id $forum_sql - AND a.user_id $ug_id_sql"; - } - else - { - $sql = 'SELECT o.auth_option_id, o.auth_option, a.forum_id, a.auth_setting - FROM ' . ACL_GROUPS_TABLE . ' a, ' . ACL_OPTIONS_TABLE . " o - WHERE a.auth_option_id = o.auth_option_id - AND a.forum_id $forum_sql - AND a.group_id $ug_id_sql"; - } - $result = $db->sql_query($sql); - - $cur_auth = array(); - while ($row = $db->sql_fetchrow($result)) - { - $cur_auth[$row['forum_id']][$row['auth_option_id']] = $row['auth_setting']; - } - $db->sql_freeresult($result); - + // Instead of updating, inserting, removing we just remove all current settings and re-set everything... $table = ($ug_type == 'user') ? ACL_USERS_TABLE : ACL_GROUPS_TABLE; $id_field = $ug_type . '_id'; + // Remove current auth options... + $sql = "DELETE FROM $table + WHERE forum_id $forum_sql + AND $id_field $ug_id_sql"; + $db->sql_query($sql); + $sql_ary = array(); foreach ($forum_id as $forum) { $forum = (int) $forum; - foreach ($auth as $auth_option => $setting) + if ($role_id) { - $auth_option_id = (int) $this->option_ids[$auth_option]; - - switch ($setting) + foreach ($ug_id as $id) { - case ACL_UNSET: - if (isset($cur_auth[$forum][$auth_option_id])) - { - $sql_ary['delete'][] = "DELETE FROM $table - WHERE forum_id = $forum - AND auth_option_id = $auth_option_id - AND $id_field $ug_id_sql"; - } - break; + $sql_ary[] = array( + $id_field => (int) $id, + 'forum_id' => (int) $forum, + 'auth_option_id' => 0, + 'auth_setting' => 0, + 'auth_role_id' => $role_id + ); + } + } + else + { + foreach ($auth as $auth_option => $setting) + { + $auth_option_id = (int) $this->option_ids[$auth_option]; - default: - if (!isset($cur_auth[$forum][$auth_option_id])) + if ($setting != ACL_UNSET) + { + foreach ($ug_id as $id) { - foreach ($ug_id as $id) - { - $sql_ary['insert'][] = array( - $id_field => (int) $id, - 'forum_id' => (int) $forum, - 'auth_option_id' => (int) $auth_option_id, - 'auth_setting' => (int) $setting - ); - } + $sql_ary[] = array( + $id_field => (int) $id, + 'forum_id' => (int) $forum, + 'auth_option_id' => (int) $auth_option_id, + 'auth_setting' => (int) $setting + ); } - else if ($cur_auth[$forum][$auth_option_id] != $setting) - { - $sql_ary['update'][] = "UPDATE $table - SET auth_setting = " . (int) $setting . " - WHERE $id_field $ug_id_sql - AND forum_id = $forum - AND auth_option_id = $auth_option_id"; - } - break; + } } } } - unset($cur_auth); - foreach ($sql_ary as $sql_type => $sql_subary) + if (sizeof($sql_ary)) { - switch ($sql_type) + switch (SQL_LAYER) { - case 'insert': - switch (SQL_LAYER) - { - case 'mysql': - case 'mysql4': - case 'mysqli': - $db->sql_query("INSERT INTO $table " . $db->sql_build_array('MULTI_INSERT', $sql_subary)); - break; - - default: - foreach ($sql_subary as $ary) - { - $db->sql_query("INSERT INTO $table " . $db->sql_build_array('INSERT', $ary)); - } - break; - } + case 'mysql': + case 'mysql4': + case 'mysqli': + $db->sql_query("INSERT INTO $table " . $db->sql_build_array('MULTI_INSERT', $sql_ary)); break; - case 'update': - case 'delete': - foreach ($sql_subary as $sql) + default: + foreach ($sql_ary as $ary) { - $db->sql_query($sql); + $db->sql_query("INSERT INTO $table " . $db->sql_build_array('INSERT', $ary)); } break; } @@ -722,9 +752,9 @@ class auth_admin extends auth } /** - * Set a preset ACL record + * Set a role-specific ACL record */ - function acl_set_preset($preset_id, &$auth) + function acl_set_role($role_id, &$auth) { global $db; @@ -742,97 +772,40 @@ class auth_admin extends auth $db->sql_freeresult($result); } - // Set any flags as required - foreach ($auth as $auth_option => $setting) - { - $flag = substr($auth_option, 0, strpos($auth_option, '_') + 1); - - if (!isset($auth[$flag]) || !$auth[$flag]) - { - $auth[$flag] = $setting; - } - } - - $sql = 'SELECT auth_option_id, auth_setting - FROM ' . ACL_PRESETS_DATA_TABLE . ' - WHERE preset_id = ' . $preset_id; - $result = $db->sql_query($sql); - - $cur_auth = array(); - while ($row = $db->sql_fetchrow($result)) - { - $cur_auth[$row['auth_option_id']] = $row['auth_setting']; - } - $db->sql_freeresult($result); + // Remove current auth options... + $sql = 'DELETE FROM ' . ACL_ROLES_DATA_TABLE . ' + WHERE role_id = ' . $role_id; + $db->sql_query($sql); $sql_ary = array(); - foreach ($auth as $auth_option => $setting) { $auth_option_id = (int) $this->option_ids[$auth_option]; - switch ($setting) + if ($setting != ACL_UNSET) { - case ACL_UNSET: - if (isset($cur_auth[$auth_option_id])) - { - $sql_ary['delete'][] = 'DELETE FROM ' . ACL_PRESETS_DATA_TABLE . ' - WHERE auth_option_id = ' . $auth_option_id . ' - AND preset_id = ' . $preset_id; - } - break; - - default: - if (!isset($cur_auth[$auth_option_id])) - { - $sql_ary['insert'][] = array( - 'preset_id' => (int) $preset_id, - 'auth_option_id' => (int) $auth_option_id, - 'auth_setting' => (int) $setting - ); - } - else if ($cur_auth[$auth_option_id] != $setting) - { - $sql_ary['update'][] = 'UPDATE ' . ACL_PRESETS_DATA_TABLE . ' - SET auth_setting = ' . (int) $setting . ' - WHERE preset_id = ' . $preset_id . ' - AND auth_option_id = ' . $auth_option_id; - } - break; + $sql_ary[] = array( + 'role_id' => (int) $role_id, + 'auth_option_id' => (int) $auth_option_id, + 'auth_setting' => (int) $setting + ); } } - unset($cur_auth); - foreach ($sql_ary as $sql_type => $sql_subary) + switch (SQL_LAYER) { - switch ($sql_type) - { - case 'insert': - switch (SQL_LAYER) - { - case 'mysql': - case 'mysql4': - case 'mysqli': - $db->sql_query('INSERT INTO ' . ACL_PRESETS_DATA_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $sql_subary)); - break; + case 'mysql': + case 'mysql4': + case 'mysqli': + $db->sql_query('INSERT INTO ' . ACL_ROLES_DATA_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $sql_ary)); + break; - default: - foreach ($sql_subary as $ary) - { - $db->sql_query('INSERT INTO ' . ACL_PRESETS_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $ary)); - } - break; - } - break; - - case 'update': - case 'delete': - foreach ($sql_subary as $sql) - { - $db->sql_query($sql); - } - break; - } + default: + foreach ($sql_ary as $ary) + { + $db->sql_query('INSERT INTO ' . ACL_ROLES_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $ary)); + } + break; } $this->acl_clear_prefetch(); @@ -840,6 +813,7 @@ class auth_admin extends auth /** * Remove local permission + * @todo take roles into consideration (if one auth option is being removed and placed within a role we need to re-build the acl entries) */ function acl_delete($mode, $ug_id = false, $forum_id = false, $auth_id = false) { diff --git a/phpBB/includes/auth.php b/phpBB/includes/auth.php index ad6de1d6a8..80e57f1254 100644 --- a/phpBB/includes/auth.php +++ b/phpBB/includes/auth.php @@ -353,7 +353,7 @@ class auth if (sizeof($hold_ary)) { ksort($hold_ary); - + $last_f = 0; foreach ($hold_ary as $f => $auth_ary) @@ -378,7 +378,7 @@ class auth } else { - $bitstring[$id] = 0; + $bitstring[$id] = ACL_NO; } } @@ -427,6 +427,39 @@ class auth return; } + /** + * Get assigned roles + */ + function acl_role_data($user_type, $role_type, $ug_id = false, $forum_id = false) + { + global $db; + + $roles = array(); + + $sql_id = ($user_type == 'user') ? 'user_id' : 'group_id'; + + $sql_ug = ($ug_id !== false) ? ((!is_array($ug_id)) ? "AND a.$sql_id = $ug_id" : "AND a.$sql_id IN (" . implode(', ', $ug_id) . ')') : ''; + $sql_forum = ($forum_id !== false) ? ((!is_array($forum_id)) ? "AND a.forum_id = $forum_id" : 'AND a.forum_id IN (' . implode(', ', $forum_id) . ')') : ''; + + // Grab assigned roles... + $sql = 'SELECT a.auth_role_id, a.' . $sql_id . ', a.forum_id + FROM ' . (($user_type == 'user') ? ACL_USERS_TABLE : ACL_GROUPS_TABLE) . ' a, ' . ACL_ROLES_TABLE . " r + WHERE a.auth_role_id = r.role_id + AND r.role_type = '" . $db->sql_escape($role_type) . "' + $sql_ug + $sql_forum + ORDER BY r.role_name ASC"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $roles[$row[$sql_id]][$row['forum_id']] = $row['auth_role_id']; + } + $db->sql_freeresult($result); + + return $roles; + } + /** * Get raw acl data based on user/option/forum */ @@ -455,37 +488,41 @@ class auth // First grab user settings ... each user has only one setting for each // option ... so we shouldn't need any ACL_NO checks ... he says ... - $sql = 'SELECT ao.auth_option, a.user_id, a.forum_id, a.auth_setting - FROM ' . ACL_OPTIONS_TABLE . ' ao, ' . ACL_USERS_TABLE . ' a - WHERE ao.auth_option_id = a.auth_option_id + $sql = 'SELECT ao.auth_option, a.auth_role_id, r.auth_setting as role_auth_setting, a.user_id, a.forum_id, a.auth_setting + FROM (' . ACL_OPTIONS_TABLE . ' ao, ' . ACL_USERS_TABLE . ' a) + LEFT JOIN ' . ACL_ROLES_DATA_TABLE . ' r ON (a.auth_role_id = r.role_id) + WHERE (ao.auth_option_id = a.auth_option_id OR ao.auth_option_id = r.auth_option_id) ' . (($sql_user) ? 'AND a.' . $sql_user : '') . " $sql_forum $sql_opts - ORDER BY a.forum_id, ao.auth_option_id"; + ORDER BY a.forum_id, ao.auth_option"; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { - $hold_ary[$row['user_id']][$row['forum_id']][$row['auth_option']] = $row['auth_setting']; + $setting = ($row['auth_role_id']) ? $row['role_auth_setting'] : $row['auth_setting']; + $hold_ary[$row['user_id']][$row['forum_id']][$row['auth_option']] = $setting; } $db->sql_freeresult($result); // Now grab group settings ... ACL_NO overrides ACL_YES so act appropriatley - $sql = 'SELECT ug.user_id, ao.auth_option, a.forum_id, a.auth_setting - FROM ' . USER_GROUP_TABLE . ' ug, ' . ACL_OPTIONS_TABLE . ' ao, ' . ACL_GROUPS_TABLE . ' a - WHERE ao.auth_option_id = a.auth_option_id + $sql = 'SELECT ug.user_id, ao.auth_option, a.forum_id, a.auth_setting, a.auth_role_id, r.auth_setting as role_auth_setting + FROM (' . USER_GROUP_TABLE . ' ug, ' . ACL_OPTIONS_TABLE . ' ao, ' . ACL_GROUPS_TABLE . ' a) + LEFT JOIN ' . ACL_ROLES_DATA_TABLE . ' r ON (a.auth_role_id = r.role_id) + WHERE (ao.auth_option_id = a.auth_option_id OR ao.auth_option_id = r.auth_option_id) AND a.group_id = ug.group_id ' . (($sql_user) ? 'AND ug.' . $sql_user : '') . " $sql_forum $sql_opts - ORDER BY a.forum_id, ao.auth_option_id"; + ORDER BY a.forum_id, ao.auth_option"; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { if (!isset($hold_ary[$row['user_id']][$row['forum_id']][$row['auth_option']]) || (isset($hold_ary[$row['user_id']][$row['forum_id']][$row['auth_option']]) && $hold_ary[$row['user_id']][$row['forum_id']][$row['auth_option']] != ACL_NO)) { - $hold_ary[$row['user_id']][$row['forum_id']][$row['auth_option']] = $row['auth_setting']; + $setting = ($row['auth_role_id']) ? $row['role_auth_setting'] : $row['auth_setting']; + $hold_ary[$row['user_id']][$row['forum_id']][$row['auth_option']] = $setting; } } $db->sql_freeresult($result); @@ -519,20 +556,21 @@ class auth $hold_ary = array(); - // Grab user settings ... each user has only one setting for each - // option ... so we shouldn't need any ACL_NO checks ... he says ... - $sql = 'SELECT ao.auth_option, a.user_id, a.forum_id, a.auth_setting - FROM ' . ACL_OPTIONS_TABLE . ' ao, ' . ACL_USERS_TABLE . ' a - WHERE ao.auth_option_id = a.auth_option_id + // Grab user settings... + $sql = 'SELECT ao.auth_option, a.auth_role_id, r.auth_setting as role_auth_setting, a.user_id, a.forum_id, a.auth_setting + FROM (' . ACL_OPTIONS_TABLE . ' ao, ' . ACL_USERS_TABLE . ' a) + LEFT JOIN ' . ACL_ROLES_DATA_TABLE . ' r ON (a.auth_role_id = r.role_id) + WHERE (ao.auth_option_id = a.auth_option_id OR ao.auth_option_id = r.auth_option_id) ' . (($sql_user) ? 'AND a.' . $sql_user : '') . " $sql_forum $sql_opts - ORDER BY a.forum_id, ao.auth_option_id"; + ORDER BY a.forum_id, ao.auth_option"; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { - $hold_ary[$row['user_id']][$row['forum_id']][$row['auth_option']] = $row['auth_setting']; + $setting = ($row['auth_role_id']) ? $row['role_auth_setting'] : $row['auth_setting']; + $hold_ary[$row['user_id']][$row['forum_id']][$row['auth_option']] = $setting; } $db->sql_freeresult($result); @@ -564,18 +602,20 @@ class auth $hold_ary = array(); // Grab group settings... - $sql = 'SELECT a.group_id, ao.auth_option, a.forum_id, a.auth_setting - FROM ' . ACL_OPTIONS_TABLE . ' ao, ' . ACL_GROUPS_TABLE . ' a - WHERE ao.auth_option_id = a.auth_option_id + $sql = 'SELECT a.group_id, ao.auth_option, a.forum_id, a.auth_setting, a.auth_role_id, r.auth_setting as role_auth_setting + FROM (' . ACL_OPTIONS_TABLE . ' ao, ' . ACL_GROUPS_TABLE . ' a) + LEFT JOIN ' . ACL_ROLES_DATA_TABLE . ' r ON (a.auth_role_id = r.role_id) + WHERE (ao.auth_option_id = a.auth_option_id OR ao.auth_option_id = r.auth_option_id) ' . (($sql_group) ? 'AND a.' . $sql_group : '') . " $sql_forum $sql_opts - ORDER BY a.forum_id, ao.auth_option_id"; + ORDER BY a.forum_id, ao.auth_option"; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { - $hold_ary[$row['group_id']][$row['forum_id']][$row['auth_option']] = $row['auth_setting']; + $setting = ($row['auth_role_id']) ? $row['role_auth_setting'] : $row['auth_setting']; + $hold_ary[$row['group_id']][$row['forum_id']][$row['auth_option']] = $setting; } $db->sql_freeresult($result); diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index 3a25de7942..474ca978e9 100644 --- a/phpBB/includes/constants.php +++ b/phpBB/includes/constants.php @@ -117,8 +117,8 @@ define('FIELD_DATE', 6); // Table names define('ACL_GROUPS_TABLE', $table_prefix.'auth_groups'); define('ACL_OPTIONS_TABLE', $table_prefix.'auth_options'); -define('ACL_PRESETS_TABLE', $table_prefix.'auth_presets'); -define('ACL_PRESETS_DATA_TABLE', $table_prefix.'auth_preset_data'); +define('ACL_ROLES_TABLE', $table_prefix.'auth_roles'); +define('ACL_ROLES_DATA_TABLE', $table_prefix.'auth_roles_data'); define('ACL_USERS_TABLE', $table_prefix.'auth_users'); define('ATTACHMENTS_TABLE', $table_prefix.'attachments'); define('BANLIST_TABLE', $table_prefix.'banlist'); diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php index 6a573f42b4..737872dd8f 100644 --- a/phpBB/includes/db/dbal.php +++ b/phpBB/includes/db/dbal.php @@ -130,6 +130,7 @@ class dbal } else if (is_array($var) && is_string($var[0])) { + // This is used for INSERT_SELECT(s) $values[] = $var[0]; } else diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 807aeb6578..fb33b280d2 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2219,7 +2219,7 @@ function get_backtrace() case 'string': $argument = htmlspecialchars(substr($argument, 0, 64)) . ((strlen($argument) > 64) ? '...' : ''); - $args[] = '"' . $argument . '"'; + $args[] = "'{$argument}'"; break; case 'array': diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 4221ac0cdc..4ce8e4ddfa 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -1869,11 +1869,11 @@ function cache_moderators() */ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id = 0, $topic_id = 0, $user_id = 0, $limit_days = 0, $sort_by = 'l.log_time DESC') { - global $db, $user, $auth, $phpEx, $SID, $phpbb_root_path; + global $db, $user, $auth, $phpEx, $SID, $phpbb_root_path, $phpbb_admin_path; $topic_id_list = $is_auth = $is_mod = array(); - $profile_url = (defined('IN_ADMIN')) ? "{$phpbb_root_path}index.$phpEx$SID&i=users&mode=overview" : "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile"; + $profile_url = (defined('IN_ADMIN')) ? "{$phpbb_admin_path}index.$phpEx$SID&i=users&mode=overview" : "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile"; switch ($mode) { diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 40f17a33e9..3670d118c5 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -938,7 +938,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id $db->sql_freeresult($result); // forum notification is sent to those not receiving post notification - if ($topic_notification) + if ($forum_notification) { if (sizeof($notify_rows)) { @@ -1037,10 +1037,10 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id $messenger->assign_vars(array( 'EMAIL_SIG' => $email_sig, - 'SITENAME' => $config['sitename'], - 'USERNAME' => $addr['name'], - 'TOPIC_TITLE' => $topic_title, - 'FORUM_NAME' => $forum_name, + 'SITENAME' => html_entity_decode($config['sitename']), + 'USERNAME' => html_entity_decode($addr['name']), + 'TOPIC_TITLE' => html_entity_decode($topic_title), + 'FORUM_NAME' => html_entity_decode($forum_name), 'U_FORUM' => generate_board_url() . "/viewforum.$phpEx?f=$forum_id&e=0", 'U_TOPIC' => generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t=$topic_id&e=0", diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 0ed104d9f1..5f1fdff5e5 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -1172,7 +1172,7 @@ function avatar_gallery($category, $avatar_select, $items_per_column, $block_var * Add or edit a group. If we're editing a group we only update user * parameters such as rank, etc. if they are changed */ -function group_create($group_id, $type, $name, $desc, $group_attributes) +function group_create(&$group_id, $type, $name, $desc, $group_attributes) { global $phpbb_root_path, $config, $db, $user, $file_upload; @@ -1228,9 +1228,17 @@ function group_create($group_id, $type, $name, $desc, $group_attributes) } } + // Setting the log message before we set the group id (if group gets added) + $log = ($group_id) ? 'LOG_GROUP_UPDATED' : 'LOG_GROUP_CREATED'; + $sql = ($group_id) ? 'UPDATE ' . GROUPS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE group_id = $group_id" : 'INSERT INTO ' . GROUPS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); $db->sql_query($sql); + if (!$group_id) + { + $group_id = $db->sql_nextid(); + } + // Set user attributes $sql_ary = array(); if (sizeof($group_attributes)) @@ -1251,7 +1259,6 @@ function group_create($group_id, $type, $name, $desc, $group_attributes) $db->sql_query($sql); } - $log = ($group_id) ? 'LOG_GROUP_UPDATED' : 'LOG_GROUP_CREATED'; add_log('admin', $log, $name); } diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php index cbdf6d4f6a..a7422354b3 100644 --- a/phpBB/includes/mcp/mcp_post.php +++ b/phpBB/includes/mcp/mcp_post.php @@ -96,7 +96,7 @@ function mcp_post_details($id, $mode, $action) 'U_POST_ACTION' => "$url&i=$id&mode=post_details", // Use this for action parameters 'U_APPROVE_ACTION' => "{$phpbb_root_path}mcp.$phpEx$SID&i=queue&p=$post_id", - 'S_CAN_VIEWIP' => $auth->acl_get('m_ip', $post_info['forum_id']), + 'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']), 'S_CAN_CHGPOSTER' => $auth->acl_get('m_', $post_info['forum_id']), 'S_CAN_LOCK_POST' => $auth->acl_get('m_lock', $post_info['forum_id']), 'S_CAN_DELETE_POST' => $auth->acl_get('m_delete', $post_info['forum_id']), @@ -182,7 +182,7 @@ function mcp_post_details($id, $mode, $action) } // Get IP - if ($auth->acl_get('m_ip', $post_info['forum_id'])) + if ($auth->acl_get('m_info', $post_info['forum_id'])) { $rdns_ip_num = request_var('rdns', ''); diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index 0825bc1da5..aa649df8d4 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -104,7 +104,7 @@ class mcp_queue 'S_MCP_QUEUE' => true, 'S_APPROVE_ACTION' => "mcp.$phpEx$SID&i=queue&p=$post_id&f=$forum_id", - 'S_CAN_VIEWIP' => $auth->acl_get('m_ip', $post_info['forum_id']), + 'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']), 'S_POST_REPORTED' => $post_info['post_reported'], 'S_POST_UNAPPROVED' => !$post_info['post_approved'], 'S_POST_LOCKED' => $post_info['post_edit_locked'], diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index feeeafc4c0..292ab36d76 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -1063,6 +1063,10 @@ class parse_message extends bbcode_firstpass } else { + if (!function_exists('delete_attachments')) + { + include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx); + } delete_attachments('attach', array(intval($this->attachment_data[$index]['attach_id']))); } diff --git a/phpBB/includes/ucp/ucp_attachments.php b/phpBB/includes/ucp/ucp_attachments.php index 3266d47818..d06eb08709 100644 --- a/phpBB/includes/ucp/ucp_attachments.php +++ b/phpBB/includes/ucp/ucp_attachments.php @@ -38,7 +38,10 @@ class ucp_attachments if (confirm_box(true)) { - include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); + if (!function_exists('delete_attachments')) + { + include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx); + } delete_attachments('attach', $delete_ids); $refresh_url = "{$phpbb_root_path}ucp.$phpEx$SID&i=$id"; diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index 62dbf6a1a0..89abbf98bd 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -27,7 +27,7 @@ CREATE TABLE phpbb_auth_groups ( group_id INTEGER DEFAULT 0 NOT NULL, forum_id INTEGER DEFAULT 0 NOT NULL, auth_option_id INTEGER DEFAULT 0 NOT NULL, - auth_preset_id INTEGER DEFAULT 0 NOT NULL, + auth_role_id INTEGER DEFAULT 0 NOT NULL, auth_setting INTEGER DEFAULT 0 NOT NULL );; @@ -40,17 +40,17 @@ CREATE TABLE phpbb_auth_options ( founder_only INTEGER DEFAULT 0 NOT NULL );; -# phpbb_auth_presets -CREATE TABLE phpbb_auth_presets ( - preset_id INTEGER NOT NULL, - preset_name VARCHAR(50) NOT NULL, - preset_type VARCHAR(10) NOT NULL, - preset_group_id INTEGER DEFAULT 0 NOT NULL +# phpbb_auth_roles +CREATE TABLE phpbb_auth_roles ( + role_id INTEGER NOT NULL, + role_name VARCHAR(50) NOT NULL, + role_type VARCHAR(10) NOT NULL, + role_group_ids VARCHAR(255) NOT NULL );; -# phpbb_auth_preset_data -CREATE TABLE phpbb_auth_preset_data ( - preset_id INTEGER DEFAULT 0 NOT NULL, +# phpbb_auth_roles_data +CREATE TABLE phpbb_auth_roles_data ( + role_id INTEGER DEFAULT 0 NOT NULL, auth_option_id INTEGER DEFAULT 0 NOT NULL, auth_setting INTEGER DEFAULT 0 NOT NULL ); @@ -60,7 +60,7 @@ CREATE TABLE phpbb_auth_users ( user_id INTEGER DEFAULT 0 NOT NULL, forum_id INTEGER DEFAULT 0 NOT NULL, auth_option_id INTEGER DEFAULT 0 NOT NULL, - auth_preset_id INTEGER DEFAULT 0 NOT NULL, + auth_role_id INTEGER DEFAULT 0 NOT NULL, auth_setting INTEGER DEFAULT 0 NOT NULL );; @@ -878,19 +878,19 @@ ON phpbb_auth_options( auth_option );; -ALTER TABLE phpbb_auth_presets +ALTER TABLE phpbb_auth_roles ADD PRIMARY KEY ( - preset_id + role_id );; -CREATE INDEX preset_type10 -ON phpbb_auth_presets( - preset_type +CREATE INDEX role_type10 +ON phpbb_auth_roles( + role_type );; -ALTER TABLE phpbb_auth_preset_data +ALTER TABLE phpbb_auth_roles_data ADD PRIMARY KEY ( - preset_id, + role_id, auth_option_id );; @@ -1476,9 +1476,9 @@ CREATE GENERATOR b_auth_optionsauth_option_idGen;; SET GENERATOR b_auth_optionsauth_option_idGen TO 0;; -CREATE GENERATOR G_auth_presetspreset_idGen;; +CREATE GENERATOR G_auth_rolesrole_idGen;; -SET GENERATOR G_auth_presetspreset_idGen TO 0;; +SET GENERATOR G_auth_rolesrole_idGen TO 0;; CREATE GENERATOR G_phpbb_banlistban_idGen3;; @@ -1614,11 +1614,11 @@ BEGIN NEW.auth_option_id = GEN_ID(b_auth_optionsauth_option_idGen, 1); END;; -CREATE TRIGGER t_phpbb_auth_presetspreset_idGe FOR phpbb_auth_presets +CREATE TRIGGER t_phpbb_auth_rolesrole_idGe FOR phpbb_auth_roles BEFORE INSERT AS BEGIN - NEW.preset_id = GEN_ID(G_auth_presetspreset_idGen, 1); + NEW.role_id = GEN_ID(G_auth_rolesrole_idGen, 1); END;; CREATE TRIGGER GetNextG_phpbb_banlistban_idGen FOR phpbb_banlist diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index 492a54fba4..d67c2e3e8f 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -32,7 +32,7 @@ CREATE TABLE [phpbb_auth_groups] ( [group_id] [int] NOT NULL , [forum_id] [int] NOT NULL , [auth_option_id] [int] NOT NULL , - [auth_preset_id] [int] NOT NULL , + [auth_role_id] [int] NOT NULL , [auth_setting] [int] NOT NULL ) ON [PRIMARY] GO @@ -46,16 +46,16 @@ CREATE TABLE [phpbb_auth_options] ( ) ON [PRIMARY] GO -CREATE TABLE [phpbb_auth_presets] ( - [preset_id] [int] IDENTITY (1, 1) NOT NULL , - [preset_name] [varchar] (50) NOT NULL , - [preset_type] [varchar] (10) NOT NULL , - [preset_group_id] [int] NOT NULL +CREATE TABLE [phpbb_auth_roles] ( + [role_id] [int] IDENTITY (1, 1) NOT NULL , + [role_name] [varchar] (50) NOT NULL , + [role_type] [varchar] (10) NOT NULL , + [role_group_ids] [varchar] (255) NOT NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO -CREATE TABLE [phpbb_auth_preset_data] ( - [preset_id] [int] NOT NULL , +CREATE TABLE [phpbb_auth_roles_data] ( + [role_id] [int] NOT NULL , [auth_option_id] [int] NOT NULL , [auth_setting] [int] NOT NULL ) ON [PRIMARY] @@ -65,7 +65,7 @@ CREATE TABLE [phpbb_auth_users] ( [user_id] [int] NOT NULL , [forum_id] [int] NOT NULL , [auth_option_id] [int] NOT NULL , - [auth_preset_id] [int] NOT NULL , + [auth_role_id] [int] NOT NULL , [auth_setting] [int] NOT NULL ) ON [PRIMARY] GO @@ -846,17 +846,17 @@ ALTER TABLE [phpbb_auth_options] WITH NOCHECK ADD ) ON [PRIMARY] GO -ALTER TABLE [phpbb_auth_presets] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_auth_presets] PRIMARY KEY CLUSTERED +ALTER TABLE [phpbb_auth_roles] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_auth_roles] PRIMARY KEY CLUSTERED ( - [preset_id] + [role_id] ) ON [PRIMARY] GO -ALTER TABLE [phpbb_auth_preset_data] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_auth_preset_data] PRIMARY KEY CLUSTERED +ALTER TABLE [phpbb_auth_roles_data] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_auth_roles_data] PRIMARY KEY CLUSTERED ( - [preset_id], + [role_id], [auth_option_id] ) ON [PRIMARY] GO @@ -1203,12 +1203,12 @@ ALTER TABLE [phpbb_auth_options] WITH NOCHECK ADD CONSTRAINT [DF_auth_o_founder_only] DEFAULT (0) FOR [founder_only] GO -ALTER TABLE [phpbb_auth_presets] WITH NOCHECK ADD - CONSTRAINT [DF_auth_p_preset_group_id] DEFAULT (0) FOR [preset_group_id] +ALTER TABLE [phpbb_auth_roles] WITH NOCHECK ADD + CONSTRAINT [DF_auth_p_role_group_ids] DEFAULT ('') FOR [role_group_ids] GO -ALTER TABLE [phpbb_auth_preset_data] WITH NOCHECK ADD - CONSTRAINT [DF_auth_d_preset_id] DEFAULT (0) FOR [preset_id], +ALTER TABLE [phpbb_auth_roles_data] WITH NOCHECK ADD + CONSTRAINT [DF_auth_d_role_id] DEFAULT (0) FOR [role_id], CONSTRAINT [DF_auth_d_auth_option_id] DEFAULT (0) FOR [auth_option_id], CONSTRAINT [DF_auth_d_auth_setting] DEFAULT (0) FOR [auth_setting] GO @@ -1677,7 +1677,7 @@ GO CREATE INDEX [auth_option] ON [phpbb_auth_options]([auth_option]) ON [PRIMARY] GO -CREATE INDEX [preset_type] ON [phpbb_auth_presets]([preset_type]) ON [PRIMARY] +CREATE INDEX [role_type] ON [phpbb_auth_roles]([role_type]) ON [PRIMARY] GO CREATE INDEX [user_id] ON [phpbb_auth_users]([user_id]) ON [PRIMARY] diff --git a/phpBB/install/schemas/mysql_schema.sql b/phpBB/install/schemas/mysql_schema.sql index 51169b2bad..31c221f624 100644 --- a/phpBB/install/schemas/mysql_schema.sql +++ b/phpBB/install/schemas/mysql_schema.sql @@ -34,7 +34,7 @@ CREATE TABLE phpbb_auth_groups ( group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, auth_option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - auth_preset_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + auth_role_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, auth_setting tinyint(2) DEFAULT '0' NOT NULL, KEY group_id (group_id), KEY auth_option_id (auth_option_id) @@ -51,22 +51,22 @@ CREATE TABLE phpbb_auth_options ( KEY auth_option (auth_option) ); -# Table: phpbb_auth_presets -CREATE TABLE phpbb_auth_presets ( - preset_id mediumint(8) UNSIGNED NOT NULL auto_increment, - preset_name varchar(50) DEFAULT '' NOT NULL, - preset_type varchar(10) DEFAULT '' NOT NULL, - preset_group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - PRIMARY KEY (preset_id), - KEY preset_type (preset_type) +# Table: phpbb_auth_roles +CREATE TABLE phpbb_auth_roles ( + role_id mediumint(8) UNSIGNED NOT NULL auto_increment, + role_name varchar(50) DEFAULT '' NOT NULL, + role_type varchar(10) DEFAULT '' NOT NULL, + role_group_ids varchar(255) UNSIGNED DEFAULT '' NOT NULL, + PRIMARY KEY (role_id), + KEY role_type (role_type) ); -# Table: phpbb_auth_preset_data -CREATE TABLE phpbb_auth_preset_data ( - preset_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, +# Table: phpbb_auth_roles_data +CREATE TABLE phpbb_auth_roles_data ( + role_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, auth_option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, auth_setting tinyint(2) DEFAULT '0' NOT NULL, - PRIMARY KEY (preset_id, auth_option_id) + PRIMARY KEY (role_id, auth_option_id) ); # Table: phpbb_auth_users @@ -74,7 +74,7 @@ CREATE TABLE phpbb_auth_users ( user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, auth_option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - auth_preset_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + auth_role_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, auth_setting tinyint(2) DEFAULT '0' NOT NULL, KEY user_id (user_id), KEY auth_option_id (auth_option_id) diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index 5760ffabbc..b4bf0afb05 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -96,7 +96,7 @@ CREATE TABLE phpbb_auth_groups ( group_id number(8) DEFAULT '0' NOT NULL, forum_id number(8) DEFAULT '0' NOT NULL, auth_option_id number(8) DEFAULT '0' NOT NULL, - auth_preset_id number(8) DEFAULT '0' NOT NULL, + auth_role_id number(8) DEFAULT '0' NOT NULL, auth_setting number(4) DEFAULT '0' NOT NULL ) / @@ -138,43 +138,43 @@ CREATE INDEX auth_option on phpbb_auth_options (auth_option) / /* - Table: phpbb_auth_presets + Table: phpbb_auth_roles */ -CREATE TABLE phpbb_auth_presets ( - preset_id number(8) NOT NULL, - preset_name varchar2(50) DEFAULT '', - preset_type varchar2(10) DEFAULT '', - preset_group_id number(8) DEFAULT '0' NOT NULL, - CONSTRAINT pk_phpbb_auth_presets PRIMARY KEY (preset_id) +CREATE TABLE phpbb_auth_roles ( + role_id number(8) NOT NULL, + role_name varchar2(50) DEFAULT '', + role_type varchar2(10) DEFAULT '', + role_group_ids varchar2(255) DEFAULT '' NOT NULL, + CONSTRAINT pk_phpbb_auth_roles PRIMARY KEY (role_id) ) / -CREATE SEQUENCE sq_phpbb_auth_presets_preset_i +CREATE SEQUENCE sq_phpbb_auth_roles_role_i / -CREATE OR REPLACE TRIGGER ai_phpbb_auth_presets_preset_i -BEFORE INSERT ON phpbb_auth_presets +CREATE OR REPLACE TRIGGER ai_phpbb_auth_roles_role_i +BEFORE INSERT ON phpbb_auth_roles FOR EACH ROW WHEN ( - new.preset_id IS NULL OR new.preset_id = 0 + new.role_id IS NULL OR new.role_id = 0 ) BEGIN - SELECT sq_phpbb_auth_presets_preset_i.nextval - INTO :new.preset_id + SELECT sq_phpbb_auth_roles_role_i.nextval + INTO :new.role_id FROM dual; END; / -CREATE INDEX preset_type on phpbb_auth_presets (preset_type) +CREATE INDEX role_type on phpbb_auth_roles (role_type) / /* - Table: phpbb_auth_preset_data + Table: phpbb_auth_roles_data */ -CREATE TABLE phpbb_auth_preset_data ( - preset_id number(8) DEFAULT '0' NOT NULL, +CREATE TABLE phpbb_auth_roles_data ( + role_id number(8) DEFAULT '0' NOT NULL, auth_option_id number(8) DEFAULT '0' NOT NULL, auth_setting number(4) DEFAULT '0' NOT NULL, - CONSTRAINT pk_phpbb_confirm PRIMARY KEY (preset_id, auth_option_id) + CONSTRAINT pk_phpbb_confirm PRIMARY KEY (role_id, auth_option_id) ) / @@ -185,7 +185,7 @@ CREATE TABLE phpbb_auth_users ( user_id number(8) DEFAULT '0' NOT NULL, forum_id number(8) DEFAULT '0' NOT NULL, auth_option_id number(8) DEFAULT '0' NOT NULL, - auth_preset_id number(8) DEFAULT '0' NOT NULL, + auth_role_id number(8) DEFAULT '0' NOT NULL, auth_setting number(4) DEFAULT '0' NOT NULL ) / diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index 68f44dd35f..640bde0d52 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -49,7 +49,7 @@ CREATE TABLE phpbb_auth_groups ( group_id INT4 DEFAULT '0' NOT NULL, forum_id INT4 DEFAULT '0' NOT NULL, auth_option_id INT4 DEFAULT '0' NOT NULL, - auth_preset_id INT4 DEFAULT '0' NOT NULL, + auth_role_id INT4 DEFAULT '0' NOT NULL, auth_setting INT2 DEFAULT '0' NOT NULL ); @@ -72,27 +72,27 @@ CREATE INDEX auth_option_phpbb_auth_options_index ON phpbb_auth_options (auth_op SELECT SETVAL('phpbb_auth_options_auth_opti',(select case when max(auth_option_id)>0 then max(auth_option_id)+1 else 1 end from phpbb_auth_options)); -/* Table: phpbb_auth_presets */ -CREATE SEQUENCE phpbb_auth_presets_preset_id; +/* Table: phpbb_auth_roles */ +CREATE SEQUENCE phpbb_auth_roles_role_id; -CREATE TABLE phpbb_auth_presets ( - preset_id INT4 DEFAULT nextval('phpbb_auth_presets_preset_id'), - preset_name varchar(50) DEFAULT '' NOT NULL, - preset_type varchar(10) DEFAULT '' NOT NULL, - preset_group_id INT4 DEFAULT '0' NOT NULL, - PRIMARY KEY (preset_id) +CREATE TABLE phpbb_auth_roles ( + role_id INT4 DEFAULT nextval('phpbb_auth_roles_role_id'), + role_name varchar(50) DEFAULT '' NOT NULL, + role_type varchar(10) DEFAULT '' NOT NULL, + role_group_ids varchar(255) DEFAULT '' NOT NULL, + PRIMARY KEY (role_id) ); -CREATE INDEX preset_type_phpbb_auth_presets_index ON phpbb_auth_presets (preset_type); +CREATE INDEX role_type_phpbb_auth_roles_index ON phpbb_auth_roles (role_type); -SELECT SETVAL('phpbb_auth_presets_preset_id',(select case when max(preset_id)>0 then max(preset_id)+1 else 1 end from phpbb_auth_presets)); +SELECT SETVAL('phpbb_auth_roles_role_id',(select case when max(role_id)>0 then max(role_id)+1 else 1 end from phpbb_auth_roles)); -/* Table: phpbb_auth_preset_data */ -CREATE TABLE phpbb_auth_preset_data ( - preset_id INT4 DEFAULT '0' NOT NULL, +/* Table: phpbb_auth_roles_data */ +CREATE TABLE phpbb_auth_roles_data ( + role_id INT4 DEFAULT '0' NOT NULL, auth_option_id INT4 DEFAULT '0' NOT NULL, auth_setting INT2 DEFAULT '0' NOT NULL, - PRIMARY KEY (preset_id, auth_option_id) + PRIMARY KEY (role_id, auth_option_id) ); /* Table: phpbb_auth_users */ @@ -100,7 +100,7 @@ CREATE TABLE phpbb_auth_users ( user_id INT4 DEFAULT '0' NOT NULL, forum_id INT4 DEFAULT '0' NOT NULL, auth_option_id INT4 DEFAULT '0' NOT NULL, - auth_preset_id INT4 DEFAULT '0' NOT NULL, + auth_role_id INT4 DEFAULT '0' NOT NULL, auth_setting INT2 DEFAULT '0' NOT NULL ); diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index d6baabef71..a8b06d690b 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -239,17 +239,16 @@ INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_report', 1); INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_subscribe', 1); INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_', 1, 1); -INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_edit', 1, 1); -INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_delete', 1, 1); -INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_move', 1, 1); -INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_lock', 1, 1); -INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_split', 1, 1); -INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_merge', 1, 1); INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_approve', 1, 1); -INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_unrate', 1, 1); -INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_auth', 1, 1); -INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_ip', 1, 1); +INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_chgposter', 1, 1); +INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_delete', 1, 1); +INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_edit', 1, 1); INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_info', 1, 1); +INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_lock', 1, 1); +INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_merge', 1, 1); +INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_move', 1, 1); +INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_split', 1, 1); +INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_warn', 1, 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_aauth', 1); @@ -281,6 +280,7 @@ INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_phpinfo', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_profile', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_prune', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_ranks', 1); +INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_roles', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_server', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_styles', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_uauth', 1); @@ -471,104 +471,119 @@ INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (90, 1, 'pm', 'ucp', 0, 27, 98, 99, 'UCP_PM_POPUP_TITLE', 'popup', 'cfg_allow_privmsg'); # ACP -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (2, 1, '', 'acp', 1, 0, 197, 232, 'ACP_CAT_GENERAL', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (7, 1, 'modules', 'acp', 1, 67, 383, 384, 'ACP', 'acp', 'acl_a_modules'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (11, 1, '', 'acp', 1, 0, 267, 310, 'ACP_CAT_USERGROUP', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (41, 1, 'main', 'acp', 1, 2, 198, 199, 'ACP_MAIN', 'main', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (42, 1, '', 'acp', 1, 2, 200, 211, 'ACP_GENERAL_CONFIGURATION', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (43, 1, '', 'acp', 1, 2, 212, 219, 'ACP_CLIENT_COMMUNICATION', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (44, 1, '', 'acp', 1, 2, 220, 231, 'ACP_SERVER_CONFIGURATION', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (46, 1, '', 'acp', 1, 0, 233, 242, 'ACP_CAT_FORUMS', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (47, 1, '', 'acp', 1, 0, 243, 266, 'ACP_CAT_POSTING', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (48, 1, '', 'acp', 1, 0, 311, 344, 'ACP_CAT_PERMISSIONS', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (49, 1, '', 'acp', 1, 0, 345, 358, 'ACP_CAT_STYLES', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (50, 1, '', 'acp', 1, 0, 359, 370, 'ACP_CAT_MAINTANENCE', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (51, 1, '', 'acp', 1, 0, 371, 390, 'ACP_CAT_SYSTEM', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (52, 1, '', 'acp', 1, 0, 391, 392, 'ACP_CAT_DOT_MODS', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (53, 1, '', 'acp', 1, 46, 234, 239, 'ACP_CAT_FORUMS', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (54, 1, '', 'acp', 1, 46, 240, 241, 'ACP_CAT_PERMISSIONS', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (56, 1, '', 'acp', 1, 47, 256, 265, 'ACP_ATTACHMENTS', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (57, 1, '', 'acp', 1, 11, 268, 293, 'ACP_CAT_USERS', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (58, 1, '', 'acp', 1, 11, 294, 297, 'ACP_GROUPS', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (59, 1, '', 'acp', 1, 11, 298, 309, 'ACP_USER_SECURITY', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (61, 1, '', 'acp', 1, 48, 312, 329, 'ACP_PERMISSION_SETTINGS', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (62, 1, '', 'acp', 1, 49, 346, 349, 'ACP_STYLE_MANAGEMENT', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (63, 1, '', 'acp', 1, 50, 360, 367, 'ACP_FORUM_LOGS', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (64, 1, '', 'acp', 1, 50, 368, 369, 'ACP_CAT_DATABASE', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (65, 1, '', 'acp', 1, 51, 372, 373, 'ACP_AUTOMATION', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (66, 1, '', 'acp', 1, 51, 374, 381, 'ACP_GENERAL_TASKS', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (67, 1, '', 'acp', 1, 51, 382, 389, 'ACP_MODULE_MANAGEMENT', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (69, 1, 'modules', 'acp', 1, 67, 385, 386, 'UCP', 'ucp', 'acl_a_modules'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (71, 1, 'board', 'acp', 1, 42, 201, 202, 'ACP_BOARD_SETTINGS', 'settings', 'acl_a_board'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (72, 1, 'board', 'acp', 1, 42, 203, 204, 'ACP_BOARD_DEFAULTS', 'default', 'acl_a_defaults'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (73, 1, 'board', 'acp', 1, 42, 205, 206, 'ACP_AVATAR_SETTINGS', 'avatar', 'acl_a_board'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (74, 1, 'attachments', 'acp', 1, 42, 207, 208, 'ACP_ATTACHMENT_SETTINGS', 'attach', 'acl_a_attach'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (75, 1, '', 'acp', 1, 47, 244, 255, 'ACP_MESSAGES', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (76, 1, 'attachments', 'acp', 1, 56, 257, 258, 'ACP_ATTACHMENT_SETTINGS', 'attach', 'acl_a_attach'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (77, 1, 'attachments', 'acp', 1, 56, 259, 260, 'ACP_EXTENSION_GROUPS', 'ext_groups', 'acl_a_attach'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (78, 1, 'attachments', 'acp', 1, 56, 261, 262, 'ACP_MANAGE_EXTENSIONS', 'extensions', 'acl_a_attach'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (80, 1, 'attachments', 'acp', 1, 56, 263, 264, 'ACP_ORPHAN_ATTACHMENTS', 'orphan', 'acl_a_attach'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (81, 1, 'board', 'acp', 1, 42, 209, 210, 'ACP_MESSAGE_SETTINGS', 'message', 'acl_a_defaults'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (82, 1, 'board', 'acp', 1, 43, 213, 214, 'ACP_AUTH_SETTINGS', 'auth', 'acl_a_server'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (83, 1, 'board', 'acp', 1, 43, 215, 216, 'ACP_EMAIL_SETTINGS', 'email', 'acl_a_server'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (84, 1, 'jabber', 'acp', 1, 43, 217, 218, 'ACP_JABBER_SETTINGS', 'settings', 'acl_a_jabber'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (85, 1, 'board', 'acp', 1, 44, 221, 222, 'ACP_COOKIE_SETTINGS', 'cookie', 'acl_a_cookies'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (86, 1, 'board', 'acp', 1, 44, 223, 224, 'ACP_SERVER_SETTINGS', 'server', 'acl_a_server'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (87, 1, 'board', 'acp', 1, 44, 225, 226, 'ACP_LOAD_SETTINGS', 'load', 'acl_a_server'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (89, 1, 'php_info', 'acp', 1, 44, 227, 228, 'ACP_PHP_INFO', 'info', 'acl_a_phpinfo'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (91, 1, 'bots', 'acp', 1, 44, 229, 230, 'ACP_BOTS', 'bots', 'acl_a_bots'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (92, 1, 'modules', 'acp', 1, 67, 387, 388, 'MCP', 'mcp', 'acl_a_modules'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (93, 1, 'board', 'acp', 1, 75, 245, 246, 'ACP_MESSAGE_SETTINGS', 'message', 'acl_a_defaults'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (94, 1, 'bbcodes', 'acp', 1, 75, 247, 248, 'ACP_BBCODES', 'bbcodes', 'acl_a_bbcode'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (95, 1, 'icons', 'acp', 1, 75, 249, 250, 'ACP_ICONS', 'icons', 'acl_a_icons'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (96, 1, 'icons', 'acp', 1, 75, 251, 252, 'ACP_SMILIES', 'smilies', 'acl_a_icons'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (97, 1, 'words', 'acp', 1, 75, 253, 254, 'ACP_WORDS', 'words', 'acl_a_words'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (98, 1, 'logs', 'acp', 1, 63, 361, 362, 'ACP_ADMIN_LOGS', 'admin', 'acl_a_viewlogs'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (99, 1, 'logs', 'acp', 1, 63, 363, 364, 'ACP_MOD_LOGS', 'mod', 'acl_a_viewlogs'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (100, 1, 'logs', 'acp', 1, 63, 365, 366, 'ACP_CRITICAL_LOGS', 'critical', 'acl_a_viewlogs'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (101, 1, 'language', 'acp', 1, 66, 375, 376, 'ACP_LANGUAGE_PACKS', 'lang_packs', 'acl_a_language'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (102, 1, 'bots', 'acp', 1, 66, 377, 378, 'ACP_BOTS', 'bots', 'acl_a_bots'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (103, 1, 'groups', 'acp', 1, 58, 295, 296, 'ACP_GROUPS_MANAGE', 'manage', 'acl_a_group'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (105, 1, 'email', 'acp', 1, 66, 379, 380, 'ACP_MASS_EMAIL', 'email', 'acl_a_email'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (106, 1, 'ranks', 'acp', 1, 57, 273, 274, 'ACP_MANAGE_RANKS', 'ranks', 'acl_a_ranks'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (107, 1, 'ban', 'acp', 1, 59, 303, 304, 'ACP_BAN_EMAILS', 'email', 'acl_a_ban'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (108, 1, 'ban', 'acp', 1, 59, 305, 306, 'ACP_BAN_IPS', 'ip', 'acl_a_ban'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (109, 1, 'ban', 'acp', 1, 59, 307, 308, 'ACP_BAN_USERNAMES', 'user', 'acl_a_ban'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (110, 1, 'disallow', 'acp', 1, 59, 301, 302, 'ACP_DISALLOW_USERNAMES', 'usernames', 'acl_a_names'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (111, 1, 'prune', 'acp', 1, 59, 299, 300, 'ACP_PRUNE_USERS', 'users', 'acl_a_userdel'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (112, 1, 'prune', 'acp', 1, 53, 237, 238, 'ACP_PRUNE_FORUMS', 'forums', 'acl_a_prune'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (113, 1, 'profile', 'acp', 1, 57, 271, 272, 'ACP_CUSTOM_PROFILE_FIELDS', 'profile', 'acl_a_profile'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (114, 1, 'forums', 'acp', 1, 53, 235, 236, 'ACP_MANAGE_FORUMS', 'manage', 'acl_a_forum'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (115, 1, 'users', 'acp', 1, 57, 269, 270, 'ACP_MANAGE_USERS', 'overview', 'acl_a_user'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (116, 1, 'users', 'acp', 0, 57, 275, 276, 'ACP_USER_FEEDBACK', 'feedback', 'acl_a_user'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (117, 1, 'users', 'acp', 0, 57, 277, 278, 'ACP_USER_PROFILE', 'profile', 'acl_a_user'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (118, 1, 'users', 'acp', 0, 57, 279, 280, 'ACP_USER_PREFS', 'prefs', 'acl_a_user'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (119, 1, 'users', 'acp', 0, 57, 281, 282, 'ACP_USER_AVATAR', 'avatar', 'acl_a_user'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (120, 1, 'users', 'acp', 0, 57, 285, 286, 'ACP_USER_SIG', 'sig', 'acl_a_user'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (121, 1, 'users', 'acp', 0, 57, 287, 288, 'ACP_USER_GROUPS', 'groups', 'acl_a_user && acl_a_group'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (122, 1, 'users', 'acp', 0, 57, 289, 290, 'ACP_USER_PERM', 'perm', 'acl_a_user && acl_a_viewauth'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (123, 1, 'users', 'acp', 0, 57, 291, 292, 'ACP_USER_ATTACH', 'attach', 'acl_a_user'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (141, 1, '', 'acp', 1, 49, 350, 357, 'ACP_STYLE_COMPONENTS', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (142, 1, 'styles', 'acp', 1, 62, 347, 348, 'ACP_STYLES', 'style', 'acl_a_styles'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (143, 1, 'styles', 'acp', 1, 141, 351, 352, 'ACP_TEMPLATES', 'template', 'acl_a_styles'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (144, 1, 'styles', 'acp', 1, 141, 353, 354, 'ACP_THEMES', 'theme', 'acl_a_styles'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (145, 1, 'styles', 'acp', 1, 141, 355, 356, 'ACP_IMAGESETS', 'imageset', 'acl_a_styles'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (147, 1, 'users', 'acp', 0, 57, 283, 284, 'ACP_USER_RANK', 'rank', 'acl_a_user'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (148, 1, 'permissions', 'acp', 1, 61, 313, 314, 'ACP_USERS_PERMISSIONS', 'setting_user_global', 'acl_a_authusers && (acl_a_aauth || acl_a_mauth || acl_a_uauth)'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (149, 1, 'permissions', 'acp', 1, 61, 315, 316, 'ACP_USERS_FORUM_PERMISSIONS', 'setting_user_local', 'acl_a_authusers && (acl_a_mauth || acl_a_fauth)'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (150, 1, 'permissions', 'acp', 1, 61, 317, 318, 'ACP_GROUPS_PERMISSIONS', 'setting_group_global', 'acl_a_authgroups && (acl_a_aauth || acl_a_mauth || acl_a_uauth)'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (151, 1, 'permissions', 'acp', 1, 61, 319, 320, 'ACP_GROUPS_FORUM_PERMISSIONS', 'setting_group_local', 'acl_a_authgroups && (acl_a_mauth || acl_a_fauth)'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (152, 1, 'permissions', 'acp', 1, 61, 321, 322, 'ACP_ADMINISTRATORS', 'setting_admin_global', 'acl_a_aauth && (acl_a_authusers || acl_a_authgroups)'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (155, 1, 'permissions', 'acp', 1, 61, 323, 324, 'ACP_GLOBAL_MODERATORS', 'setting_mod_global', 'acl_a_mauth && (acl_a_authusers || acl_a_authgroups)'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (156, 1, 'permissions', 'acp', 1, 61, 325, 326, 'ACP_FORUM_MODERATORS', 'setting_mod_local', 'acl_a_mauth && (acl_a_authusers || acl_a_authgroups)'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (157, 1, 'permissions', 'acp', 1, 61, 327, 328, 'ACP_FORUM_PERMISSIONS', 'setting_forum_local', 'acl_a_fauth && (acl_a_authusers || acl_a_authgroups)'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (158, 1, '', 'acp', 1, 48, 330, 341, 'ACP_PERMISSION_MASKS', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (159, 1, 'permissions', 'acp', 1, 158, 331, 332, 'ACP_VIEW_ADMIN_PERMISSIONS', 'view_admin_global', 'acl_a_viewauth'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (160, 1, 'permissions', 'acp', 1, 158, 333, 334, 'ACP_VIEW_USER_PERMISSIONS', 'view_user_global', 'acl_a_viewauth'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (161, 1, 'permissions', 'acp', 1, 158, 335, 336, 'ACP_VIEW_GLOBAL_MOD_PERMISSIONS', 'view_mod_global', 'acl_a_viewauth'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (162, 1, 'permissions', 'acp', 1, 158, 337, 338, 'ACP_VIEW_FORUM_MOD_PERMISSIONS', 'view_mod_local', 'acl_a_viewauth'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (163, 1, 'permissions', 'acp', 1, 158, 339, 340, 'ACP_VIEW_FORUM_PERMISSIONS', 'view_forum_local', 'acl_a_viewauth'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (165, 1, '', 'acp', 1, 48, 342, 343, 'Permission Presets', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (2, 1, '', 'acp', 1, 0, 227, 262, 'ACP_CAT_GENERAL', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (7, 1, 'modules', 'acp', 1, 67, 443, 444, 'ACP', 'acp', 'acl_a_modules'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (11, 1, '', 'acp', 1, 0, 305, 356, 'ACP_CAT_USERGROUP', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (41, 1, 'main', 'acp', 1, 2, 228, 229, 'ACP_MAIN', 'main', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (42, 1, '', 'acp', 1, 2, 230, 241, 'ACP_GENERAL_CONFIGURATION', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (43, 1, '', 'acp', 1, 2, 242, 249, 'ACP_CLIENT_COMMUNICATION', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (44, 1, '', 'acp', 1, 2, 250, 261, 'ACP_SERVER_CONFIGURATION', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (46, 1, '', 'acp', 1, 0, 263, 280, 'ACP_CAT_FORUMS', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (47, 1, '', 'acp', 1, 0, 281, 304, 'ACP_CAT_POSTING', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (48, 1, '', 'acp', 1, 0, 357, 404, 'ACP_CAT_PERMISSIONS', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (49, 1, '', 'acp', 1, 0, 405, 418, 'ACP_CAT_STYLES', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (50, 1, '', 'acp', 1, 0, 419, 430, 'ACP_CAT_MAINTANENCE', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (51, 1, '', 'acp', 1, 0, 431, 450, 'ACP_CAT_SYSTEM', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (52, 1, '', 'acp', 1, 0, 451, 452, 'ACP_CAT_DOT_MODS', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (53, 1, '', 'acp', 1, 46, 264, 269, 'ACP_CAT_FORUMS', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (54, 1, '', 'acp', 1, 46, 270, 279, 'ACP_FORUM_BASED_PERMISSIONS', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (56, 1, '', 'acp', 1, 47, 294, 303, 'ACP_ATTACHMENTS', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (57, 1, '', 'acp', 1, 11, 306, 335, 'ACP_CAT_USERS', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (58, 1, '', 'acp', 1, 11, 336, 343, 'ACP_GROUPS', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (59, 1, '', 'acp', 1, 11, 344, 355, 'ACP_USER_SECURITY', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (61, 1, '', 'acp', 1, 48, 360, 365, 'ACP_BASIC_PERMISSIONS', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (62, 1, '', 'acp', 1, 49, 406, 409, 'ACP_STYLE_MANAGEMENT', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (63, 1, '', 'acp', 1, 50, 420, 427, 'ACP_FORUM_LOGS', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (64, 1, '', 'acp', 1, 50, 428, 429, 'ACP_CAT_DATABASE', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (65, 1, '', 'acp', 1, 51, 432, 433, 'ACP_AUTOMATION', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (66, 1, '', 'acp', 1, 51, 434, 441, 'ACP_GENERAL_TASKS', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (67, 1, '', 'acp', 1, 51, 442, 449, 'ACP_MODULE_MANAGEMENT', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (69, 1, 'modules', 'acp', 1, 67, 445, 446, 'UCP', 'ucp', 'acl_a_modules'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (71, 1, 'board', 'acp', 1, 42, 231, 232, 'ACP_BOARD_SETTINGS', 'settings', 'acl_a_board'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (72, 1, 'board', 'acp', 1, 42, 233, 234, 'ACP_BOARD_DEFAULTS', 'default', 'acl_a_defaults'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (73, 1, 'board', 'acp', 1, 42, 235, 236, 'ACP_AVATAR_SETTINGS', 'avatar', 'acl_a_board'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (74, 1, 'attachments', 'acp', 1, 42, 237, 238, 'ACP_ATTACHMENT_SETTINGS', 'attach', 'acl_a_attach'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (75, 1, '', 'acp', 1, 47, 282, 293, 'ACP_MESSAGES', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (76, 1, 'attachments', 'acp', 1, 56, 295, 296, 'ACP_ATTACHMENT_SETTINGS', 'attach', 'acl_a_attach'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (77, 1, 'attachments', 'acp', 1, 56, 297, 298, 'ACP_EXTENSION_GROUPS', 'ext_groups', 'acl_a_attach'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (78, 1, 'attachments', 'acp', 1, 56, 299, 300, 'ACP_MANAGE_EXTENSIONS', 'extensions', 'acl_a_attach'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (80, 1, 'attachments', 'acp', 1, 56, 301, 302, 'ACP_ORPHAN_ATTACHMENTS', 'orphan', 'acl_a_attach'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (81, 1, 'board', 'acp', 1, 42, 239, 240, 'ACP_MESSAGE_SETTINGS', 'message', 'acl_a_defaults'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (82, 1, 'board', 'acp', 1, 43, 243, 244, 'ACP_AUTH_SETTINGS', 'auth', 'acl_a_server'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (83, 1, 'board', 'acp', 1, 43, 245, 246, 'ACP_EMAIL_SETTINGS', 'email', 'acl_a_server'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (84, 1, 'jabber', 'acp', 1, 43, 247, 248, 'ACP_JABBER_SETTINGS', 'settings', 'acl_a_jabber'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (85, 1, 'board', 'acp', 1, 44, 251, 252, 'ACP_COOKIE_SETTINGS', 'cookie', 'acl_a_cookies'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (86, 1, 'board', 'acp', 1, 44, 253, 254, 'ACP_SERVER_SETTINGS', 'server', 'acl_a_server'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (87, 1, 'board', 'acp', 1, 44, 255, 256, 'ACP_LOAD_SETTINGS', 'load', 'acl_a_server'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (89, 1, 'php_info', 'acp', 1, 44, 257, 258, 'ACP_PHP_INFO', 'info', 'acl_a_phpinfo'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (91, 1, 'bots', 'acp', 1, 44, 259, 260, 'ACP_BOTS', 'bots', 'acl_a_bots'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (92, 1, 'modules', 'acp', 1, 67, 447, 448, 'MCP', 'mcp', 'acl_a_modules'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (93, 1, 'board', 'acp', 1, 75, 283, 284, 'ACP_MESSAGE_SETTINGS', 'message', 'acl_a_defaults'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (94, 1, 'bbcodes', 'acp', 1, 75, 285, 286, 'ACP_BBCODES', 'bbcodes', 'acl_a_bbcode'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (95, 1, 'icons', 'acp', 1, 75, 287, 288, 'ACP_ICONS', 'icons', 'acl_a_icons'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (96, 1, 'icons', 'acp', 1, 75, 289, 290, 'ACP_SMILIES', 'smilies', 'acl_a_icons'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (97, 1, 'words', 'acp', 1, 75, 291, 292, 'ACP_WORDS', 'words', 'acl_a_words'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (98, 1, 'logs', 'acp', 1, 63, 421, 422, 'ACP_ADMIN_LOGS', 'admin', 'acl_a_viewlogs'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (99, 1, 'logs', 'acp', 1, 63, 423, 424, 'ACP_MOD_LOGS', 'mod', 'acl_a_viewlogs'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (100, 1, 'logs', 'acp', 1, 63, 425, 426, 'ACP_CRITICAL_LOGS', 'critical', 'acl_a_viewlogs'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (101, 1, 'language', 'acp', 1, 66, 435, 436, 'ACP_LANGUAGE_PACKS', 'lang_packs', 'acl_a_language'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (102, 1, 'bots', 'acp', 1, 66, 437, 438, 'ACP_BOTS', 'bots', 'acl_a_bots'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (103, 1, 'groups', 'acp', 1, 58, 337, 338, 'ACP_GROUPS_MANAGE', 'manage', 'acl_a_group'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (105, 1, 'email', 'acp', 1, 66, 439, 440, 'ACP_MASS_EMAIL', 'email', 'acl_a_email'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (106, 1, 'ranks', 'acp', 1, 57, 311, 312, 'ACP_MANAGE_RANKS', 'ranks', 'acl_a_ranks'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (107, 1, 'ban', 'acp', 1, 59, 349, 350, 'ACP_BAN_EMAILS', 'email', 'acl_a_ban'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (108, 1, 'ban', 'acp', 1, 59, 351, 352, 'ACP_BAN_IPS', 'ip', 'acl_a_ban'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (109, 1, 'ban', 'acp', 1, 59, 353, 354, 'ACP_BAN_USERNAMES', 'user', 'acl_a_ban'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (110, 1, 'disallow', 'acp', 1, 59, 347, 348, 'ACP_DISALLOW_USERNAMES', 'usernames', 'acl_a_names'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (111, 1, 'prune', 'acp', 1, 59, 345, 346, 'ACP_PRUNE_USERS', 'users', 'acl_a_userdel'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (112, 1, 'prune', 'acp', 1, 53, 267, 268, 'ACP_PRUNE_FORUMS', 'forums', 'acl_a_prune'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (113, 1, 'profile', 'acp', 1, 57, 309, 310, 'ACP_CUSTOM_PROFILE_FIELDS', 'profile', 'acl_a_profile'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (114, 1, 'forums', 'acp', 1, 53, 265, 266, 'ACP_MANAGE_FORUMS', 'manage', 'acl_a_forum'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (115, 1, 'users', 'acp', 1, 57, 307, 308, 'ACP_MANAGE_USERS', 'overview', 'acl_a_user'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (116, 1, 'users', 'acp', 0, 57, 313, 314, 'ACP_USER_FEEDBACK', 'feedback', 'acl_a_user'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (117, 1, 'users', 'acp', 0, 57, 315, 316, 'ACP_USER_PROFILE', 'profile', 'acl_a_user'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (118, 1, 'users', 'acp', 0, 57, 317, 318, 'ACP_USER_PREFS', 'prefs', 'acl_a_user'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (119, 1, 'users', 'acp', 0, 57, 319, 320, 'ACP_USER_AVATAR', 'avatar', 'acl_a_user'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (120, 1, 'users', 'acp', 0, 57, 323, 324, 'ACP_USER_SIG', 'sig', 'acl_a_user'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (121, 1, 'users', 'acp', 0, 57, 325, 326, 'ACP_USER_GROUPS', 'groups', 'acl_a_user && acl_a_group'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (122, 1, 'users', 'acp', 0, 57, 327, 328, 'ACP_USER_PERM', 'perm', 'acl_a_user && acl_a_viewauth'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (123, 1, 'users', 'acp', 0, 57, 329, 330, 'ACP_USER_ATTACH', 'attach', 'acl_a_user'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (141, 1, '', 'acp', 1, 49, 410, 417, 'ACP_STYLE_COMPONENTS', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (142, 1, 'styles', 'acp', 1, 62, 407, 408, 'ACP_STYLES', 'style', 'acl_a_styles'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (143, 1, 'styles', 'acp', 1, 141, 411, 412, 'ACP_TEMPLATES', 'template', 'acl_a_styles'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (144, 1, 'styles', 'acp', 1, 141, 413, 414, 'ACP_THEMES', 'theme', 'acl_a_styles'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (145, 1, 'styles', 'acp', 1, 141, 415, 416, 'ACP_IMAGESETS', 'imageset', 'acl_a_styles'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (147, 1, 'users', 'acp', 0, 57, 321, 322, 'ACP_USER_RANK', 'rank', 'acl_a_user'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (148, 1, 'permissions', 'acp', 1, 61, 361, 362, 'ACP_USERS_PERMISSIONS', 'setting_user_global', 'acl_a_authusers && (acl_a_aauth || acl_a_mauth || acl_a_uauth)'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (149, 1, 'permissions', 'acp', 1, 180, 377, 378, 'ACP_USERS_FORUM_PERMISSIONS', 'setting_user_local', 'acl_a_authusers && (acl_a_mauth || acl_a_fauth)'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (150, 1, 'permissions', 'acp', 1, 61, 363, 364, 'ACP_GROUPS_PERMISSIONS', 'setting_group_global', 'acl_a_authgroups && (acl_a_aauth || acl_a_mauth || acl_a_uauth)'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (151, 1, 'permissions', 'acp', 1, 180, 379, 380, 'ACP_GROUPS_FORUM_PERMISSIONS', 'setting_group_local', 'acl_a_authgroups && (acl_a_mauth || acl_a_fauth)'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (152, 1, 'permissions', 'acp', 1, 174, 367, 368, 'ACP_ADMINISTRATORS', 'setting_admin_global', 'acl_a_aauth && (acl_a_authusers || acl_a_authgroups)'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (155, 1, 'permissions', 'acp', 1, 174, 369, 370, 'ACP_GLOBAL_MODERATORS', 'setting_mod_global', 'acl_a_mauth && (acl_a_authusers || acl_a_authgroups)'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (156, 1, 'permissions', 'acp', 1, 180, 375, 376, 'ACP_FORUM_MODERATORS', 'setting_mod_local', 'acl_a_mauth && (acl_a_authusers || acl_a_authgroups)'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (157, 1, 'permissions', 'acp', 1, 180, 373, 374, 'ACP_FORUM_PERMISSIONS', 'setting_forum_local', 'acl_a_fauth && (acl_a_authusers || acl_a_authgroups)'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (158, 1, '', 'acp', 1, 48, 392, 403, 'ACP_PERMISSION_MASKS', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (159, 1, 'permissions', 'acp', 1, 158, 393, 394, 'ACP_VIEW_ADMIN_PERMISSIONS', 'view_admin_global', 'acl_a_viewauth'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (160, 1, 'permissions', 'acp', 1, 158, 395, 396, 'ACP_VIEW_USER_PERMISSIONS', 'view_user_global', 'acl_a_viewauth'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (161, 1, 'permissions', 'acp', 1, 158, 397, 398, 'ACP_VIEW_GLOBAL_MOD_PERMISSIONS', 'view_mod_global', 'acl_a_viewauth'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (162, 1, 'permissions', 'acp', 1, 158, 399, 400, 'ACP_VIEW_FORUM_MOD_PERMISSIONS', 'view_mod_local', 'acl_a_viewauth'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (163, 1, 'permissions', 'acp', 1, 158, 401, 402, 'ACP_VIEW_FORUM_PERMISSIONS', 'view_forum_local', 'acl_a_viewauth'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (165, 1, '', 'acp', 1, 48, 382, 391, 'ACP_PERMISSION_ROLES', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (174, 1, '', 'acp', 1, 48, 366, 371, 'ACP_SPECIAL_PERMISSIONS', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (175, 1, 'permission_roles', 'acp', 1, 165, 383, 384, 'ACP_ADMIN_ROLES', 'admin_roles', 'acl_a_roles'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (176, 1, 'permissions', 'acp', 1, 48, 358, 359, 'ACP_PERMISSIONS', 'intro', 'acl_a_authusers || acl_a_authgroups || acl_a_viewauth'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (177, 1, 'permission_roles', 'acp', 1, 165, 385, 386, 'ACP_USER_ROLES', 'user_roles', 'acl_a_roles'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (178, 1, 'permission_roles', 'acp', 1, 165, 387, 388, 'ACP_MOD_ROLES', 'mod_roles', 'acl_a_roles'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (179, 1, 'permission_roles', 'acp', 1, 165, 389, 390, 'ACP_FORUM_ROLES', 'forum_roles', 'acl_a_roles'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (180, 1, '', 'acp', 1, 48, 372, 381, 'ACP_FORUM_BASED_PERMISSIONS', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (181, 1, 'permissions', 'acp', 1, 54, 271, 272, 'ACP_FORUM_PERMISSIONS', 'setting_forum_local', 'acl_a_fauth && (acl_a_authusers || acl_a_authgroups)'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (182, 1, 'permissions', 'acp', 1, 54, 273, 274, 'ACP_FORUM_MODERATORS', 'setting_mod_local', 'acl_a_mauth && (acl_a_authusers || acl_a_authgroups)'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (183, 1, 'permissions', 'acp', 1, 54, 275, 276, 'ACP_USERS_FORUM_PERMISSIONS', 'setting_user_local', 'acl_a_authusers && (acl_a_mauth || acl_a_fauth)'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (184, 1, 'permissions', 'acp', 1, 54, 277, 278, 'ACP_GROUPS_FORUM_PERMISSIONS', 'setting_group_local', 'acl_a_authgroups && (acl_a_mauth || acl_a_fauth)'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (185, 1, 'permissions', 'acp', 1, 57, 331, 332, 'ACP_USERS_PERMISSIONS', 'setting_user_global', 'acl_a_authusers && (acl_a_aauth || acl_a_mauth || acl_a_uauth)'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (186, 1, 'permissions', 'acp', 1, 58, 339, 340, 'ACP_GROUPS_PERMISSIONS', 'setting_group_global', 'acl_a_authgroups && (acl_a_aauth || acl_a_mauth || acl_a_uauth)'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (187, 1, 'permissions', 'acp', 1, 58, 341, 342, 'ACP_GROUPS_FORUM_PERMISSIONS', 'setting_group_local', 'acl_a_authgroups && (acl_a_mauth || acl_a_fauth)'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (188, 1, 'permissions', 'acp', 1, 57, 333, 334, 'ACP_USERS_FORUM_PERMISSIONS', 'setting_user_local', 'acl_a_authusers && (acl_a_mauth || acl_a_fauth)'); # MCP INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (124, 1, '', 'mcp', 1, 0, 35, 44, 'MCP_MAIN', '', ''); diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index e4339d8a64..b9fe4091b2 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -36,7 +36,7 @@ CREATE TABLE phpbb_auth_groups ( group_id mediumint(8) NOT NULL DEFAULT '0', forum_id mediumint(8) NOT NULL DEFAULT '0', auth_option_id mediumint(8) NOT NULL DEFAULT '0', - auth_preset_id mediumint(8) NOT NULL DEFAULT '0', + auth_role_id mediumint(8) NOT NULL DEFAULT '0', auth_setting tinyint(4) NOT NULL DEFAULT '0' ); @@ -54,22 +54,22 @@ CREATE TABLE phpbb_auth_options ( CREATE INDEX auth_option_phpbb_auth_options on phpbb_auth_options (auth_option); -# Table: phpbb_auth_presets -CREATE TABLE phpbb_auth_presets ( - preset_id INTEGER PRIMARY KEY NOT NULL, - preset_name varchar(50) NOT NULL DEFAULT '', - preset_type varchar(10) NOT NULL DEFAULT '', - preset_group_id mediumint(8) NOT NULL DEFAULT '0' +# Table: phpbb_auth_roles +CREATE TABLE phpbb_auth_roles ( + role_id INTEGER PRIMARY KEY NOT NULL, + role_name varchar(50) NOT NULL DEFAULT '', + role_type varchar(10) NOT NULL DEFAULT '', + role_group_ids varchar(255) NOT NULL DEFAULT '' ); -CREATE INDEX preset_type_phpbb_auth_presets on phpbb_auth_presets (preset_type); +CREATE INDEX role_type_phpbb_auth_roles on phpbb_auth_roles (role_type); -# Table: phpbb_auth_preset_data -CREATE TABLE phpbb_auth_preset_data ( - preset_id mediumint(8) NOT NULL DEFAULT '0', +# Table: phpbb_auth_roles_data +CREATE TABLE phpbb_auth_roles_data ( + role_id mediumint(8) NOT NULL DEFAULT '0', auth_option_id mediumint(8) NOT NULL DEFAULT '0', auth_setting tinyint(2) NOT NULL DEFAULT '0', - PRIMARY KEY (preset_id, auth_option_id) + PRIMARY KEY (role_id, auth_option_id) ); # Table: phpbb_auth_users @@ -77,7 +77,7 @@ CREATE TABLE phpbb_auth_users ( user_id mediumint(8) NOT NULL DEFAULT '0', forum_id mediumint(8) NOT NULL DEFAULT '0', auth_option_id mediumint(8) NOT NULL DEFAULT '0', - auth_preset_id mediumint(8) NOT NULL DEFAULT '0', + auth_role_id mediumint(8) NOT NULL DEFAULT '0', auth_setting tinyint(4) NOT NULL DEFAULT '0' ); diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index d796137bf3..93f42b58ec 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -32,6 +32,7 @@ if (empty($lang) || !is_array($lang)) $lang = array_merge($lang, array( 'ACP_ADMINISTRATORS' => 'Administrators', 'ACP_ADMIN_LOGS' => 'Admin Log', + 'ACP_ADMIN_ROLES' => 'Admin Roles', 'ACP_ATTACHMENTS' => 'Attachments', 'ACP_ATTACHMENT_SETTINGS' => 'Attachment Settings', 'ACP_AUTH_SETTINGS' => 'Authentication', @@ -42,6 +43,7 @@ $lang = array_merge($lang, array( 'ACP_BAN_EMAILS' => 'Ban Emails', 'ACP_BAN_IPS' => 'Ban IPs', 'ACP_BAN_USERNAMES' => 'Ban Usernames', + 'ACP_BASIC_PERMISSIONS' => 'Basic Permissions', 'ACP_BBCODES' => 'BBCodes', 'ACP_BOARD_DEFAULTS' => 'Board Defaults', 'ACP_BOARD_MANAGEMENT' => 'Board Management', @@ -70,10 +72,12 @@ $lang = array_merge($lang, array( 'ACP_EMAIL_SETTINGS' => 'Email Settings', 'ACP_EXTENSION_GROUPS' => 'Manage Extension Groups', - 'ACP_FORUM_LOGS' => 'Forum Logs', - 'ACP_FORUM_MANAGEMENT' => 'Forum Management', - 'ACP_FORUM_MODERATORS' => 'Forum Moderators', - 'ACP_FORUM_PERMISSIONS' => 'Forum Permissions', + 'ACP_FORUM_BASED_PERMISSIONS' => 'Forum Based Permissions', + 'ACP_FORUM_LOGS' => 'Forum Logs', + 'ACP_FORUM_MANAGEMENT' => 'Forum Management', + 'ACP_FORUM_MODERATORS' => 'Forum Moderators', + 'ACP_FORUM_PERMISSIONS' => 'Forum Permissions', + 'ACP_FORUM_ROLES' => 'Forum Roles', 'ACP_GENERAL_CONFIGURATION' => 'General Configuration', 'ACP_GENERAL_TASKS' => 'General Tasks', @@ -106,16 +110,15 @@ $lang = array_merge($lang, array( 'ACP_MESSAGE_SETTINGS' => 'Message Settings', 'ACP_MODULE_MANAGEMENT' => 'Module Management', 'ACP_MOD_LOGS' => 'Moderator Log', + 'ACP_MOD_ROLES' => 'Mod Roles', 'ACP_ORPHAN_ATTACHMENTS' => 'Orphan Attachments', + 'ACP_PERMISSIONS' => 'Permissions', 'ACP_PERMISSION_MASKS' => 'Permission Masks', + 'ACP_PERMISSION_ROLES' => 'Permission Roles', 'ACP_PERMISSION_SETTINGS' => 'Permission Settings', 'ACP_PHP_INFO' => 'PHP Information', - 'ACP_PRESET_ADMIN' => 'Admin Permission Presets', - 'ACP_PRESET_FORUM' => 'Forum Permission Presets', - 'ACP_PRESET_MOD' => 'Mod Permission Presets', - 'ACP_PRESET_USER' => 'User Permission Presets', 'ACP_PRUNE_FORUMS' => 'Prune Forums', 'ACP_PRUNE_USERS' => 'Prune Users', 'ACP_PRUNING' => 'Pruning', @@ -125,6 +128,7 @@ $lang = array_merge($lang, array( 'ACP_SERVER_CONFIGURATION' => 'Server Configuration', 'ACP_SERVER_SETTINGS' => 'Server Settings', 'ACP_SMILIES' => 'Smilies', + 'ACP_SPECIAL_PERMISSIONS' => 'Special Permissions', 'ACP_STYLE_COMPONENTS' => 'Style Components', 'ACP_STYLE_MANAGEMENT' => 'Style Management', 'ACP_STYLES' => 'Styles', @@ -145,6 +149,7 @@ $lang = array_merge($lang, array( 'ACP_USER_PREFS' => 'Preferences', 'ACP_USER_PROFILE' => 'Profile', 'ACP_USER_RANK' => 'Rank', + 'ACP_USER_ROLES' => 'User Roles', 'ACP_USER_SECURITY' => 'User Security', 'ACP_USER_SIG' => 'Signature', @@ -427,8 +432,18 @@ $lang = array_merge($lang, array( 'LOG_MODULE_ADD' => 'Module added