1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 08:47:45 +02:00

Merge branch 'develop' of github.com:EXreaction/phpbb3 into ticket/11103

Conflicts:
	phpBB/install/database_update.php
	phpBB/styles/prosilver/template/ucp_prefs_personal.html
	phpBB/styles/subsilver2/template/ucp_prefs_personal.html
This commit is contained in:
Nathan Guse
2012-12-07 21:14:39 -06:00
94 changed files with 1884 additions and 520 deletions

View File

@@ -2346,6 +2346,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;
@@ -2768,8 +2788,6 @@ function change_database_data(&$no_updates, $version)
$config->set('display_last_subject', '1');
}
$no_updates = false;
if (!isset($config['assets_version']))
{
$config->set('assets_version', '1');
@@ -2873,6 +2891,77 @@ function change_database_data(&$no_updates, $version)
}
}
// 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;
}
}