mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/15518] Add a setting to toggle permission checks for pms in viewtopic
PHPBB3-15518
This commit is contained in:
parent
1cd8bbac0c
commit
f01e29effe
5 changed files with 53 additions and 5 deletions
|
@ -356,6 +356,7 @@ class acp_board
|
||||||
'load_user_activity_limit' => array('lang' => 'LOAD_USER_ACTIVITY_LIMIT', 'validate' => 'int:0:99999999', 'type' => 'number:0:99999999', 'explain' => true),
|
'load_user_activity_limit' => array('lang' => 'LOAD_USER_ACTIVITY_LIMIT', 'validate' => 'int:0:99999999', 'type' => 'number:0:99999999', 'explain' => true),
|
||||||
'load_tplcompile' => array('lang' => 'RECOMPILE_STYLES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
'load_tplcompile' => array('lang' => 'RECOMPILE_STYLES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||||
'allow_cdn' => array('lang' => 'ALLOW_CDN', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
'allow_cdn' => array('lang' => 'ALLOW_CDN', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||||
|
'enable_accurate_pm_button' => array('lang' => 'YES_ACCURATE_PM_BUTTON', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||||
'allow_live_searches' => array('lang' => 'ALLOW_LIVE_SEARCHES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
'allow_live_searches' => array('lang' => 'ALLOW_LIVE_SEARCHES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||||
|
|
||||||
'legend3' => 'CUSTOM_PROFILE_FIELDS',
|
'legend3' => 'CUSTOM_PROFILE_FIELDS',
|
||||||
|
|
|
@ -106,6 +106,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_enable', '1'
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_force_sender', '0');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_force_sender', '0');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_max_chunk_size', '50');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_max_chunk_size', '50');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_package_size', '20');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_package_size', '20');
|
||||||
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_accurate_pm_button', '1');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_confirm', '1');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_confirm', '1');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_mod_rewrite', '0');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_mod_rewrite', '0');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_board_notifications', '1');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_board_notifications', '1');
|
||||||
|
|
|
@ -406,6 +406,8 @@ $lang = array_merge($lang, array(
|
||||||
'RECOMPILE_STYLES_EXPLAIN' => 'Check for updated style components on filesystem and recompile.',
|
'RECOMPILE_STYLES_EXPLAIN' => 'Check for updated style components on filesystem and recompile.',
|
||||||
'YES_ANON_READ_MARKING' => 'Enable topic marking for guests',
|
'YES_ANON_READ_MARKING' => 'Enable topic marking for guests',
|
||||||
'YES_ANON_READ_MARKING_EXPLAIN' => 'Stores read/unread status information for guests. If disabled, posts are always marked read for guests.',
|
'YES_ANON_READ_MARKING_EXPLAIN' => 'Stores read/unread status information for guests. If disabled, posts are always marked read for guests.',
|
||||||
|
'YES_ACCURATE_PM_BUTTON' => 'Enable accurate PM indicator in topic pages',
|
||||||
|
'YES_ACCURATE_PM_BUTTON_EXPLAIN' => 'If this setting is enabled, only users who are permitted to read private messages will have a private message button.',
|
||||||
'YES_BIRTHDAYS' => 'Enable birthday listing',
|
'YES_BIRTHDAYS' => 'Enable birthday listing',
|
||||||
'YES_BIRTHDAYS_EXPLAIN' => 'If disabled the birthday listing is no longer displayed. To let this setting take effect the birthday feature needs to be enabled too.',
|
'YES_BIRTHDAYS_EXPLAIN' => 'If disabled the birthday listing is no longer displayed. To let this setting take effect the birthday feature needs to be enabled too.',
|
||||||
'YES_JUMPBOX' => 'Enable display of jumpbox',
|
'YES_JUMPBOX' => 'Enable display of jumpbox',
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* This file is part of the phpBB Forum Software package.
|
||||||
|
*
|
||||||
|
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
||||||
|
* @license GNU General Public License, version 2 (GPL-2.0)
|
||||||
|
*
|
||||||
|
* For full copyright and license information, please see
|
||||||
|
* the docs/CREDITS.txt file.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace phpbb\db\migration\data\v32x;
|
||||||
|
|
||||||
|
class enable_accurate_pm_button extends \phpbb\db\migration\migration
|
||||||
|
{
|
||||||
|
static public function depends_on()
|
||||||
|
{
|
||||||
|
return array(
|
||||||
|
'\phpbb\db\migration\data\v32x\v322',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function effectively_installed()
|
||||||
|
{
|
||||||
|
return isset($this->config['enable_accurate_pm_button']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function update_data()
|
||||||
|
{
|
||||||
|
return array(
|
||||||
|
array('config.add', array('enable_accurate_pm_button', '1')),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1576,12 +1576,20 @@ if (count($attach_list))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($config['enable_accurate_pm_button'])
|
||||||
|
{
|
||||||
// Get the list of users who can receive private messages
|
// Get the list of users who can receive private messages
|
||||||
$can_receive_pm_list = $auth->acl_get_list(array_keys($user_cache), 'u_readpm');
|
$can_receive_pm_list = $auth->acl_get_list(array_keys($user_cache), 'u_readpm');
|
||||||
$can_receive_pm_list = (empty($can_receive_pm_list) || !isset($can_receive_pm_list[0]['u_readpm'])) ? array() : $can_receive_pm_list[0]['u_readpm'];
|
$can_receive_pm_list = (empty($can_receive_pm_list) || !isset($can_receive_pm_list[0]['u_readpm'])) ? array() : $can_receive_pm_list[0]['u_readpm'];
|
||||||
|
|
||||||
// Get the list of permanently banned users
|
// Get the list of permanently banned users
|
||||||
$permanently_banned_users = phpbb_get_banned_user_ids(array_keys($user_cache), false);
|
$permanently_banned_users = phpbb_get_banned_user_ids(array_keys($user_cache), false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$can_receive_pm_list = array_keys($user_cache);
|
||||||
|
$permanently_banned_users = [];
|
||||||
|
}
|
||||||
|
|
||||||
$i_total = count($rowset) - 1;
|
$i_total = count($rowset) - 1;
|
||||||
$prev_post_id = '';
|
$prev_post_id = '';
|
||||||
|
|
Loading…
Add table
Reference in a new issue