1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/17493] Start removing jabber from acp

PHPBB-17493
This commit is contained in:
Marc Alexander
2025-04-13 16:16:31 +02:00
parent 8c6731ffb9
commit 30178ee443
11 changed files with 4 additions and 314 deletions

View File

@@ -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',
),

View File

@@ -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';

View File

@@ -1,139 +0,0 @@
<?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.
*
*/
/**
* @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'] . '<br /><br />' . $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'] . '<br /><br />' . $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'], '<a href="http://www.jabber.org/">', '</a>'),
'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,
));
}
}

View File

@@ -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'],

View File

@@ -1,34 +0,0 @@
<?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.
*
*/
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()
{
}
}