From 30178ee443f46110c934b353e7e02d6678c2f851 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 13 Apr 2025 16:16:31 +0200 Subject: [PATCH] [ticket/17493] Start removing jabber from acp PHPBB-17493 --- phpBB/adm/style/acp_jabber.html | 83 ------------ phpBB/adm/style/acp_users_prefs.html | 6 - phpBB/adm/style/acp_users_profile.html | 4 - phpBB/includes/acp/acp_email.php | 6 +- phpBB/includes/acp/acp_inactive.php | 2 +- phpBB/includes/acp/acp_jabber.php | 139 -------------------- phpBB/includes/acp/acp_users.php | 7 - phpBB/includes/acp/info/acp_jabber.php | 34 ----- phpBB/language/en/acp/board.php | 28 ---- phpBB/language/en/acp/common.php | 8 -- phpBB/language/en/acp/permissions_phpbb.php | 1 - 11 files changed, 4 insertions(+), 314 deletions(-) delete mode 100644 phpBB/adm/style/acp_jabber.html delete mode 100644 phpBB/includes/acp/acp_jabber.php delete mode 100644 phpBB/includes/acp/info/acp_jabber.php diff --git a/phpBB/adm/style/acp_jabber.html b/phpBB/adm/style/acp_jabber.html deleted file mode 100644 index 5267062106..0000000000 --- a/phpBB/adm/style/acp_jabber.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - -

{L_ACP_JABBER_SETTINGS}

- -

{L_ACP_JABBER_SETTINGS_EXPLAIN}

- - -
-

{L_WARNING}

-

{WARNING_MSG}

-
- - -
- -
- {L_ACP_JABBER_SETTINGS} - -

{L_JAB_GTALK_NOTE}

- -
-

{L_JAB_ENABLE_EXPLAIN}
-
-
-
-
-

{L_JAB_SERVER_EXPLAIN}
-
-
-
-

{L_JAB_PORT_EXPLAIN}
-
-
-
-

{L_JAB_USERNAME_EXPLAIN}
-
-
-
-

{L_JAB_PASSWORD_EXPLAIN}
-
-
- -
-

{L_JAB_USE_SSL_EXPLAIN}
-
-
-
-
-

{L_JAB_VERIFY_PEER_EXPLAIN}
-
-
-
-
-

{L_JAB_VERIFY_PEER_NAME_EXPLAIN}
-
-
-
-
-

{L_JAB_ALLOW_SELF_SIGNED_EXPLAIN}
-
-
-
- -
-

{L_JAB_PACKAGE_SIZE_EXPLAIN}
-
-
- -
- -
- {L_ACP_SUBMIT_CHANGES} -

-   - -

- {S_FORM_TOKEN} -
-
- - diff --git a/phpBB/adm/style/acp_users_prefs.html b/phpBB/adm/style/acp_users_prefs.html index d485d1e113..7dbef95974 100644 --- a/phpBB/adm/style/acp_users_prefs.html +++ b/phpBB/adm/style/acp_users_prefs.html @@ -29,12 +29,6 @@
-
-

{L_NOTIFY_METHOD_EXPLAIN}
-
- -
-
diff --git a/phpBB/adm/style/acp_users_profile.html b/phpBB/adm/style/acp_users_profile.html index 9296638ff6..54f7245f81 100644 --- a/phpBB/adm/style/acp_users_profile.html +++ b/phpBB/adm/style/acp_users_profile.html @@ -3,10 +3,6 @@
{L_USER_PROFILE} -
-
-
-

{L_BIRTHDAY_EXPLAIN}
{L_DAY}{L_COLON} {L_MONTH}{L_COLON} {L_YEAR}{L_COLON}
diff --git a/phpBB/includes/acp/acp_email.php b/phpBB/includes/acp/acp_email.php index dfe58eb318..dc62e385cd 100644 --- a/phpBB/includes/acp/acp_email.php +++ b/phpBB/includes/acp/acp_email.php @@ -76,7 +76,7 @@ class acp_email { // If giving usernames the admin is able to email inactive users too... $sql_ary = array( - 'SELECT' => 'user_id, username, user_email, user_jabber, user_notify_type, user_lang', + 'SELECT' => 'user_id, username, user_email, user_notify_type, user_lang', 'FROM' => array( USERS_TABLE => '', ), @@ -90,7 +90,7 @@ class acp_email if ($group_id) { $sql_ary = array( - 'SELECT' => 'u.user_id, u.user_email, u.username, u.username_clean, u.user_lang, u.user_jabber, u.user_notify_type', + 'SELECT' => 'u.user_id, u.user_email, u.username, u.username_clean, u.user_lang, u.user_notify_type', 'FROM' => array( USERS_TABLE => 'u', USER_GROUP_TABLE => 'ug', @@ -106,7 +106,7 @@ class acp_email else { $sql_ary = array( - 'SELECT' => 'u.user_id, u.username, u.username_clean, u.user_email, u.user_jabber, u.user_lang, u.user_notify_type', + 'SELECT' => 'u.user_id, u.username, u.username_clean, u.user_email, u.user_lang, u.user_notify_type', 'FROM' => array( USERS_TABLE => 'u', ), diff --git a/phpBB/includes/acp/acp_inactive.php b/phpBB/includes/acp/acp_inactive.php index e1a511852b..138e06e525 100644 --- a/phpBB/includes/acp/acp_inactive.php +++ b/phpBB/includes/acp/acp_inactive.php @@ -185,7 +185,7 @@ class acp_inactive trigger_error($user->lang['EMAIL_DISABLED'] . adm_back_link($this->u_action), E_USER_WARNING); } - $sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type, user_regdate, user_actkey + $sql = 'SELECT user_id, username, user_email, user_lang, user_notify_type, user_regdate, user_actkey FROM ' . USERS_TABLE . ' WHERE ' . $db->sql_in_set('user_id', $mark) . ' AND user_inactive_reason'; diff --git a/phpBB/includes/acp/acp_jabber.php b/phpBB/includes/acp/acp_jabber.php deleted file mode 100644 index fce1dee1df..0000000000 --- a/phpBB/includes/acp/acp_jabber.php +++ /dev/null @@ -1,139 +0,0 @@ - -* @license GNU General Public License, version 2 (GPL-2.0) -* -* For full copyright and license information, please see -* the docs/CREDITS.txt file. -* -*/ - -/** -* @todo Check/enter/update transport info -*/ - -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - -class acp_jabber -{ - var $u_action; - - function main($id, $mode) - { - global $db, $user, $template, $phpbb_log, $request; - global $config, $phpbb_container, $phpbb_root_path, $phpEx; - - $jabber = $phpbb_container->get('messenger.method.jabber'); - - $user->add_lang('acp/board'); - - $submit = (isset($_POST['submit'])) ? true : false; - - if ($mode != 'settings') - { - return; - } - - $this->tpl_name = 'acp_jabber'; - $this->page_title = 'ACP_JABBER_SETTINGS'; - - $jab_enable = $request->variable('jab_enable', (bool) $config['jab_enable']); - $jab_host = $request->variable('jab_host', (string) $config['jab_host']); - $jab_port = $request->variable('jab_port', (int) $config['jab_port']); - $jab_username = $request->variable('jab_username', (string) $config['jab_username']); - $jab_password = $request->variable('jab_password', (string) $config['jab_password']); - $jab_package_size = $request->variable('jab_package_size', (int) $config['jab_package_size']); - $jab_use_ssl = $request->variable('jab_use_ssl', (bool) $config['jab_use_ssl']); - $jab_verify_peer = $request->variable('jab_verify_peer', (bool) $config['jab_verify_peer']); - $jab_verify_peer_name = $request->variable('jab_verify_peer_name', (bool) $config['jab_verify_peer_name']); - $jab_allow_self_signed = $request->variable('jab_allow_self_signed', (bool) $config['jab_allow_self_signed']); - - $form_name = 'acp_jabber'; - add_form_key($form_name); - - if ($submit) - { - if (!check_form_key($form_name)) - { - trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING); - } - - $message = $user->lang['JAB_SETTINGS_CHANGED']; - $log = 'JAB_SETTINGS_CHANGED'; - - // Is this feature enabled? Then try to establish a connection - if ($jabber->is_enabled()) - { - if (!$jabber->connect()) - { - trigger_error($user->lang['ERR_JAB_CONNECT'] . '

' . $jabber->get_log() . adm_back_link($this->u_action), E_USER_WARNING); - } - - // We'll try to authorise using this account - if (!$jabber->login()) - { - trigger_error($user->lang['ERR_JAB_AUTH'] . '

' . $jabber->get_log() . adm_back_link($this->u_action), E_USER_WARNING); - } - - $jabber->disconnect(); - } - else - { - // This feature is disabled. - // We update the user table to be sure all users that have IM as notify type are set to both as notify type - // We set this to both because users still have their jabber address entered and may want to receive jabber notifications again once it is re-enabled. - $sql_ary = array( - 'user_notify_type' => $jabber::NOTIFY_BOTH, - ); - - $sql = 'UPDATE ' . USERS_TABLE . ' - SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' - WHERE user_notify_type = ' . $jabber::NOTIFY_IM; - $db->sql_query($sql); - } - - $config->set('jab_enable', $jab_enable); - $config->set('jab_host', $jab_host); - $config->set('jab_port', $jab_port); - $config->set('jab_username', $jab_username); - if ($jab_password !== '********') - { - $config->set('jab_password', $jab_password); - } - $config->set('jab_package_size', $jab_package_size); - $config->set('jab_use_ssl', $jab_use_ssl); - $config->set('jab_verify_peer', $jab_verify_peer); - $config->set('jab_verify_peer_name', $jab_verify_peer_name); - $config->set('jab_allow_self_signed', $jab_allow_self_signed); - - $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_' . $log); - trigger_error($message . adm_back_link($this->u_action)); - } - - $template->assign_vars(array( - 'U_ACTION' => $this->u_action, - 'JAB_ENABLE' => $jab_enable, - 'L_JAB_SERVER_EXPLAIN' => sprintf($user->lang['JAB_SERVER_EXPLAIN'], '', ''), - 'JAB_HOST' => $jab_host, - 'JAB_PORT' => ($jab_port) ? $jab_port : '', - 'JAB_USERNAME' => $jab_username, - 'JAB_PASSWORD' => $jab_password !== '' ? '********' : '', - 'JAB_PACKAGE_SIZE' => $jab_package_size, - 'JAB_USE_SSL' => $jab_use_ssl, - 'JAB_VERIFY_PEER' => $jab_verify_peer, - 'JAB_VERIFY_PEER_NAME' => $jab_verify_peer_name, - 'JAB_ALLOW_SELF_SIGNED' => $jab_allow_self_signed, - 'S_CAN_USE_SSL' => $jabber::can_use_ssl(), - 'S_GTALK_NOTE' => (!@function_exists('dns_get_record')) ? true : false, - )); - } -} diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index a954ec09f0..e01eace64e 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1426,7 +1426,6 @@ class acp_users $user_row['iso_lang_id'] = $row['lang_id']; $data = array( - 'jabber' => $request->variable('jabber', $user_row['user_jabber'], true), 'bday_day' => 0, 'bday_month' => 0, 'bday_year' => 0, @@ -1458,9 +1457,6 @@ class acp_users if ($submit) { $error = validate_data($data, array( - 'jabber' => array( - array('string', true, 5, 255), - array('jabber')), 'bday_day' => array('num', true, 1, 31), 'bday_month' => array('num', true, 1, 12), 'bday_year' => array('num', true, 1901, gmdate('Y', time())), @@ -1496,7 +1492,6 @@ class acp_users if (!count($error)) { $sql_ary = array( - 'user_jabber' => $data['jabber'], 'user_birthday' => $data['user_birthday'], ); @@ -1553,7 +1548,6 @@ class acp_users unset($now); $template->assign_vars(array( - 'JABBER' => $data['jabber'], 'S_BIRTHDAY_DAY_OPTIONS' => $s_birthday_day_options, 'S_BIRTHDAY_MONTH_OPTIONS' => $s_birthday_month_options, 'S_BIRTHDAY_YEAR_OPTIONS' => $s_birthday_year_options, @@ -1787,7 +1781,6 @@ class acp_users $user_prefs_data = array( 'S_PREFS' => true, - 'S_JABBER_DISABLED' => ($config['jab_enable'] && $user_row['user_jabber'] && @extension_loaded('xml')) ? false : true, 'VIEW_EMAIL' => $data['viewemail'], 'MASS_EMAIL' => $data['massemail'], diff --git a/phpBB/includes/acp/info/acp_jabber.php b/phpBB/includes/acp/info/acp_jabber.php deleted file mode 100644 index 660299a12d..0000000000 --- a/phpBB/includes/acp/info/acp_jabber.php +++ /dev/null @@ -1,34 +0,0 @@ - -* @license GNU General Public License, version 2 (GPL-2.0) -* -* For full copyright and license information, please see -* the docs/CREDITS.txt file. -* -*/ - -class acp_jabber_info -{ - function module() - { - return array( - 'filename' => 'acp_jabber', - 'title' => 'ACP_JABBER_SETTINGS', - 'modes' => array( - 'settings' => array('title' => 'ACP_JABBER_SETTINGS', 'auth' => 'acl_a_jabber', 'cat' => array('ACP_CLIENT_COMMUNICATION')), - ), - ); - } - - function install() - { - } - - function uninstall() - { - } -} diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index e46091c954..4bdaa12796 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -586,31 +586,3 @@ $lang = array_merge($lang, [ 'WEBPUSH_DROPDOWN_SUBSCRIBE' => 'Show “Subscribe” button in notification dropdown', 'WEBPUSH_DROPDOWN_SUBSCRIBE_EXPLAIN' => 'Display a “Subscribe” button in the Notification dropdown, allowing users to easily subscribe to push notifications from anywhere in the forum.', ]); - -// Jabber settings -$lang = array_merge($lang, array( - 'ACP_JABBER_SETTINGS_EXPLAIN' => 'Here you can enable and control the use of Jabber for instant messaging and board notifications. Jabber is an open source protocol and therefore available for use by anyone. Some Jabber servers include gateways or transports which allow you to contact users on other networks. Not all servers offer all transports and changes in protocols can prevent transports from operating. Please be sure to enter already registered account details - phpBB will use the details you enter here as is.', - - 'JAB_ALLOW_SELF_SIGNED' => 'Allow self-signed SSL certificates', - 'JAB_ALLOW_SELF_SIGNED_EXPLAIN' => 'Allow connections to Jabber server with self-signed SSL certificate.
Warning: Allowing self-signed SSL certificates may cause security implications.', - 'JAB_ENABLE' => 'Enable Jabber', - 'JAB_ENABLE_EXPLAIN' => 'Enables use of Jabber messaging and notifications.', - 'JAB_GTALK_NOTE' => 'Please note that GTalk will not work because the dns_get_record function could not be found. This function is not available in PHP4, and is not implemented on Windows platforms. It currently does not work on BSD-based systems, including Mac OS.', - 'JAB_PACKAGE_SIZE' => 'Jabber package size', - 'JAB_PACKAGE_SIZE_EXPLAIN' => 'This is the number of messages sent in one package. If set to 0 the message is sent immediately and will not be queued for later sending.', - 'JAB_PASSWORD' => 'Jabber password', - 'JAB_PASSWORD_EXPLAIN' => 'Warning: This password will be stored as plain text in the database, visible to everybody who can access your database or who can view this configuration page.', - 'JAB_PORT' => 'Jabber port', - 'JAB_PORT_EXPLAIN' => 'Leave blank unless you know it is not port 5222.', - 'JAB_SERVER' => 'Jabber server', - 'JAB_SERVER_EXPLAIN' => 'See %sjabber.org%s for a list of servers.', - 'JAB_SETTINGS_CHANGED' => 'Jabber settings changed successfully.', - 'JAB_USE_SSL' => 'Use SSL to connect', - 'JAB_USE_SSL_EXPLAIN' => 'If enabled a secure connection is tried to be established. The Jabber port will be modified to 5223 if port 5222 is specified.', - 'JAB_USERNAME' => 'Jabber username or JID', - 'JAB_USERNAME_EXPLAIN' => 'Specify a registered username or a valid JID. The username will not be checked for validity. If you only specify a username, then your JID will be the username and the server you specified above. Else, specify a valid JID, for example user@jabber.org.', - 'JAB_VERIFY_PEER' => 'Verify SSL certificate', - 'JAB_VERIFY_PEER_EXPLAIN' => 'Require verification of SSL certificate used by Jabber server.
Warning: Connecting peers with unverified SSL certificates may cause security implications.', - 'JAB_VERIFY_PEER_NAME' => 'Verify Jabber peer name', - 'JAB_VERIFY_PEER_NAME_EXPLAIN' => 'Require verification of peer name for Jabber servers using SSL / TLS connections.
Warning: Connecting to unverified peers may cause security implications.', -)); diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index 62c08f0226..e2bbef019e 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -120,8 +120,6 @@ $lang = array_merge($lang, array( 'ACP_INACTIVE_USERS' => 'Inactive users', 'ACP_INDEX' => 'ACP index', - 'ACP_JABBER_SETTINGS' => 'Jabber settings', - 'ACP_LANGUAGE' => 'Language management', 'ACP_LANGUAGE_PACKS' => 'Language packs', 'ACP_LOAD_SETTINGS' => 'Load settings', @@ -642,7 +640,6 @@ $lang = array_merge($lang, array( 'LOG_DOWNLOAD_IP' => 'Added IP/hostname to download list
» %s', 'LOG_DOWNLOAD_REMOVE_IP' => 'Removed IP/hostname from download list
» %s', - 'LOG_ERROR_JABBER' => 'Jabber error
» %s', 'LOG_ERROR_EMAIL' => 'Email error
» %s', 'LOG_ERROR_CAPTCHA' => 'CAPTCHA error
» %s', @@ -686,11 +683,6 @@ $lang = array_merge($lang, array( 'LOG_IP_BROWSER_FORWARDED_CHECK' => 'Session IP/browser/X_FORWARDED_FOR check failed
»User IP “%1$s” checked against session IP “%2$s”, user browser string “%3$s” checked against session browser string “%4$s” and user X_FORWARDED_FOR string “%5$s” checked against session X_FORWARDED_FOR string “%6$s”.', - 'LOG_JAB_CHANGED' => 'Jabber account changed', - 'LOG_JAB_PASSCHG' => 'Jabber password changed', - 'LOG_JAB_REGISTER' => 'Jabber account registered', - 'LOG_JAB_SETTINGS_CHANGED' => 'Jabber settings changed', - 'LOG_LANGUAGE_PACK_DELETED' => 'Deleted language pack
» %s', 'LOG_LANGUAGE_PACK_INSTALLED' => 'Installed language pack
» %s', 'LOG_LANGUAGE_PACK_UPDATED' => 'Updated language pack details
» %s', diff --git a/phpBB/language/en/acp/permissions_phpbb.php b/phpBB/language/en/acp/permissions_phpbb.php index 590ccaaf9f..516e811768 100644 --- a/phpBB/language/en/acp/permissions_phpbb.php +++ b/phpBB/language/en/acp/permissions_phpbb.php @@ -168,7 +168,6 @@ $lang = array_merge($lang, array( $lang = array_merge($lang, array( 'ACL_A_BOARD' => 'Can alter board settings/check for updates', 'ACL_A_SERVER' => 'Can alter server/communication settings', - 'ACL_A_JABBER' => 'Can alter Jabber settings', 'ACL_A_PHPINFO' => 'Can view php settings', 'ACL_A_FORUM' => 'Can manage forums',