mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-07 01:06:48 +02:00
- 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
This commit is contained in:
@@ -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),
|
||||
|
@@ -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'] : '',
|
||||
|
||||
|
||||
|
@@ -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)
|
||||
|
@@ -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'],
|
||||
|
Reference in New Issue
Block a user