Verzeichnisstruktur phpBB-3.3.16


Veröffentlicht
27.04.2026

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

jabber.php

Zuletzt modifiziert: 01.05.2026, 11:26 - Dateigröße: 2.21 KiB


 01  <?php
 02  /**
 03  *
 04  * This file is part of the phpBB Forum Software package.
 05  *
 06  * @copyright (c) phpBB Limited <https://www.phpbb.com>
 07  * @license GNU General Public License, version 2 (GPL-2.0)
 08  *
 09  * For full copyright and license information, please see
 10  * the docs/CREDITS.txt file.
 11  *
 12  */
 13   
 14  namespace phpbb\notification\method;
 15   
 16  use phpbb\notification\type\type_interface;
 17   
 18  /**
 19  * Jabber notification method class
 20  * This class handles sending Jabber messages for notifications
 21  */
 22   
 23  class jabber extends \phpbb\notification\method\messenger_base
 24  {
 25      /** @var \phpbb\user */
 26      protected $user;
 27   
 28      /** @var \phpbb\config\config */
 29      protected $config;
 30   
 31      /**
 32       * Notification Method jabber Constructor
 33       *
 34       * @param \phpbb\user_loader $user_loader
 35       * @param \phpbb\user $user
 36       * @param \phpbb\config\config $config
 37       * @param string $phpbb_root_path
 38       * @param string $php_ext
 39       */
 40      public function __construct(\phpbb\user_loader $user_loader, \phpbb\user $user, \phpbb\config\config $config, $phpbb_root_path, $php_ext)
 41      {
 42          parent::__construct($user_loader, $phpbb_root_path, $php_ext);
 43   
 44          $this->user = $user;
 45          $this->config = $config;
 46      }
 47   
 48      /**
 49      * Get notification method name
 50      *
 51      * @return string
 52      */
 53      public function get_type()
 54      {
 55          return 'notification.method.jabber';
 56      }
 57   
 58      /**
 59      * Is this method available for the user?
 60      * This is checked on the notifications options
 61      *
 62      * @param type_interface $notification_type    An optional instance of a notification type. If provided, this
 63      *                                            method additionally checks if the type provides an email template.
 64      * @return bool
 65      */
 66      public function is_available(type_interface $notification_type = null)
 67      {
 68          return parent::is_available($notification_type) && $this->global_available() && !empty($this->user->data['user_jabber']);
 69      }
 70   
 71      /**
 72      * Is this method available at all?
 73      * This is checked before notifications are sent
 74      */
 75      public function global_available()
 76      {
 77          return !(
 78              empty($this->config['jab_enable']) ||
 79              empty($this->config['jab_host']) ||
 80              empty($this->config['jab_username']) ||
 81              empty($this->config['jab_password']) ||
 82              !@extension_loaded('xml')
 83          );
 84      }
 85   
 86      public function notify()
 87      {
 88          if (!$this->global_available())
 89          {
 90              return;
 91          }
 92   
 93          $this->notify_using_messenger(NOTIFY_IM, 'short/');
 94      }
 95  }
 96