Verzeichnisstruktur phpBB-3.2.0


Veröffentlicht
06.01.2017

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

acp_jabber.php

Zuletzt modifiziert: 09.10.2024, 12:52 - Dateigröße: 4.00 KiB


001  <?php
002  /**
003  *
004  * This file is part of the phpBB Forum Software package.
005  *
006  * @copyright (c) phpBB Limited <https://www.phpbb.com>
007  * @license GNU General Public License, version 2 (GPL-2.0)
008  *
009  * For full copyright and license information, please see
010  * the docs/CREDITS.txt file.
011  *
012  */
013   
014  /**
015  * @todo Check/enter/update transport info
016  */
017   
018  /**
019  * @ignore
020  */
021  if (!defined('IN_PHPBB'))
022  {
023      exit;
024  }
025   
026  class acp_jabber
027  {
028      var $u_action;
029   
030      function main($id, $mode)
031      {
032          global $db, $user, $template, $phpbb_log, $request;
033          global $config, $phpbb_root_path, $phpEx;
034   
035          $user->add_lang('acp/board');
036   
037          if (!class_exists('jabber'))
038          {
039              include($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);
040          }
041   
042          $submit = (isset($_POST['submit'])) ? true : false;
043   
044          if ($mode != 'settings')
045          {
046              return;
047          }
048   
049          $this->tpl_name = 'acp_jabber';
050          $this->page_title = 'ACP_JABBER_SETTINGS';
051   
052          $jab_enable            = $request->variable('jab_enable',            (bool) $config['jab_enable']);
053          $jab_host            = $request->variable('jab_host',            (string) $config['jab_host']);
054          $jab_port            = $request->variable('jab_port',            (int) $config['jab_port']);
055          $jab_username        = $request->variable('jab_username',        (string) $config['jab_username']);
056          $jab_password        = $request->variable('jab_password',        (string) $config['jab_password']);
057          $jab_package_size    = $request->variable('jab_package_size',    (int) $config['jab_package_size']);
058          $jab_use_ssl        = $request->variable('jab_use_ssl',        (bool) $config['jab_use_ssl']);
059   
060          $form_name = 'acp_jabber';
061          add_form_key($form_name);
062   
063          if ($submit)
064          {
065              if (!check_form_key($form_name))
066              {
067                  trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING);
068              }
069   
070              $message = $user->lang['JAB_SETTINGS_CHANGED'];
071              $log = 'JAB_SETTINGS_CHANGED';
072   
073              // Is this feature enabled? Then try to establish a connection
074              if ($jab_enable)
075              {
076                  $jabber = new jabber($jab_host, $jab_port, $jab_username, $jab_password, $jab_use_ssl);
077   
078                  if (!$jabber->connect())
079                  {
080                      trigger_error($user->lang['ERR_JAB_CONNECT'] . '<br /><br />' . $jabber->get_log() . adm_back_link($this->u_action), E_USER_WARNING);
081                  }
082   
083                  // We'll try to authorise using this account
084                  if (!$jabber->login())
085                  {
086                      trigger_error($user->lang['ERR_JAB_AUTH'] . '<br /><br />' . $jabber->get_log() . adm_back_link($this->u_action), E_USER_WARNING);
087                  }
088   
089                  $jabber->disconnect();
090              }
091              else
092              {
093                  // This feature is disabled.
094                  // We update the user table to be sure all users that have IM as notify type are set to both as notify type
095                  // 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.
096                  $sql_ary = array(
097                      'user_notify_type'        => NOTIFY_BOTH,
098                  );
099   
100                  $sql = 'UPDATE ' . USERS_TABLE . '
101                      SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
102                      WHERE user_notify_type = ' . NOTIFY_IM;
103                  $db->sql_query($sql);
104              }
105   
106              $config->set('jab_enable', $jab_enable);
107              $config->set('jab_host', $jab_host);
108              $config->set('jab_port', $jab_port);
109              $config->set('jab_username', $jab_username);
110              if ($jab_password !== '********')
111              {
112                  $config->set('jab_password', $jab_password);
113              }
114              $config->set('jab_package_size', $jab_package_size);
115              $config->set('jab_use_ssl', $jab_use_ssl);
116   
117              $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_' . $log);
118              trigger_error($message . adm_back_link($this->u_action));
119          }
120   
121          $template->assign_vars(array(
122              'U_ACTION'                => $this->u_action,
123              'JAB_ENABLE'            => $jab_enable,
124              'L_JAB_SERVER_EXPLAIN'    => sprintf($user->lang['JAB_SERVER_EXPLAIN'], '<a href="http://www.jabber.org/">', '</a>'),
125              'JAB_HOST'                => $jab_host,
126              'JAB_PORT'                => ($jab_port) ? $jab_port : '',
127              'JAB_USERNAME'            => $jab_username,
128              'JAB_PASSWORD'            => $jab_password !== '' ? '********' : '',
129              'JAB_PACKAGE_SIZE'        => $jab_package_size,
130              'JAB_USE_SSL'            => $jab_use_ssl,
131              'S_CAN_USE_SSL'            => jabber::can_use_ssl(),
132              'S_GTALK_NOTE'            => (!@function_exists('dns_get_record')) ? true : false,
133          ));
134      }
135  }
136