5
* @version $Id: acp_jabber.php,v 1.25 2007/10/05 14:36:32 acydburn Exp $
6
* @copyright (c) 2005 phpBB Group
7
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
9
* @todo Check/enter/update transport info
15
if (!defined('IN_PHPBB'))
27
function main($id, $mode)
29
global $db, $user, $auth, $template;
30
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
32
$user->add_lang('acp/board');
34
include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);
36
$action = request_var('action', '');
37
$submit = (isset($_POST['submit'])) ? true : false;
39
if ($mode != 'settings')
44
$this->tpl_name = 'acp_jabber';
45
$this->page_title = 'ACP_JABBER_SETTINGS';
47
$jab_enable = request_var('jab_enable', $config['jab_enable']);
48
$jab_host = request_var('jab_host', $config['jab_host']);
49
$jab_port = request_var('jab_port', $config['jab_port']);
50
$jab_username = request_var('jab_username', $config['jab_username']);
51
$jab_password = request_var('jab_password', $config['jab_password']);
52
$jab_package_size = request_var('jab_package_size', $config['jab_package_size']);
53
$jab_use_ssl = request_var('jab_use_ssl', $config['jab_use_ssl']);
55
$form_name = 'acp_jabber';
56
add_form_key($form_name);
60
if (!check_form_key($form_name))
62
trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING);
67
$message = $user->lang['JAB_SETTINGS_CHANGED'];
68
$log = 'JAB_SETTINGS_CHANGED';
70
// Is this feature enabled? Then try to establish a connection
73
$jabber = new jabber($jab_host, $jab_port, $jab_username, $jab_password, $jab_use_ssl);
75
if (!$jabber->connect())
77
trigger_error($user->lang['ERR_JAB_CONNECT'] . '<br /><br />' . $jabber->get_log() . adm_back_link($this->u_action), E_USER_WARNING);
80
// We'll try to authorise using this account
81
if (!$jabber->login())
83
trigger_error($user->lang['ERR_JAB_AUTH'] . '<br /><br />' . $jabber->get_log() . adm_back_link($this->u_action), E_USER_WARNING);
86
$jabber->disconnect();
89
set_config('jab_enable', $jab_enable);
90
set_config('jab_host', $jab_host);
91
set_config('jab_port', $jab_port);
92
set_config('jab_username', $jab_username);
93
set_config('jab_password', $jab_password);
94
set_config('jab_package_size', $jab_package_size);
95
set_config('jab_use_ssl', $jab_use_ssl);
97
add_log('admin', 'LOG_' . $log);
98
trigger_error($message . adm_back_link($this->u_action));
101
$template->assign_vars(array(
102
'U_ACTION' => $this->u_action,
103
'JAB_ENABLE' => $jab_enable,
104
'L_JAB_SERVER_EXPLAIN' => sprintf($user->lang['JAB_SERVER_EXPLAIN'], '<a href="http://www.jabber.org/">', '</a>'),
105
'JAB_HOST' => $jab_host,
106
'JAB_PORT' => $jab_port,
107
'JAB_USERNAME' => $jab_username,
108
'JAB_PASSWORD' => $jab_password,
109
'JAB_PACKAGE_SIZE' => $jab_package_size,
110
'JAB_USE_SSL' => $jab_use_ssl,
111
'S_CAN_USE_SSL' => jabber::can_use_ssl(),
112
'S_GTALK_NOTE' => (!@function_exists('dns_get_record')) ? true : false,
b'\\ No newline at end of file'