[ Index ]

PHP Cross Reference of phpBB-3.1.12-deutsch

title

Body

[close]

/phpbb/notification/method/ -> jabber.php (source)

   1  <?php
   2  /**
   3  *
   4  * This file is part of the phpBB Forum Software package.
   5  *
   6  * @copyright (c) phpBB Limited <https://www.phpbb.com>
   7  * @license GNU General Public License, version 2 (GPL-2.0)
   8  *
   9  * 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      /**
  24      * Get notification method name
  25      *
  26      * @return string
  27      */
  28  	public function get_type()
  29      {
  30          return 'notification.method.jabber';
  31      }
  32  
  33      /**
  34      * Is this method available for the user?
  35      * This is checked on the notifications options
  36      */
  37  	public function is_available()
  38      {
  39          return ($this->global_available() && $this->user->data['user_jabber']);
  40      }
  41  
  42      /**
  43      * Is this method available at all?
  44      * This is checked before notifications are sent
  45      */
  46  	public function global_available()
  47      {
  48          return !(
  49              empty($this->config['jab_enable']) ||
  50              empty($this->config['jab_host']) ||
  51              empty($this->config['jab_username']) ||
  52              empty($this->config['jab_password']) ||
  53              !@extension_loaded('xml')
  54          );
  55      }
  56  
  57  	public function notify()
  58      {
  59          if (!$this->global_available())
  60          {
  61              return;
  62          }
  63  
  64          return $this->notify_using_messenger(NOTIFY_IM, 'short/');
  65      }
  66  }


Generated: Thu Jan 11 00:25:41 2018 Cross-referenced by PHPXref 0.7.1