diff --git a/src/includes/functions.inc.php b/src/includes/functions.inc.php
index bd1a659a..f197b864 100644
--- a/src/includes/functions.inc.php
+++ b/src/includes/functions.inc.php
@@ -34,7 +34,7 @@ namespace {
#
###############################################
- /**
+/**
* Retrieve language settings from the selected language file
* Return false if arg is not found
*
@@ -641,57 +641,56 @@ namespace {
return $telegram;
}
- /**
- * Send message via XMPP.
- *
- * @param string $host
- * @param string $username
- * @param string $password
- * @param string $receiver
- * @param string $message
- * @param int|null $port
- * @param string|null $domain
- */
+ /**
+ * Send message via XMPP.
+ *
+ * @param string $host
+ * @param string $username
+ * @param string $password
+ * @param string $receiver
+ * @param string $message
+ * @param int|null $port
+ * @param string|null $domain
+ */
function psm_jabber_send_message($host, $username, $password, $receiver, $message, $port = null, $domain = null)
{
- $options = [
- 'jid' => $username, // incl. gmail.com
- 'pass' => $password,
- 'domain' => $domain, // gmail.com or null
- 'host' => $host, // talk.google.com
- 'port' => $port, // talk.google.com needs to have 5223 ... 5222 - CN problem - gmail.com vs talk.google.com
- 'log_path' => __DIR__ . '/../../logs/jaxl.log', // own log
+ $options = [
+ 'jid' => $username, // incl. gmail.com
+ 'pass' => $password,
+ 'domain' => $domain, // gmail.com or null
+ 'host' => $host, // talk.google.com
+ 'port' => $port, // talk.google.com needs to have 5223 ... 5222 - CN problem - gmail.com vs talk.google.com
+ 'log_path' => __DIR__ . '/../../logs/jaxl.log', // own log
- // force tls
- 'force_tls' => PSM_JABBER_FORCE_TLS,
- // (required) perform X-OAUTH2
- 'auth_type' => PSM_JABBER_AUTH_TYPE, //'X-OAUTH2', // auth failure with this option :( so just PLAIN ...
+ // force tls
+ 'force_tls' => PSM_JABBER_FORCE_TLS,
+ // (required) perform X-OAUTH2
+ 'auth_type' => PSM_JABBER_AUTH_TYPE, //'X-OAUTH2', // auth failure with this option :( so just PLAIN ...
- 'log_level' => PSM_JABBER_DEBUG_LEVEL
- ];
+ 'log_level' => PSM_JABBER_DEBUG_LEVEL
+ ];
- try {
- $client = new JAXL($options);
+ try {
+ $client = new JAXL($options);
- // Add Callbacks
- $client->add_cb('on_auth_success', function () use ($client, $receiver, $message) {
- JAXLLogger::info('got on_auth_success cb');
- $client->send_chat_msg($receiver, $message);
- $client->send_end_stream();
+ // Add Callbacks
+ $client->add_cb('on_auth_success', function () use ($client, $receiver, $message) {
+ JAXLLogger::info('got on_auth_success cb');
+ $client->send_chat_msg($receiver, $message);
+ $client->send_end_stream();
+ });
+ $client->add_cb('on_auth_failure', function ($reason) use ($client) {
+ $client->send_end_stream();
+ JAXLLogger::info('got on_auth_failure cb with reason: ' . $reason);
+ });
+ $client->add_cb('on_disconnect', function () use ($client) {
+ JAXLLogger::info('got on_disconnect cb');
+ });
- });
- $client->add_cb('on_auth_failure', function ($reason) use ($client) {
- $client->send_end_stream();
- JAXLLogger::info('got on_auth_failure cb with reason: ' . $reason);
- });
- $client->add_cb('on_disconnect', function () use ($client) {
- JAXLLogger::info('got on_disconnect cb');
- });
-
- $client->start();
- } catch (Exception $ex) {
- JAXLLogger::error('Exception: ' . $ex->getMessage());
- }
+ $client->start();
+ } catch (Exception $ex) {
+ JAXLLogger::error('Exception: ' . $ex->getMessage());
+ }
}
/**
diff --git a/src/lang/en_US.lang.php b/src/lang/en_US.lang.php
index 9abf2bf1..ae358794 100644
--- a/src/lang/en_US.lang.php
+++ b/src/lang/en_US.lang.php
@@ -268,7 +268,7 @@ $sm_lang = array(
'warning_notifications_disabled_email' => 'Email notifications are disabled.',
'warning_notifications_disabled_pushover' => 'Pushover notifications are disabled.',
'warning_notifications_disabled_telegram' => 'Telegram notifications are disabled.',
- 'warning_notifications_disabled_jabber' => 'Jabber notifications are disabled.',
+ 'warning_notifications_disabled_jabber' => 'Jabber notifications are disabled.',
'error_server_no_match' => 'Server not found.',
'error_server_label_bad_length' => 'The label must be between 1 and 255 characters.',
'error_server_ip_bad_length' => 'The domain / IP must be between 1 and 255 characters.',
@@ -322,19 +322,19 @@ $sm_lang = array(
'telegram_api_token' => 'Telegram API Token',
'telegram_api_token_description' => 'Before you can use Telegram, you need to get a API token. Visit the documentation for help.',
- 'jabber_status' => 'Allow sending Jabber (XMPP) messages',
- 'jabber_description' => 'Visit the 'Allow sending Jabber (XMPP) messages',
+ 'jabber_description' => 'Visit the documentation for more info and an
install guide.',
- 'jabber_host' => 'Host',
- 'jabber_host_description' => 'Host of your Jabber account provider. For Google Account use talk.google.com.',
- 'jabber_port' => 'Port',
- 'jabber_port_description' => 'Port of your Jabber provider. Default 5222. For Google Account use 5223.',
- 'jabber_username' => 'Username',
- 'jabber_username_description' => 'For Google Account use incl. domain so for example example@google.com.',
- 'jabber_domain' => 'Domain',
- 'jabber_domain_description' => 'Domain of your Jabber provider. Left empty for Google Account.',
- 'jabber_password' => 'Password',
+ 'jabber_host' => 'Host',
+ 'jabber_host_description' => 'Host of your Jabber account provider. For Google Account use talk.google.com.',
+ 'jabber_port' => 'Port',
+ 'jabber_port_description' => 'Port of your Jabber provider. Default 5222. For Google Account use 5223.',
+ 'jabber_username' => 'Username',
+ 'jabber_username_description' => 'For Google Account use incl. domain so for example example@google.com.',
+ 'jabber_domain' => 'Domain',
+ 'jabber_domain_description' => 'Domain of your Jabber provider. Left empty for Google Account.',
+ 'jabber_password' => 'Password',
'jabber_password_description' => 'Fill only to set or change.',
'jabber_check' => 'Check your Jabber account if message was received.',
'alert_type' => 'Select when you\'d like to be notified.',
@@ -360,18 +360,18 @@ $sm_lang = array(
'log_sms' => 'Log text messages sent by the script',
'log_pushover' => 'Log pushover messages sent by the script',
'log_telegram' => 'Log Telegram messages sent by the script',
- 'log_jabber' => 'Log Jabber messages sent by the script',
+ 'log_jabber' => 'Log Jabber messages sent by the script',
'updated' => 'The configuration has been updated.',
'tab_email' => 'Email',
'tab_sms' => 'SMS',
'tab_pushover' => 'Pushover',
'tab_telegram' => 'Telegram',
- 'tab_jabber' => 'Jabber',
+ 'tab_jabber' => 'Jabber',
'settings_email' => 'Email settings',
'settings_sms' => 'Text message settings',
'settings_pushover' => 'Pushover settings',
'settings_telegram' => 'Telegram settings',
- 'settings_jabber' => 'Jabber settings',
+ 'settings_jabber' => 'Jabber settings',
'settings_notification' => 'Notification settings',
'settings_log' => 'Log settings',
'settings_proxy' => 'Proxy settings',
@@ -385,7 +385,7 @@ $sm_lang = array(
'test_pushover' => 'A Pushover notification will be sent to the user key/device specified in your user
profile.',
'test_telegram' => 'A Telegram notification will be sent to the chat id specified in your user profile.',
- 'test_jabber' => 'A Jabber notification will be sent to the jabber account specified in your user profile.',
+ 'test_jabber' => 'A Jabber notification will be sent to the jabber account specified in your user profile.',
'send' => 'Send',
'test_subject' => 'Test',
'test_message' => 'Test message',
@@ -404,11 +404,11 @@ $sm_lang = array(
'telegram_error_notoken' => 'Unable to send test notification: no Telegram API token found in the global
configuration.',
'telegram_error_noid' => 'Unable to send test notification: no chat id found in your profile.',
- 'jabber_sent' => 'Telegram notification sent',
- 'jabber_error' => 'An error has occurred while sending the Telegram notification: %s',
- 'jabber_error_noconfig' => 'Unable to send test notification: no Jabber account set in the global
+ 'jabber_sent' => 'Telegram notification sent',
+ 'jabber_error' => 'An error has occurred while sending the Telegram notification: %s',
+ 'jabber_error_noconfig' => 'Unable to send test notification: no Jabber account set in the global
configuration.',
- 'jabber_error_noaccount' => 'Unable to send test notification: no Jabber account found in your profile.',
+ 'jabber_error_noaccount' => 'Unable to send test notification: no Jabber account found in your profile.',
'log_retention_period' => 'Log retention period',
'log_retention_period_description' => 'Number of days to keep logs of notifications and archives of server
uptime. Enter 0 to disable log cleanup.',
@@ -424,7 +424,7 @@ $sm_lang = array(
%IP%
Port: %PORT%
Error: %ERROR%
Date: %DATE%',
'off_telegram_message' => 'Failed to connect to the following server:
Server: %LABEL%
IP:
%IP%
Port: %PORT%
Error: %ERROR%
Date: %DATE%',
- 'off_jabber_message' => 'Failed to connect to the following server:
Server: %LABEL%
IP:
+ 'off_jabber_message' => 'Failed to connect to the following server:
Server: %LABEL%
IP:
%IP%
Port: %PORT%
Error: %ERROR%
Date: %DATE%',
'on_sms' => 'Server \'%LABEL%\' is RUNNING: ip=%IP%, port=%PORT%, it was down for %LAST_OFFLINE_DURATION%',
'on_email_subject' => 'IMPORTANT: Server \'%LABEL%\' is RUNNING',
@@ -438,7 +438,7 @@ $sm_lang = array(
'on_telegram_message' => 'Server \'%LABEL%\' is running again, it was down for:
%LAST_OFFLINE_DURATION%
Server: %LABEL%
IP: %IP%
Port: %PORT%
Date:
%DATE%',
- 'on_jabber_message' => 'Server \'%LABEL%\' is running again, it was down for:
+ 'on_jabber_message' => 'Server \'%LABEL%\' is running again, it was down for:
%LAST_OFFLINE_DURATION%
Server: %LABEL%
IP: %IP%
Port: %PORT%
Date:
%DATE%',
'combi_off_email_message' => '