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

jabber.php

Zuletzt modifiziert: 09.10.2024, 12:54 - Dateigröße: 1.87 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  /**
17  * Jabber notification method class
18  * This class handles sending Jabber messages for notifications
19  */
20   
21  class jabber extends \phpbb\notification\method\messenger_base
22  {
23      /** @var \phpbb\user */
24      protected $user;
25   
26      /** @var \phpbb\config\config */
27      protected $config;
28   
29      /**
30       * Notification Method jabber Constructor
31       *
32       * @param \phpbb\user_loader $user_loader
33       * @param \phpbb\user $user
34       * @param \phpbb\config\config $config
35       * @param string $phpbb_root_path
36       * @param string $php_ext
37       */
38      public function __construct(\phpbb\user_loader $user_loader, \phpbb\user $user, \phpbb\config\config $config, $phpbb_root_path, $php_ext)
39      {
40          parent::__construct($user_loader, $phpbb_root_path, $php_ext);
41   
42          $this->user = $user;
43          $this->config = $config;
44      }
45   
46      /**
47      * Get notification method name
48      *
49      * @return string
50      */
51      public function get_type()
52      {
53          return 'notification.method.jabber';
54      }
55   
56      /**
57      * Is this method available for the user?
58      * This is checked on the notifications options
59      */
60      public function is_available()
61      {
62          return ($this->global_available() && $this->user->data['user_jabber']);
63      }
64   
65      /**
66      * Is this method available at all?
67      * This is checked before notifications are sent
68      */
69      public function global_available()
70      {
71          return !(
72              empty($this->config['jab_enable']) ||
73              empty($this->config['jab_host']) ||
74              empty($this->config['jab_username']) ||
75              empty($this->config['jab_password']) ||
76              !@extension_loaded('xml')
77          );
78      }
79   
80      public function notify()
81      {
82          if (!$this->global_available())
83          {
84              return;
85          }
86   
87          $this->notify_using_messenger(NOTIFY_IM, 'short/');
88      }
89  }
90