From 79ea63f164cb1e5a45431c5ba17f8e7c95f7d418 Mon Sep 17 00:00:00 2001 From: ansavin Date: Tue, 5 May 2020 21:12:42 +0300 Subject: [PATCH] [ticket/15591] Add jabber permission check We want to make jabber address unvisible for those users who are not allowed to send instant (jabber) messages. PHPBB3-15591 --- phpBB/includes/functions_display.php | 4 ++-- phpBB/memberlist.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 0f6efca34e..d077cd0ef7 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -1695,8 +1695,8 @@ function phpbb_show_profile($data, $user_notes_enabled = false, $warn_user_enabl 'U_EMAIL' => $email, 'U_JABBER' => ($data['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&action=jabber&u=' . $user_id) : '', - 'USER_JABBER' => ($config['jab_enable']) ? $data['user_jabber'] : '', - 'USER_JABBER_IMG' => ($config['jab_enable'] && $data['user_jabber']) ? $user->img('icon_contact_jabber', $data['user_jabber']) : '', + 'USER_JABBER' => ($config['jab_enable'] && $auth->acl_get('u_sendim')) ? $data['user_jabber'] : '', + 'USER_JABBER_IMG' => ($config['jab_enable'] && $auth->acl_get('u_sendim') && $data['user_jabber']) ? $user->img('icon_contact_jabber', $data['user_jabber']) : '', 'L_SEND_EMAIL_USER' => $user->lang('SEND_EMAIL_USER', $username), 'L_CONTACT_USER' => $user->lang('CONTACT_USER', $username), diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 1343bd7c60..ccdb7c887d 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -958,7 +958,7 @@ switch ($mode) $sort_key_text = array('a' => $user->lang['SORT_USERNAME'], 'c' => $user->lang['SORT_JOINED'], 'd' => $user->lang['SORT_POST_COUNT']); $sort_key_sql = array('a' => 'u.username_clean', 'c' => 'u.user_regdate', 'd' => 'u.user_posts'); - if ($config['jab_enable']) + if ($config['jab_enable'] && $auth->acl_get('u_sendim')) { $sort_key_text['k'] = $user->lang['JABBER']; $sort_key_sql['k'] = 'u.user_jabber';