1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 14:00:31 +02:00

Merge branch 'develop' into feature/avatars

Conflicts:
	phpBB/install/database_update.php
This commit is contained in:
Marc Alexander
2012-12-09 21:02:31 +01:00
173 changed files with 3806 additions and 936 deletions

View File

@@ -113,6 +113,7 @@ $phpbb_container = phpbb_create_dumped_container_unless_debug(
),
array(
new phpbb_di_pass_collection_pass(),
new phpbb_di_pass_kernel_pass(),
),
$phpbb_root_path,
$phpEx
@@ -2304,6 +2305,26 @@ function change_database_data(&$no_updates, $version)
}
}
// Disable receiving pms for bots
$sql = 'SELECT user_id
FROM ' . BOTS_TABLE;
$result = $db->sql_query($sql);
$bot_user_ids = array();
while ($row = $db->sql_fetchrow($result))
{
$bot_user_ids[] = (int) $row['user_id'];
}
$db->sql_freeresult($result);
if (!empty($bot_user_ids))
{
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_allow_pm = 0
WHERE ' . $db->sql_in_set('user_id', $bot_user_ids);
_sql($sql, $errored, $error_ary);
}
$no_updates = false;
break;
@@ -2745,8 +2766,6 @@ function change_database_data(&$no_updates, $version)
$config->set('allow_avatar_gravatar', '0');
}
$no_updates = false;
if (!isset($config['assets_version']))
{
$config->set('assets_version', '1');
@@ -2784,6 +2803,78 @@ function change_database_data(&$no_updates, $version)
$config->set('site_home_text', '');
}
// PHPBB3-10601: Make inbox default. Add basename to ucp's pm category
// Get the category wanted while checking, at the same time, if this has already been applied
$sql = 'SELECT module_id, module_basename
FROM ' . MODULES_TABLE . "
WHERE module_basename <> 'ucp_pm' AND
module_langname='UCP_PM'
";
$result = $db->sql_query_limit($sql, 1);
if ($row = $db->sql_fetchrow($result))
{
// This update is still not applied. Applying it
$sql = 'UPDATE ' . MODULES_TABLE . "
SET module_basename = 'ucp_pm'
WHERE module_id = " . (int) $row['module_id'];
_sql($sql, $errored, $error_ary);
}
$db->sql_freeresult($result);
// Add new permission u_chgprofileinfo and duplicate settings from u_sig
include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
$auth_admin = new auth_admin();
// Only add the new permission if it does not already exist
if (empty($auth_admin->acl_options['id']['u_chgprofileinfo']))
{
$auth_admin->acl_add_option(array('global' => array('u_chgprofileinfo')));
// Now the tricky part, filling the permission
$old_id = $auth_admin->acl_options['id']['u_sig'];
$new_id = $auth_admin->acl_options['id']['u_chgprofileinfo'];
$tables = array(ACL_GROUPS_TABLE, ACL_ROLES_DATA_TABLE, ACL_USERS_TABLE);
foreach ($tables as $table)
{
$sql = 'SELECT *
FROM ' . $table . '
WHERE auth_option_id = ' . $old_id;
$result = _sql($sql, $errored, $error_ary);
$sql_ary = array();
while ($row = $db->sql_fetchrow($result))
{
$row['auth_option_id'] = $new_id;
$sql_ary[] = $row;
}
$db->sql_freeresult($result);
if (sizeof($sql_ary))
{
$db->sql_multi_insert($table, $sql_ary);
}
}
// Remove any old permission entries
$auth_admin->acl_clear_prefetch();
}
// Update the auth setting for the module
$sql = 'UPDATE ' . MODULES_TABLE . "
SET module_auth = 'acl_u_chgprofileinfo'
WHERE module_class = 'ucp'
AND module_basename = 'ucp_profile'
AND module_mode = 'profile_info'";
_sql($sql, $errored, $error_ary);
$no_updates = false;
break;
}
}

View File

@@ -1478,8 +1478,14 @@ class install_install extends module
foreach ($this->module_categories[$module_class] as $cat_name => $subs)
{
$basename = '';
// Check if this sub-category has a basename. If it has, use it.
if (isset($this->module_categories_basenames[$cat_name]))
{
$basename = $this->module_categories_basenames[$cat_name];
}
$module_data = array(
'module_basename' => '',
'module_basename' => $basename,
'module_enabled' => 1,
'module_display' => 1,
'parent_id' => 0,
@@ -1507,8 +1513,14 @@ class install_install extends module
{
foreach ($subs as $level2_name)
{
$basename = '';
// Check if this sub-category has a basename. If it has, use it.
if (isset($this->module_categories_basenames[$level2_name]))
{
$basename = $this->module_categories_basenames[$level2_name];
}
$module_data = array(
'module_basename' => '',
'module_basename' => $basename,
'module_enabled' => 1,
'module_display' => 1,
'parent_id' => (int) $categories[$cat_name]['id'],
@@ -1772,6 +1784,7 @@ class install_install extends module
'user_timezone' => 'UTC',
'user_dateformat' => $lang['default_dateformat'],
'user_allow_massemail' => 0,
'user_allow_pm' => 0,
);
$user_id = user_add($user_row);
@@ -2115,6 +2128,9 @@ class install_install extends module
'UCP_ZEBRA' => null,
),
);
var $module_categories_basenames = array(
'UCP_PM' => 'ucp_pm',
);
var $module_extras = array(
'acp' => array(

View File

@@ -71,7 +71,7 @@ class install_update extends module
function main($mode, $sub)
{
global $style, $template, $phpEx, $phpbb_root_path, $user, $db, $config, $cache, $auth, $language;
global $phpbb_style, $template, $phpEx, $phpbb_root_path, $user, $db, $config, $cache, $auth, $language;
global $request;
$this->tpl_name = 'install_update';

View File

@@ -388,6 +388,7 @@ INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chgemail', 1);
INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chggrp', 1);
INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chgname', 1);
INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chgpasswd', 1);
INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chgprofileinfo', 1);
INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_download', 1);
INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_hideonline', 1);
INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_ignoreflood', 1);
@@ -549,7 +550,7 @@ INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT
INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 22, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_attach', 'f_bump', 'f_delete', 'f_flash', 'f_icons', 'f_ignoreflood', 'f_sticky', 'f_user_lock', 'f_votechg');
# New Member (u_)
INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 23, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option IN ('u_sendpm', 'u_masspm', 'u_masspm_group');
INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 23, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option IN ('u_sendpm', 'u_masspm', 'u_masspm_group', 'u_chgprofileinfo');
# New Member (f_)
INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 24, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_noapprove');