aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2008-09-23 13:03:33 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2008-09-23 13:03:33 +0000
commit4a3db854b7d0ce56f3a3033f1dcc9f5baa0af8f9 (patch)
tree10eb27f3a8968d49a52d0a4d487ab4717a88cda2 /phpBB
parent38afbf6759744fc541c71b5af07b500555e3e3b7 (diff)
downloadforums-4a3db854b7d0ce56f3a3033f1dcc9f5baa0af8f9.tar
forums-4a3db854b7d0ce56f3a3033f1dcc9f5baa0af8f9.tar.gz
forums-4a3db854b7d0ce56f3a3033f1dcc9f5baa0af8f9.tar.bz2
forums-4a3db854b7d0ce56f3a3033f1dcc9f5baa0af8f9.tar.xz
forums-4a3db854b7d0ce56f3a3033f1dcc9f5baa0af8f9.zip
- Added 'max_recipients' setting for private messages. This setting allows admins to define the maximum number of recipients per private message with a board-wide setting and a group-specific setting.
- Added new permission setting for sending private messages to groups. Now there are two permissions to define sending private messages to multiple recipients and private messages to groups. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8911 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/adm/style/acp_groups.html4
-rw-r--r--phpBB/develop/create_schema_files.php1
-rw-r--r--phpBB/develop/mysql_upgrader.php1
-rw-r--r--phpBB/includes/acp/acp_board.php1
-rw-r--r--phpBB/includes/acp/acp_groups.php4
-rw-r--r--phpBB/includes/functions_user.php16
-rw-r--r--phpBB/includes/ucp/ucp_groups.php6
-rw-r--r--phpBB/install/database_update.php97
-rw-r--r--phpBB/install/schemas/firebird_schema.sql1
-rw-r--r--phpBB/install/schemas/mssql_schema.sql1
-rw-r--r--phpBB/install/schemas/mysql_40_schema.sql1
-rw-r--r--phpBB/install/schemas/mysql_41_schema.sql1
-rw-r--r--phpBB/install/schemas/oracle_schema.sql1
-rw-r--r--phpBB/install/schemas/postgres_schema.sql1
-rw-r--r--phpBB/install/schemas/schema_data.sql20
-rw-r--r--phpBB/install/schemas/sqlite_schema.sql1
-rw-r--r--phpBB/language/en/acp/board.php3
-rw-r--r--phpBB/language/en/acp/groups.php2
-rw-r--r--phpBB/language/en/acp/permissions_phpbb.php3
-rw-r--r--phpBB/language/en/ucp.php2
-rw-r--r--phpBB/memberlist.php2
21 files changed, 138 insertions, 31 deletions
diff --git a/phpBB/adm/style/acp_groups.html b/phpBB/adm/style/acp_groups.html
index c90a075f9e..5df8a16a39 100644
--- a/phpBB/adm/style/acp_groups.html
+++ b/phpBB/adm/style/acp_groups.html
@@ -75,6 +75,10 @@
<dd><input name="group_message_limit" type="text" id="group_message_limit" maxlength="4" size="4" value="{GROUP_MESSAGE_LIMIT}" /></dd>
</dl>
<dl>
+ <dt><label for="group_max_recipients">{L_GROUP_MAX_RECIPIENTS}:</label><br /><span>{L_GROUP_MAX_RECIPIENTS_EXPLAIN}</span></dt>
+ <dd><input name="group_max_recipients" type="text" id="group_max_recipients" maxlength="10" size="4" value="{GROUP_MAX_RECIPIENTS}" /></dd>
+ </dl>
+ <dl>
<dt><label for="group_colour">{L_GROUP_COLOR}:</label><br /><span>{L_GROUP_COLOR_EXPLAIN}</span></dt>
<dd><input name="group_colour" type="text" id="group_colour" value="{GROUP_COLOUR}" size="6" maxlength="6" />&nbsp;&nbsp;<span>[ <a href="{U_SWATCH}" onclick="popup(this.href, 636, 150, '_swatch'); return false">{L_COLOUR_SWATCH}</a> ]</span></dd>
</dl>
diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php
index ee3d5db88a..3c8e5275a0 100644
--- a/phpBB/develop/create_schema_files.php
+++ b/phpBB/develop/create_schema_files.php
@@ -1140,6 +1140,7 @@ function get_schema_struct()
'group_sig_chars' => array('UINT', 0),
'group_receive_pm' => array('BOOL', 0),
'group_message_limit' => array('UINT', 0),
+ 'group_max_recipients' => array('UINT', 0),
'group_legend' => array('BOOL', 1),
),
'PRIMARY_KEY' => 'group_id',
diff --git a/phpBB/develop/mysql_upgrader.php b/phpBB/develop/mysql_upgrader.php
index e60f327ab5..82fbfb09eb 100644
--- a/phpBB/develop/mysql_upgrader.php
+++ b/phpBB/develop/mysql_upgrader.php
@@ -612,6 +612,7 @@ function get_schema_struct()
'group_sig_chars' => array('UINT', 0),
'group_receive_pm' => array('BOOL', 0),
'group_message_limit' => array('UINT', 0),
+ 'group_max_recipients' => array('UINT', 0),
'group_legend' => array('BOOL', 1),
),
'PRIMARY_KEY' => 'group_id',
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index 51c8944966..bce35ee68f 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -131,6 +131,7 @@ class acp_board
'pm_max_msgs' => array('lang' => 'BOXES_LIMIT', 'validate' => 'int:0', 'type' => 'text:4:4', 'explain' => true),
'full_folder_action' => array('lang' => 'FULL_FOLDER_ACTION', 'validate' => 'int', 'type' => 'select', 'method' => 'full_folder_select', 'explain' => true),
'pm_edit_time' => array('lang' => 'PM_EDIT_TIME', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
+ 'pm_max_recipients' => array('lang' => 'PM_MAX_RECIPIENTS', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true),
'legend2' => 'GENERAL_OPTIONS',
'allow_mass_pm' => array('lang' => 'ALLOW_MASS_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php
index 6d789fb5ff..96ac3de3ce 100644
--- a/phpBB/includes/acp/acp_groups.php
+++ b/phpBB/includes/acp/acp_groups.php
@@ -303,6 +303,7 @@ class acp_groups
'receive_pm' => isset($_REQUEST['group_receive_pm']) ? 1 : 0,
'legend' => isset($_REQUEST['group_legend']) ? 1 : 0,
'message_limit' => request_var('group_message_limit', 0),
+ 'max_recipients' => request_var('group_max_recipients', 0),
'founder_manage' => 0,
);
@@ -395,7 +396,7 @@ class acp_groups
// were made.
$group_attributes = array();
- $test_variables = array('rank', 'colour', 'avatar', 'avatar_type', 'avatar_width', 'avatar_height', 'receive_pm', 'legend', 'message_limit', 'founder_manage');
+ $test_variables = array('rank', 'colour', 'avatar', 'avatar_type', 'avatar_width', 'avatar_height', 'receive_pm', 'legend', 'message_limit', 'max_recipients', 'founder_manage');
foreach ($test_variables as $test)
{
if (isset($submit_ary[$test]) && ($action == 'add' || $group_row['group_' . $test] != $submit_ary[$test]))
@@ -555,6 +556,7 @@ class acp_groups
'GROUP_FOUNDER_MANAGE' => (isset($group_row['group_founder_manage']) && $group_row['group_founder_manage']) ? ' checked="checked"' : '',
'GROUP_LEGEND' => (isset($group_row['group_legend']) && $group_row['group_legend']) ? ' checked="checked"' : '',
'GROUP_MESSAGE_LIMIT' => (isset($group_row['group_message_limit'])) ? $group_row['group_message_limit'] : 0,
+ 'GROUP_MAX_RECIPIENTS' => (isset($group_row['group_max_recipients'])) ? $group_row['group_max_recipients'] : 0,
'GROUP_COLOUR' => (isset($group_row['group_colour'])) ? $group_row['group_colour'] : '',
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 6aa4b1e4ea..c6b5018f01 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -315,8 +315,6 @@ function user_delete($mode, $user_id, $post_username = false)
return false;
}
- $db->sql_transaction('begin');
-
// Before we begin, we will remove the reports the user issued.
$sql = 'SELECT r.post_id, p.topic_id
FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . ' p
@@ -385,6 +383,8 @@ function user_delete($mode, $user_id, $post_username = false)
{
case 'retain':
+ $db->sql_transaction('begin');
+
if ($post_username === false)
{
$post_username = $user->lang['GUEST'];
@@ -432,6 +432,9 @@ function user_delete($mode, $user_id, $post_username = false)
$db->sql_query($sql);
}
}
+
+ $db->sql_transaction('commit');
+
break;
case 'remove':
@@ -485,6 +488,8 @@ function user_delete($mode, $user_id, $post_username = false)
break;
}
+ $db->sql_transaction('begin');
+
$table_ary = array(USERS_TABLE, USER_GROUP_TABLE, TOPICS_WATCH_TABLE, FORUMS_WATCH_TABLE, ACL_USERS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, FORUMS_TRACK_TABLE, PROFILE_FIELDS_DATA_TABLE, MODERATOR_CACHE_TABLE, DRAFTS_TABLE, BOOKMARKS_TABLE);
foreach ($table_ary as $table)
@@ -553,6 +558,8 @@ function user_delete($mode, $user_id, $post_username = false)
$db->sql_query($sql);
}
+ $db->sql_transaction('commit');
+
// Reset newest user info if appropriate
if ($config['newest_user_id'] == $user_id)
{
@@ -565,8 +572,6 @@ function user_delete($mode, $user_id, $post_username = false)
set_config('num_users', $config['num_users'] - 1, true);
}
- $db->sql_transaction('commit');
-
return false;
}
@@ -2350,12 +2355,13 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow
'group_receive_pm' => 'int',
'group_legend' => 'int',
'group_message_limit' => 'int',
+ 'group_max_recipients' => 'int',
'group_founder_manage' => 'int',
);
// Those are group-only attributes
- $group_only_ary = array('group_receive_pm', 'group_legend', 'group_message_limit', 'group_founder_manage');
+ $group_only_ary = array('group_receive_pm', 'group_legend', 'group_message_limit', 'group_max_recipients', 'group_founder_manage');
// Check data. Limit group name length.
if (!utf8_strlen($name) || utf8_strlen($name) > 60)
diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php
index 26bc8159e8..32d24337c9 100644
--- a/phpBB/includes/ucp/ucp_groups.php
+++ b/phpBB/includes/ucp/ucp_groups.php
@@ -505,7 +505,8 @@ class ucp_groups
'colour' => request_var('group_colour', ''),
'rank' => request_var('group_rank', 0),
'receive_pm' => isset($_REQUEST['group_receive_pm']) ? 1 : 0,
- 'message_limit' => request_var('group_message_limit', 0)
+ 'message_limit' => request_var('group_message_limit', 0),
+ 'max_recipients'=> request_var('group_max_recipients', 0),
);
$data['uploadurl'] = request_var('uploadurl', '');
@@ -603,7 +604,7 @@ class ucp_groups
// were made.
$group_attributes = array();
- $test_variables = array('rank', 'colour', 'avatar', 'avatar_type', 'avatar_width', 'avatar_height');
+ $test_variables = array('rank', 'colour', 'avatar', 'avatar_type', 'avatar_width', 'avatar_height', 'receive_pm', 'legend', 'message_limit', 'max_recipients');
foreach ($test_variables as $test)
{
if ($action == 'add' || (isset($submit_ary[$test]) && $group_row['group_' . $test] != $submit_ary[$test]))
@@ -693,6 +694,7 @@ class ucp_groups
'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
'GROUP_RECEIVE_PM' => (isset($group_row['group_receive_pm']) && $group_row['group_receive_pm']) ? ' checked="checked"' : '',
'GROUP_MESSAGE_LIMIT' => (isset($group_row['group_message_limit'])) ? $group_row['group_message_limit'] : 0,
+ 'GROUP_MAX_RECIPIENTS' => (isset($group_row['group_max_recipients'])) ? $group_row['group_max_recipients'] : 0,
'GROUP_DESC' => $group_desc_data['text'],
'S_DESC_BBCODE_CHECKED' => $group_desc_data['allow_bbcode'],
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index c9ced1dbcb..81db58cf21 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -540,6 +540,9 @@ $database_update_info = array(
'template_inherits_id' => array('UINT:4', 0),
'template_inherit_path' => array('VCHAR', ''),
),
+ GROUPS_TABLE => array(
+ 'group_max_recipients' => array('UINT', 0),
+ ),
),
),
);
@@ -1413,7 +1416,7 @@ if (function_exists('exit_handler'))
*/
function change_database_data(&$no_updates, $version)
{
- global $db, $map_dbms, $errored, $error_ary, $config, $phpbb_root_path;
+ global $db, $map_dbms, $errored, $error_ary, $config, $phpbb_root_path, $phpEx;
switch ($version)
{
@@ -1837,22 +1840,94 @@ function change_database_data(&$no_updates, $version)
set_config('enable_queue_trigger', '0');
set_config('queue_trigger_posts', '3');
+ set_config('pm_max_recipients', '0');
+
+ // Set maximum number of recipients for the registered users, bots, guests group
+ $sql = 'UPDATE ' . GROUPS_TABLE . ' SET group_max_recipients = 5
+ WHERE ' . $db->sql_in_set('group_name', array('GUESTS', 'REGISTERED', 'REGISTERED_COPPA', 'BOTS'));
+ _sql($sql, $errored, $error_ary);
+
// Not prefilling yet
set_config('dbms_version', '');
- // Resync post counts
- $sql = 'SELECT COUNT(p.post_id) AS num_posts, u.user_id
- FROM ' . USERS_TABLE . ' u
- LEFT JOIN ' . POSTS_TABLE . ' p ON (u.user_id = p.poster_id AND p.post_postcount = 1 AND p.post_approved = 1)
- GROUP BY u.user_id';
- $result = _sql($sql, $errored, $error_ary);
+ // Add new permission u_masspm_group and duplicate settings from u_masspm
+ include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
+ $auth_admin = new auth_admin();
- while ($row = $db->sql_fetchrow($result))
+ // Only add the new permission if it does not already exist
+ if (empty($auth_admin->acl_options['id']['u_masspm_group']))
{
- $sql = 'UPDATE ' . USERS_TABLE . " SET user_posts = {$row['num_posts']} WHERE user_id = {$row['user_id']}";
- _sql($sql, $errored, $error_ary);
+ $auth_admin->acl_add_option(array('global' => array('u_masspm_group')));
+
+ // Now the tricky part, filling the permission
+ $old_id = $auth_admin->acl_options['id']['u_masspm'];
+ $new_id = $auth_admin->acl_options['id']['u_masspm_group'];
+
+ $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();
}
- $db->sql_freeresult($result);
+
+ /**
+ * Do not resync post counts here. An admin may later do this from the ACP
+ $start = 0;
+
+ do
+ {
+ @flush();
+
+ $sql = 'SELECT COUNT(p.post_id) AS num_posts, u.user_id
+ FROM ' . USERS_TABLE . ' u
+ LEFT JOIN ' . POSTS_TABLE . ' p ON (u.user_id = p.poster_id AND p.post_postcount = 1 AND p.post_approved = 1)
+ GROUP BY u.user_id
+ ORDER BY u.user_id ASC';
+ $result = $db->sql_query_limit($sql, 200, $start);
+
+ if ($row = $db->sql_fetchrow($result))
+ {
+ $i = 0;
+
+ do
+ {
+ $sql = 'UPDATE ' . USERS_TABLE . " SET user_posts = {$row['num_posts']} WHERE user_id = {$row['user_id']}";
+ _sql($sql, $errored, $error_ary);
+
+ $i++;
+ }
+ while ($row = $db->sql_fetchrow($result));
+
+ $start = ($i < 200) ? 0 : $start + 200;
+ }
+ else
+ {
+ $start = 0;
+ }
+ $db->sql_freeresult($result);
+ }
+ while ($start);
+ */
$no_updates = false;
break;
diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql
index 237a2ce63d..e3e2e43723 100644
--- a/phpBB/install/schemas/firebird_schema.sql
+++ b/phpBB/install/schemas/firebird_schema.sql
@@ -440,6 +440,7 @@ CREATE TABLE phpbb_groups (
group_sig_chars INTEGER DEFAULT 0 NOT NULL,
group_receive_pm INTEGER DEFAULT 0 NOT NULL,
group_message_limit INTEGER DEFAULT 0 NOT NULL,
+ group_max_recipients INTEGER DEFAULT 0 NOT NULL,
group_legend INTEGER DEFAULT 1 NOT NULL
);;
diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql
index 48aa594c37..3a3d3fcbd4 100644
--- a/phpBB/install/schemas/mssql_schema.sql
+++ b/phpBB/install/schemas/mssql_schema.sql
@@ -545,6 +545,7 @@ CREATE TABLE [phpbb_groups] (
[group_sig_chars] [int] DEFAULT (0) NOT NULL ,
[group_receive_pm] [int] DEFAULT (0) NOT NULL ,
[group_message_limit] [int] DEFAULT (0) NOT NULL ,
+ [group_max_recipients] [int] DEFAULT (0) NOT NULL ,
[group_legend] [int] DEFAULT (1) NOT NULL
) ON [PRIMARY]
GO
diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql
index ec65dc938b..01d8efa921 100644
--- a/phpBB/install/schemas/mysql_40_schema.sql
+++ b/phpBB/install/schemas/mysql_40_schema.sql
@@ -312,6 +312,7 @@ CREATE TABLE phpbb_groups (
group_sig_chars mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
group_receive_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
group_message_limit mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ group_max_recipients mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
group_legend tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
PRIMARY KEY (group_id),
KEY group_legend_name (group_legend, group_name(255))
diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql
index 4514700758..0119e4ce9d 100644
--- a/phpBB/install/schemas/mysql_41_schema.sql
+++ b/phpBB/install/schemas/mysql_41_schema.sql
@@ -312,6 +312,7 @@ CREATE TABLE phpbb_groups (
group_sig_chars mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
group_receive_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
group_message_limit mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ group_max_recipients mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
group_legend tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
PRIMARY KEY (group_id),
KEY group_legend_name (group_legend, group_name)
diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql
index d1b3b903d4..c9b138b8d8 100644
--- a/phpBB/install/schemas/oracle_schema.sql
+++ b/phpBB/install/schemas/oracle_schema.sql
@@ -602,6 +602,7 @@ CREATE TABLE phpbb_groups (
group_sig_chars number(8) DEFAULT '0' NOT NULL,
group_receive_pm number(1) DEFAULT '0' NOT NULL,
group_message_limit number(8) DEFAULT '0' NOT NULL,
+ group_max_recipients number(8) DEFAULT '0' NOT NULL,
group_legend number(1) DEFAULT '1' NOT NULL,
CONSTRAINT pk_phpbb_groups PRIMARY KEY (group_id)
)
diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql
index 62206bebdb..32f3f0cd4a 100644
--- a/phpBB/install/schemas/postgres_schema.sql
+++ b/phpBB/install/schemas/postgres_schema.sql
@@ -455,6 +455,7 @@ CREATE TABLE phpbb_groups (
group_sig_chars INT4 DEFAULT '0' NOT NULL CHECK (group_sig_chars >= 0),
group_receive_pm INT2 DEFAULT '0' NOT NULL CHECK (group_receive_pm >= 0),
group_message_limit INT4 DEFAULT '0' NOT NULL CHECK (group_message_limit >= 0),
+ group_max_recipients INT4 DEFAULT '0' NOT NULL CHECK (group_max_recipients >= 0),
group_legend INT2 DEFAULT '1' NOT NULL CHECK (group_legend >= 0),
PRIMARY KEY (group_id)
);
diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index a4dcb508eb..d738aa8ad6 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -181,6 +181,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('pass_complex', 'PA
INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_edit_time', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_max_boxes', '4');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_max_msgs', '50');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_max_recipients', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('posts_per_page', '10');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('print_pm', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('queue_interval', '600');
@@ -346,6 +347,7 @@ 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);
INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_masspm', 1);
+INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_masspm_group', 1);
INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_attach', 1);
INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_bbcode', 1);
INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_delete', 1);
@@ -487,12 +489,12 @@ INSERT INTO phpbb_users (user_type, group_id, username, username_clean, user_reg
INSERT INTO phpbb_users (user_type, group_id, username, username_clean, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_from, user_icq, user_aim, user_yim, user_msnm, user_jabber, user_website, user_occ, user_interests, user_actkey, user_newpasswd) VALUES (3, 5, 'Admin', 'admin', 0, '21232f297a57a5a743894a0e4a801fc3', 'admin@yourdomain.com', 'en', 1, 1, 'AA0000', 1, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', '', '', '', '', '', '', '', '', '');
# -- Groups
-INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid) VALUES ('GUESTS', 3, 0, '', 0, '', '', '');
-INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid) VALUES ('REGISTERED', 3, 0, '', 0, '', '', '');
-INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid) VALUES ('REGISTERED_COPPA', 3, 0, '', 0, '', '', '');
-INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid) VALUES ('GLOBAL_MODERATORS', 3, 0, '00AA00', 1, '', '', '');
-INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid) VALUES ('ADMINISTRATORS', 3, 1, 'AA0000', 1, '', '', '');
-INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid) VALUES ('BOTS', 3, 0, '9E8DA7', 0, '', '', '');
+INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('GUESTS', 3, 0, '', 0, '', '', '', 5);
+INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('REGISTERED', 3, 0, '', 0, '', '', '', 5);
+INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('REGISTERED_COPPA', 3, 0, '', 0, '', '', '', 5);
+INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('GLOBAL_MODERATORS', 3, 0, '00AA00', 1, '', '', '', 0);
+INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('ADMINISTRATORS', 3, 1, 'AA0000', 1, '', '', '', 0);
+INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('BOTS', 3, 0, '9E8DA7', 0, '', '', '', 5);
# -- User -> Group
INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (1, 1, 0, 0);
@@ -524,15 +526,15 @@ 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 6, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option NOT IN ('u_viewonline', 'u_chggrp', 'u_chgname', 'u_ignoreflood', 'u_pm_flash', 'u_pm_forward');
# Limited Features (u_)
-INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 7, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option NOT IN ('u_attach', 'u_viewonline', 'u_chggrp', 'u_chgname', 'u_ignoreflood', 'u_pm_attach', 'u_pm_emailpm', 'u_pm_flash', 'u_savedrafts', 'u_search', 'u_sendemail', 'u_sendim');
+INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 7, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option NOT IN ('u_attach', 'u_viewonline', 'u_chggrp', 'u_chgname', 'u_ignoreflood', 'u_pm_attach', 'u_pm_emailpm', 'u_pm_flash', 'u_savedrafts', 'u_search', 'u_sendemail', 'u_sendim', 'u_masspm', 'u_masspm_group');
# No Private Messages (u_)
INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 8, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option IN ('u_', 'u_chgavatar', 'u_chgcensors', 'u_chgemail', 'u_chgpasswd', 'u_download', 'u_hideonline', 'u_sig', 'u_viewprofile');
-INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 8, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option IN ('u_readpm', 'u_sendpm', 'u_masspm');
+INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 8, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option IN ('u_readpm', 'u_sendpm', 'u_masspm', 'u_masspm_group');
# No Avatar (u_)
INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 9, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option NOT IN ('u_attach', 'u_chgavatar', 'u_viewonline', 'u_chggrp', 'u_chgname', 'u_ignoreflood', 'u_pm_attach', 'u_pm_emailpm', 'u_pm_flash', 'u_savedrafts', 'u_search', 'u_sendemail', 'u_sendim');
-INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 9, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option IN ('u_chgavatar');
+INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 9, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option IN ('u_chgavatar', 'u_masspm', 'u_masspm_group');
# Full Moderator (m_)
INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 10, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'm_%';
diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql
index 4de0a65fa2..8033b2d583 100644
--- a/phpBB/install/schemas/sqlite_schema.sql
+++ b/phpBB/install/schemas/sqlite_schema.sql
@@ -304,6 +304,7 @@ CREATE TABLE phpbb_groups (
group_sig_chars INTEGER UNSIGNED NOT NULL DEFAULT '0',
group_receive_pm INTEGER UNSIGNED NOT NULL DEFAULT '0',
group_message_limit INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ group_max_recipients INTEGER UNSIGNED NOT NULL DEFAULT '0',
group_legend INTEGER UNSIGNED NOT NULL DEFAULT '1'
);
diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php
index 81d2504a1c..76de3487fd 100644
--- a/phpBB/language/en/acp/board.php
+++ b/phpBB/language/en/acp/board.php
@@ -113,6 +113,7 @@ $lang = array_merge($lang, array(
'ALLOW_FORWARD_PM' => 'Allow forwarding of private messages',
'ALLOW_IMG_PM' => 'Allow use of <code>[IMG]</code> BBCode tag',
'ALLOW_MASS_PM' => 'Allow sending of private messages to multiple users and groups',
+ 'ALLOW_MASS_PM_EXPLAIN' => 'Sending to groups can be adjusted per group within the group settings page.',
'ALLOW_PRINT_PM' => 'Allow print view in private messaging',
'ALLOW_QUOTE_PM' => 'Allow quotes in private messages',
'ALLOW_SIG_PM' => 'Allow signature in private messages',
@@ -127,6 +128,8 @@ $lang = array_merge($lang, array(
'HOLD_NEW_MESSAGES' => 'Hold new messages',
'PM_EDIT_TIME' => 'Limit editing time',
'PM_EDIT_TIME_EXPLAIN' => 'Limits the time available to edit a private message not already delivered. Setting the value to 0 disables this behaviour.',
+ 'PM_MAX_RECIPIENTS' => 'Maximum number of allowed recipients',
+ 'PM_MAX_RECIPIENTS_EXPLAIN' => 'The maximum number of allowed recipients in a private message. If 0 is entered, an unlimited number is allowed. This setting can be adjusted for every group within the group settings page.',
));
// Post Settings
diff --git a/phpBB/language/en/acp/groups.php b/phpBB/language/en/acp/groups.php
index f74110a7d3..db6f334540 100644
--- a/phpBB/language/en/acp/groups.php
+++ b/phpBB/language/en/acp/groups.php
@@ -86,6 +86,8 @@ $lang = array_merge($lang, array(
'GROUP_NAME_TAKEN' => 'The group name you entered is already in use, please select an alternative.',
'GROUP_OPEN' => 'Open',
'GROUP_PENDING' => 'Pending members',
+ 'GROUP_MAX_RECIPIENTS' => 'Maximum number of allowed recipients per private message',
+ 'GROUP_MAX_RECIPIENTS_EXPLAIN' => 'The maximum number of allowed recipients in a private message. If 0 is entered, the board-wide setting is used.',
'GROUP_PROMOTE' => 'Promote to group leader',
'GROUP_RANK' => 'Group rank',
'GROUP_RECEIVE_PM' => 'Group able to receive private messages',
diff --git a/phpBB/language/en/acp/permissions_phpbb.php b/phpBB/language/en/acp/permissions_phpbb.php
index 8f090667b4..c8ccc0e56a 100644
--- a/phpBB/language/en/acp/permissions_phpbb.php
+++ b/phpBB/language/en/acp/permissions_phpbb.php
@@ -111,7 +111,8 @@ $lang = array_merge($lang, array(
'acl_u_sig' => array('lang' => 'Can use signature', 'cat' => 'post'),
'acl_u_sendpm' => array('lang' => 'Can send private messages', 'cat' => 'pm'),
- 'acl_u_masspm' => array('lang' => 'Can send pm to multiple users and groups', 'cat' => 'pm'),
+ 'acl_u_masspm' => array('lang' => 'Can send messages to multiple users', 'cat' => 'pm'),
+ 'acl_u_masspm_group'=> array('lang' => 'Can send messages to groups', 'cat' => 'pm'),
'acl_u_readpm' => array('lang' => 'Can read private messages', 'cat' => 'pm'),
'acl_u_pm_edit' => array('lang' => 'Can edit own private messages', 'cat' => 'pm'),
'acl_u_pm_delete' => array('lang' => 'Can remove private messages from own folder', 'cat' => 'pm'),
diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php
index 6f262b980a..79026af56f 100644
--- a/phpBB/language/en/ucp.php
+++ b/phpBB/language/en/ucp.php
@@ -391,7 +391,7 @@ $lang = array_merge($lang, array(
'TIMEZONE' => 'Timezone',
'TO' => 'To',
- 'TOO_MANY_RECIPIENTS' => 'Too many recipients.',
+ 'TOO_MANY_RECIPIENTS' => 'You tried to send a private message to too many recipients.',
'TOO_MANY_REGISTERS' => 'You have exceeded the maximum number of registration attempts for this session. Please try again later.',
'UCP' => 'User Control Panel',
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php
index e87cffcfe6..611aa11e59 100644
--- a/phpBB/memberlist.php
+++ b/phpBB/memberlist.php
@@ -1159,7 +1159,7 @@ switch ($mode)
'RANK_IMG' => $rank_img,
'RANK_IMG_SRC' => $rank_img_src,
- 'U_PM' => ($auth->acl_get('u_sendpm') && $auth->acl_get('u_masspm') && $group_row['group_receive_pm'] && $config['allow_privmsg'] && $config['allow_mass_pm']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=compose&amp;g=' . $group_id) : '',)
+ 'U_PM' => ($auth->acl_get('u_sendpm') && $auth->acl_get('u_masspm_group') && $group_row['group_receive_pm'] && $config['allow_privmsg'] && $config['allow_mass_pm']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=compose&amp;g=' . $group_id) : '',)
);
$sql_select = ', ug.group_leader';