issue #101: adding test feature for Pushover

This commit is contained in:
Pepijn Over 2014-07-31 16:08:26 +02:00
parent 4d92e9c0c1
commit 5c605ddcb2
15 changed files with 221 additions and 99 deletions

View File

@ -195,8 +195,10 @@ $sm_lang = array(
'sms_gateway_username' => 'Потребител',
'sms_gateway_password' => 'Парола',
'sms_from' => 'Номер на изпращача',
'pushover_status' => 'Allow sending pushover messages',
'pushover_status' => 'Allow sending Pushover messages',
'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See <a href="https://pushover.net/">their website</a> for more info.',
'pushover_api_token' => 'Pushover App API Token',
'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.',
'alert_type' => 'Изберете кога желаете да получавате известия<br/>',
'alert_type_description' => '<b>Промяна на сатуса:</b><br>'.
'Ще получавате известие когато има промяна със връзката на даден някой от описаните сървър или сайт. От Онлайн -> Офлайн и от Офлайн -> Онлайн.<br/>'.
@ -215,7 +217,6 @@ $sm_lang = array(
'log_sms' => 'Да се пази ли лог на изпратените SMS съобщения от системата',
'log_pushover' => 'Log pushover messages sent by the script',
'updated' => 'Настройките са обновени успешно.',
'nochanges' => 'Не бяха направени промени!',
'tab_email' => 'Имейл',
'tab_sms' => 'SMS',
'tab_pushover' => 'Pushover',
@ -234,13 +235,19 @@ $sm_lang = array(
'test' => 'Тест',
'test_email' => 'Ще бъде изпратенo тестово съобщение до имейл адреса, който сте задали в профила си.',
'test_sms' => 'Ще бъде изпратен тестово SMS съобщение до телефонния номер, който сте задали в профила си.',
'test_pushover' => 'A Pushover notification will be sent to the user key/device specified in your user profile.',
'send' => 'Изпрати',
'test_subject' => 'Test',
'test_message' => 'Тестово съобщение',
'email_sent' => 'Тестовия имейл е изпратен успешно.',
'email_error' => 'Възникна грешка при изпращането на тесовия имейл',
'sms_sent' => 'Тестовото SMS съобщение е изпратеното успешно.',
'sms_error' => 'Възникна грешка при изпращането на тестовия SMS',
'sms_error_nomobile' => 'Unable to send test SMS: no valid phone number found in your profile.',
'pushover_sent' => 'Pushover notification sent',
'pushover_error' => 'An error has occurred while sending the Pushover notification: %s',
'pushover_error_noapp' => 'Unable to send test notification: no Pushover App API token found in the global configuration.',
'pushover_error_nokey' => 'Unable to send test notification: no Pushover key found in your profile.',
),
// За нов ред в имейл съобщението, моля използвайте тага <br/>
'notifications' => array(

View File

@ -195,8 +195,10 @@ $sm_lang = array(
'sms_gateway_username' => 'Gateway brugernavn/apikey',
'sms_gateway_password' => 'Gateway adgangskode',
'sms_from' => 'Afsenders navn.',
'pushover_status' => 'Allow sending pushover messages',
'pushover_status' => 'Allow sending Pushover messages',
'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See <a href="https://pushover.net/">their website</a> for more info.',
'pushover_api_token' => 'Pushover App API Token',
'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.',
'alert_type' => 'Vælg hvornår du vil modtage besked.<br/>',
'alert_type_description' => '<b>Status ændring:</b> '.
'Du vil modtage en notifcation når en server har en ændring i status. Fra online -> offline eller offline -> online.<br/>'.
@ -215,7 +217,6 @@ $sm_lang = array(
'log_sms' => 'Log SMS sendt af systemet',
'log_pushover' => 'Log pushover messages sent by the script',
'updated' => 'Indstillingerne er blevet opdateret.',
'nochanges' => 'The configuration didn\'t change.',
'tab_email' => 'Email',
'tab_sms' => 'SMS',
'tab_pushover' => 'Pushover',
@ -234,13 +235,19 @@ $sm_lang = array(
'test' => 'Test',
'test_email' => 'En email vil blive sendt til den adresse, der er angivet i din brugerprofil.',
'test_sms' => 'En SMS vil blive sendt til det nummer, der er angivet i din brugerprofil.',
'test_pushover' => 'A Pushover notification will be sent to the user key/device specified in your user profile.',
'send' => 'Send',
'test_subject' => 'Test',
'test_message' => 'Test besked',
'email_sent' => 'Email sendt',
'email_error' => 'Fejl ved afsendelse af email',
'sms_sent' => 'Sms sendt',
'sms_error' => 'Fejl ved afsendelse af SMS',
'sms_error_nomobile' => 'Unable to send test SMS: no valid phone number found in your profile.',
'pushover_sent' => 'Pushover notification sent',
'pushover_error' => 'An error has occurred while sending the Pushover notification: %s',
'pushover_error_noapp' => 'Unable to send test notification: no Pushover App API token found in the global configuration.',
'pushover_error_nokey' => 'Unable to send test notification: no Pushover key found in your profile.',
),
// for newlines in the email messages use <br/>
'notifications' => array(

View File

@ -195,8 +195,10 @@ $sm_lang = array(
'sms_gateway_username' => 'Gateway Benutzername',
'sms_gateway_password' => 'Gateway Passwort',
'sms_from' => 'SMS Sendernummer',
'pushover_status' => 'Pushover Nachricht senden erlauben?',
'pushover_status' => 'Allow sending Pushover messages',
'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See <a href="https://pushover.net/">their website</a> for more info.',
'pushover_api_token' => 'Pushover App API Token',
'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.',
'alert_type' => 'Wann m&ouml;chten Sie benachrichtig werden?<br/>',
'alert_type_description' => '<b>Status ge&auml;ndert:</b> '.
'... wenn sich der Status &auml;ndert<br/>'.
@ -215,7 +217,6 @@ $sm_lang = array(
'log_sms' => 'SMS Log per Script senden?',
'log_pushover' => 'Pushover Log per Script senden?',
'updated' => 'Die Einstellungen wurden gespeichert.',
'nochanges' => 'The configuration didn\'t change.',
'tab_email' => 'Email',
'tab_sms' => 'SMS',
'tab_pushover' => 'Pushover',
@ -234,13 +235,19 @@ $sm_lang = array(
'test' => 'Test',
'test_email' => 'An email will be sent to the address specified in your user profile.',
'test_sms' => 'An SMS will be sent to the phone number specified in your user profile.',
'test_pushover' => 'A Pushover notification will be sent to the user key/device specified in your user profile.',
'send' => 'Send',
'test_subject' => 'Test',
'test_message' => 'Test message',
'email_sent' => 'Email sent',
'email_error' => 'Error in email sending',
'sms_sent' => 'Sms sent',
'sms_error' => 'Error in sms sending',
'sms_error_nomobile' => 'Unable to send test SMS: no valid phone number found in your profile.',
'pushover_sent' => 'Pushover notification sent',
'pushover_error' => 'An error has occurred while sending the Pushover notification: %s',
'pushover_error_noapp' => 'Unable to send test notification: no Pushover App API token found in the global configuration.',
'pushover_error_nokey' => 'Unable to send test notification: no Pushover key found in your profile.',
),
// for newlines in the email messages use <br/>
'notifications' => array(

View File

@ -195,8 +195,10 @@ $sm_lang = array(
'sms_gateway_username' => 'Gateway username',
'sms_gateway_password' => 'Gateway password',
'sms_from' => 'Sender\'s phone number',
'pushover_status' => 'Allow sending pushover messages',
'pushover_status' => 'Allow sending Pushover messages',
'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See <a href="https://pushover.net/">their website</a> for more info.',
'pushover_api_token' => 'Pushover App API Token',
'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.',
'alert_type' => 'Select when you\'d like to be notified.<br/>',
'alert_type_description' => '<b>Status change:</b> '.
'You will receive a notifcation when a server has a change in status. So from online -> offline or offline -> online.<br/>'.
@ -215,7 +217,6 @@ $sm_lang = array(
'log_sms' => 'Log text messages sent by the script',
'log_pushover' => 'Log pushover messages sent by the script',
'updated' => 'The configuration has been updated.',
'nochanges' => 'The configuration didn\'t change.',
'tab_email' => 'Email',
'tab_sms' => 'SMS',
'tab_pushover' => 'Pushover',
@ -234,13 +235,19 @@ $sm_lang = array(
'test' => 'Test',
'test_email' => 'An email will be sent to the address specified in your user profile.',
'test_sms' => 'An SMS will be sent to the phone number specified in your user profile.',
'test_pushover' => 'A Pushover notification will be sent to the user key/device specified in your user profile.',
'send' => 'Send',
'test_subject' => 'Test',
'test_message' => 'Test message',
'email_sent' => 'Email sent',
'email_error' => 'Error in email sending',
'sms_sent' => 'Sms sent',
'sms_error' => 'Error in sms sending',
'sms_error_nomobile' => 'Unable to send test SMS: no valid phone number found in your profile.',
'pushover_sent' => 'Pushover notification sent',
'pushover_error' => 'An error has occurred while sending the Pushover notification: %s',
'pushover_error_noapp' => 'Unable to send test notification: no Pushover App API token found in the global configuration.',
'pushover_error_nokey' => 'Unable to send test notification: no Pushover key found in your profile.',
),
// for newlines in the email messages use <br/>
'notifications' => array(

View File

@ -195,8 +195,10 @@ $sm_lang = array(
'sms_gateway_username' => 'Gateway username',
'sms_gateway_password' => 'Gateway password',
'sms_from' => 'Número origen del SMS',
'pushover_status' => 'Allow sending pushover messages',
'pushover_status' => 'Allow sending Pushover messages',
'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See <a href="https://pushover.net/">their website</a> for more info.',
'pushover_api_token' => 'Pushover App API Token',
'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.',
'alert_type' => 'Cuando desea recibir notificaciones ?<br/>',
'alert_type_description' => '<b>... Al cambiar el estado:</b> '.
'p.ej. online -> offline o offline -> online.<br/>'.
@ -215,7 +217,6 @@ $sm_lang = array(
'log_sms' => 'Enviar Log via SMS ?',
'log_pushover' => 'Log pushover messages sent by the script',
'updated' => 'Configuración guardada.',
'nochanges' => 'The configuration didn\'t change.',
'tab_email' => 'Email',
'tab_sms' => 'SMS',
'tab_pushover' => 'Pushover',
@ -234,13 +235,19 @@ $sm_lang = array(
'test' => 'Test',
'test_email' => 'An email will be sent to the address specified in your user profile.',
'test_sms' => 'An SMS will be sent to the phone number specified in your user profile.',
'test_pushover' => 'A Pushover notification will be sent to the user key/device specified in your user profile.',
'send' => 'Send',
'test_subject' => 'Test',
'test_message' => 'Test message',
'email_sent' => 'Email sent',
'email_error' => 'Error in email sending',
'sms_sent' => 'Sms sent',
'sms_error' => 'Error in sms sending',
'sms_error_nomobile' => 'Unable to send test SMS: no valid phone number found in your profile.',
'pushover_sent' => 'Pushover notification sent',
'pushover_error' => 'An error has occurred while sending the Pushover notification: %s',
'pushover_error_noapp' => 'Unable to send test notification: no Pushover App API token found in the global configuration.',
'pushover_error_nokey' => 'Unable to send test notification: no Pushover key found in your profile.',
),
// for newlines in the email messages use <br/>
'notifications' => array(

View File

@ -195,8 +195,10 @@ $sm_lang = array(
'sms_gateway_username' => 'Nom utilisateur de la passerelle',
'sms_gateway_password' => 'Mot de passe de la passerelle',
'sms_from' => 'SMS de l\'expéditeur',
'pushover_status' => 'Allow sending pushover messages',
'pushover_status' => 'Allow sending Pushover messages',
'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See <a href="https://pushover.net/">their website</a> for more info.',
'pushover_api_token' => 'Pushover App API Token',
'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.',
'alert_type' => 'Choisissez quand vous souhaitez être notifié.<br/>',
'alert_type_description' => '<b>Changement d\'état : </b>'.
'Vous recevez une notification chaque fois que le serveur change d\'état. C\'est-à-dire passe de l\'état OK à HORS SERVICE ou de HORS SERVICE à OK.<br/>'.
@ -215,7 +217,6 @@ $sm_lang = array(
'log_sms' => 'Enregistrer tout les SMS envoyés',
'log_pushover' => 'Log pushover messages sent by the script',
'updated' => 'La configuration a été mise à jour.',
'nochanges' => 'La configuration n\'a pas été modifiée.',
'tab_email' => 'Email',
'tab_sms' => 'SMS',
'tab_pushover' => 'Pushover',
@ -234,13 +235,19 @@ $sm_lang = array(
'test' => 'Tester',
'test_email' => 'Un email va vous être envoyé à l\'adresse définie dans votre profil utilisateur.',
'test_sms' => 'Un SMS va vous être envoyé au numéro défini dans votre profil utilisateur.',
'test_pushover' => 'A Pushover notification will be sent to the user key/device specified in your user profile.',
'send' => 'Envoyer',
'test_subject' => 'Test',
'test_message' => 'Message de test',
'email_sent' => 'Email envoyé',
'email_error' => 'Erreur lors de l\'envoie de l\'email',
'sms_sent' => 'Sms envoyé',
'sms_error' => 'Erreur lors de l\'envoie du sms',
'sms_error_nomobile' => 'Unable to send test SMS: no valid phone number found in your profile.',
'pushover_sent' => 'Pushover notification sent',
'pushover_error' => 'An error has occurred while sending the Pushover notification: %s',
'pushover_error_noapp' => 'Unable to send test notification: no Pushover App API token found in the global configuration.',
'pushover_error_nokey' => 'Unable to send test notification: no Pushover key found in your profile.',
),
// for newlines in the email messages use <br/>
'notifications' => array(

View File

@ -195,8 +195,10 @@ $sm_lang = array(
'sms_gateway_username' => 'Nome Utente Gateway',
'sms_gateway_password' => 'Password Gateway',
'sms_from' => 'Numero di telefono del mittente',
'pushover_status' => 'Allow sending pushover messages',
'pushover_status' => 'Allow sending Pushover messages',
'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See <a href="https://pushover.net/">their website</a> for more info.',
'pushover_api_token' => 'Pushover App API Token',
'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.',
'alert_type' => 'Seleziona quando vuoi essere notificato.<br/>',
'alert_type_description' => '<b>Cambio di Stato:</b> '.
'Riceverai una notifica solo quando un server cambierà stato. Quindi da online -> offline oppure da offline -> online.<br/>'.
@ -215,7 +217,6 @@ $sm_lang = array(
'log_sms' => 'Registra SMS inviati dallo script.',
'log_pushover' => 'Log pushover messages sent by the script',
'updated' => 'La configurazione è stato aggiornata.',
'nochanges' => 'The configuration didn\'t change.',
'tab_email' => 'Email',
'tab_sms' => 'SMS',
'tab_pushover' => 'Pushover',
@ -234,13 +235,19 @@ $sm_lang = array(
'test' => 'Test',
'test_email' => 'An email will be sent to the address specified in your user profile.',
'test_sms' => 'An SMS will be sent to the phone number specified in your user profile.',
'test_pushover' => 'A Pushover notification will be sent to the user key/device specified in your user profile.',
'send' => 'Send',
'test_subject' => 'Test',
'test_message' => 'Test message',
'email_sent' => 'Email sent',
'email_error' => 'Error in email sending',
'sms_sent' => 'Sms sent',
'sms_error' => 'Error in sms sending',
'sms_error_nomobile' => 'Unable to send test SMS: no valid phone number found in your profile.',
'pushover_sent' => 'Pushover notification sent',
'pushover_error' => 'An error has occurred while sending the Pushover notification: %s',
'pushover_error_noapp' => 'Unable to send test notification: no Pushover App API token found in the global configuration.',
'pushover_error_nokey' => 'Unable to send test notification: no Pushover key found in your profile.',
),
// for newlines in the email messages use <br/>
'notifications' => array(

View File

@ -195,8 +195,10 @@ $sm_lang = array(
'sms_gateway_username' => 'Gateway username',
'sms_gateway_password' => 'Gateway password',
'sms_from' => 'Sender\'s phone number',
'pushover_status' => 'Allow sending pushover messages',
'pushover_status' => 'Allow sending Pushover messages',
'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See <a href="https://pushover.net/">their website</a> for more info.',
'pushover_api_token' => 'Pushover App API Token',
'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.',
'alert_type' => '알림을 원하면 다음과 같이 변경하십시오..<br/>',
'alert_type_description' => '<b>상태 변경: </b><br/>'.
'서버 상태가 변경이되면 알림을 받습니다. online -> offline -> online.<br/>'.
@ -215,7 +217,6 @@ $sm_lang = array(
'log_sms' => 'SMS로 로그를 전송하시겠습니까?',
'log_pushover' => 'Log pushover messages sent by the script',
'updated' => '설정이 수정되었습니다.',
'nochanges' => 'The configuration didn\'t change.',
'tab_email' => 'Email',
'tab_sms' => 'SMS',
'tab_pushover' => 'Pushover',
@ -234,13 +235,19 @@ $sm_lang = array(
'test' => 'Test',
'test_email' => 'An email will be sent to the address specified in your user profile.',
'test_sms' => 'An SMS will be sent to the phone number specified in your user profile.',
'test_pushover' => 'A Pushover notification will be sent to the user key/device specified in your user profile.',
'send' => 'Send',
'test_subject' => 'Test',
'test_message' => 'Test message',
'email_sent' => 'Email sent',
'email_error' => 'Error in email sending',
'sms_sent' => 'Sms sent',
'sms_error' => 'Error in sms sending',
'sms_error_nomobile' => 'Unable to send test SMS: no valid phone number found in your profile.',
'pushover_sent' => 'Pushover notification sent',
'pushover_error' => 'An error has occurred while sending the Pushover notification: %s',
'pushover_error_noapp' => 'Unable to send test notification: no Pushover App API token found in the global configuration.',
'pushover_error_nokey' => 'Unable to send test notification: no Pushover key found in your profile.',
),
// for newlines in the email messages use <br/>
'notifications' => array(

View File

@ -195,8 +195,10 @@ $sm_lang = array(
'sms_gateway_username' => 'Gateway gebruikersnaam',
'sms_gateway_password' => 'Gateway wachtwoord',
'sms_from' => 'Telefoonnummer afzender',
'pushover_status' => 'Sta Pushover berichten toe?',
'pushover_status' => 'Allow sending Pushover messages',
'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See <a href="https://pushover.net/">their website</a> for more info.',
'pushover_api_token' => 'Pushover App API Token',
'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.',
'alert_type' => 'Selecteer wanneer je een notificatie wilt.<br/>',
'alert_type_description' => '<b>Status change:</b> '.
'Je ontvangt alleen bericht wanneer een server van status verandert. Dus van online -> offline of offline -> online.<br/>'.
@ -215,7 +217,6 @@ $sm_lang = array(
'log_sms' => 'Log sms berichten verstuurd bij het script?',
'log_pushover' => 'Log pushover messages sent by the script',
'updated' => 'De configuratie is gewijzigd.',
'nochanges' => 'De configuratie is ongewijzigd.',
'tab_email' => 'Email',
'tab_sms' => 'SMS',
'tab_pushover' => 'Pushover',
@ -234,13 +235,19 @@ $sm_lang = array(
'test' => 'Test',
'test_email' => 'Er zal een email verstuurd worden naar het email adres in je profiel.',
'test_sms' => 'Er zal een SMS verstuurd worden naar het telefoonnummer in je profiel.',
'test_pushover' => 'A Pushover notification will be sent to the user key/device specified in your user profile.',
'send' => 'Verstuur',
'test_subject' => 'Test',
'test_message' => 'Test bericht',
'email_sent' => 'Email verzonden',
'email_error' => 'Er is een fout opgetreden tijdens het verzenden',
'sms_sent' => 'SMS verzonden',
'sms_error' => 'Er is een fout opgetreden tijdens het verzenden',
'sms_error_nomobile' => 'Kan test SMS niet verzenden: er is geen telefoonnummer ingevuld in je profiel.',
'pushover_sent' => 'Pushover notification sent',
'pushover_error' => 'An error has occurred while sending the Pushover notification: %s',
'pushover_error_noapp' => 'Unable to send test notification: no Pushover App API token found in the global configuration.',
'pushover_error_nokey' => 'Unable to send test notification: no Pushover key found in your profile.',
),
// for newlines in the email messages use <br/>
'notifications' => array(

View File

@ -195,8 +195,10 @@ $sm_lang = array(
'sms_gateway_username' => 'Usuário do Gateway',
'sms_gateway_password' => 'Senha do Gateway',
'sms_from' => 'Número de telefone de envio',
'pushover_status' => 'Allow sending pushover messages',
'pushover_status' => 'Allow sending Pushover messages',
'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See <a href="https://pushover.net/">their website</a> for more info.',
'pushover_api_token' => 'Pushover App API Token',
'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.',
'alert_type' => 'Selecione como você gostaria de ser notificado.<br/>',
'alert_type_description' => '<b>Mudança de Status:</b> '.
'Você receberá uma notificação quando o seridor tive uma mudança de status. De online -> offline ou offline -> online.<br/>'.
@ -215,7 +217,6 @@ $sm_lang = array(
'log_sms' => 'Registrar no Log os envios de mensagens de texto feitos pelo script?',
'log_pushover' => 'Log pushover messages sent by the script',
'updated' => 'A configuração foi atualizada.',
'nochanges' => 'The configuration didn\'t change.',
'tab_email' => 'Email',
'tab_sms' => 'Texto',
'tab_pushover' => 'Pushover',
@ -234,13 +235,19 @@ $sm_lang = array(
'test' => 'Test',
'test_email' => 'An email will be sent to the address specified in your user profile.',
'test_sms' => 'An SMS will be sent to the phone number specified in your user profile.',
'test_pushover' => 'A Pushover notification will be sent to the user key/device specified in your user profile.',
'send' => 'Send',
'test_subject' => 'Test',
'test_message' => 'Test message',
'email_sent' => 'Email sent',
'email_error' => 'Error in email sending',
'sms_sent' => 'Sms sent',
'sms_error' => 'Error in sms sending',
'sms_error_nomobile' => 'Unable to send test SMS: no valid phone number found in your profile.',
'pushover_sent' => 'Pushover notification sent',
'pushover_error' => 'An error has occurred while sending the Pushover notification: %s',
'pushover_error_noapp' => 'Unable to send test notification: no Pushover App API token found in the global configuration.',
'pushover_error_nokey' => 'Unable to send test notification: no Pushover key found in your profile.',
),
// for newlines in the email messages use <br/>
'notifications' => array(

View File

@ -195,8 +195,10 @@ $sm_lang = array(
'sms_gateway_username' => 'Пользователь',
'sms_gateway_password' => 'Пароль',
'sms_from' => 'Номер отправителя',
'pushover_status' => 'Allow sending pushover messages',
'pushover_status' => 'Allow sending Pushover messages',
'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See <a href="https://pushover.net/">their website</a> for more info.',
'pushover_api_token' => 'Pushover App API Token',
'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.',
'alert_type' => 'Выбирите, какие вы хотите получать уведомления<br/>',
'alert_type_description' => '<b>Изменение статуса :</b> '.
'Вы получите уведомление об изменение статуса. Для онлайн -> оффлайн или офлайн -> онлайн.<br/>'.
@ -215,7 +217,6 @@ $sm_lang = array(
'log_sms' => 'Уведомления отправленые по Email',
'log_pushover' => 'Log pushover messages sent by the script',
'updated' => 'Параметры были успешно применены.',
'nochanges' => 'Параметры не изменились.',
'tab_email' => 'Email',
'tab_sms' => 'SMS',
'tab_pushover' => 'Pushover',
@ -234,13 +235,19 @@ $sm_lang = array(
'test' => 'Тест',
'test_email' => 'Сообщение будет отправлено на адрес указаный в профиле пользователя.',
'test_sms' => 'Сообщение будет отправлено на номер телефона указаный в профиле пользователя.',
'test_pushover' => 'A Pushover notification will be sent to the user key/device specified in your user profile.',
'send' => 'Отправить',
'test_subject' => 'Test',
'test_message' => 'Тестовое сообщение',
'email_sent' => 'Email отправлен',
'email_error' => 'Ошибка при отправке email',
'sms_sent' => 'Sms отправлено',
'sms_error' => 'Ошибка при отправке sms',
'sms_error_nomobile' => 'Unable to send test SMS: no valid phone number found in your profile.',
'pushover_sent' => 'Pushover notification sent',
'pushover_error' => 'An error has occurred while sending the Pushover notification: %s',
'pushover_error_noapp' => 'Unable to send test notification: no Pushover App API token found in the global configuration.',
'pushover_error_nokey' => 'Unable to send test notification: no Pushover key found in your profile.',
),
// for newlines in the email messages use <br/>
'notifications' => array(
@ -278,4 +285,8 @@ $sm_lang = array(
'success_password_forgot' => 'Вам был отправлен email, с описанием сброса пароля.',
'success_password_reset' => 'Ваш пароль был сброшен. Пожалуйста авторизуйтесь.',
),
'error' => array(
'401_unauthorized' => 'Unauthorized',
'401_unauthorized_description' => 'You do not have the privileges to view this page.',
),
);

View File

@ -195,8 +195,10 @@ $sm_lang = array(
'sms_gateway_username' => 'SMS网关用户名',
'sms_gateway_password' => 'SMS网关密码',
'sms_from' => '发信人电话号',
'pushover_status' => 'Allow sending pushover messages',
'pushover_status' => 'Allow sending Pushover messages',
'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See <a href="https://pushover.net/">their website</a> for more info.',
'pushover_api_token' => 'Pushover App API Token',
'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.',
'alert_type' => '如果想要收到提醒请选中此项.<br/>',
'alert_type_description' => '<b>状态变化:</b> '.
'服务器 online -> offline 或 offline -> online 的状态变化将会收到提醒.<br/>'.
@ -215,7 +217,6 @@ $sm_lang = array(
'log_sms' => '记录脚本所发短信SMS?',
'log_pushover' => 'Log pushover messages sent by the script',
'updated' => '设置已更新.',
'nochanges' => 'The configuration didn\'t change.',
'tab_email' => '邮件发送设置',
'tab_sms' => '短信发送设置',
'tab_pushover' => 'Pushover',
@ -234,13 +235,19 @@ $sm_lang = array(
'test' => 'Test',
'test_email' => 'An email will be sent to the address specified in your user profile.',
'test_sms' => 'An SMS will be sent to the phone number specified in your user profile.',
'test_pushover' => 'A Pushover notification will be sent to the user key/device specified in your user profile.',
'send' => 'Send',
'test_subject' => 'Test',
'test_message' => 'Test message',
'email_sent' => 'Email sent',
'email_error' => 'Error in email sending',
'sms_sent' => 'Sms sent',
'sms_error' => 'Error in sms sending',
'sms_error_nomobile' => 'Unable to send test SMS: no valid phone number found in your profile.',
'pushover_sent' => 'Pushover notification sent',
'pushover_error' => 'An error has occurred while sending the Pushover notification: %s',
'pushover_error_noapp' => 'Unable to send test notification: no Pushover App API token found in the global configuration.',
'pushover_error_nokey' => 'Unable to send test notification: no Pushover key found in your profile.',
),
// for newlines in the email messages use <br/>
'notifications' => array(

View File

@ -124,17 +124,14 @@ class ConfigController extends AbstractController {
$tpl_data[$this->default_tab . '_active'] = 'active';
$modal = new \psm\Util\Module\Modal($this->tpl, 'testEmail', \psm\Util\Module\Modal::MODAL_TYPE_OKCANCEL);
$this->addModal($modal);
$modal->setTitle(psm_get_lang('servers', 'send_email'));
$modal->setMessage(psm_get_lang('config', 'test_email'));
$modal->setOKButtonLabel(psm_get_lang('config', 'send'));
$modal = new \psm\Util\Module\Modal($this->tpl, 'testSMS', \psm\Util\Module\Modal::MODAL_TYPE_OKCANCEL);
$this->addModal($modal);
$modal->setTitle(psm_get_lang('servers', 'send_sms'));
$modal->setMessage(psm_get_lang('config', 'test_sms'));
$modal->setOKButtonLabel(psm_get_lang('config', 'send'));
$testmodals = array('email', 'sms', 'pushover');
foreach($testmodals as $modal_id) {
$modal = new \psm\Util\Module\Modal($this->tpl, 'test' . ucfirst($modal_id), \psm\Util\Module\Modal::MODAL_TYPE_OKCANCEL);
$this->addModal($modal);
$modal->setTitle(psm_get_lang('servers', 'send_' . $modal_id));
$modal->setMessage(psm_get_lang('config', 'test_' . $modal_id));
$modal->setOKButtonLabel(psm_get_lang('config', 'send'));
}
$this->tpl->addTemplateData($this->getTemplateId(), $tpl_data);
}
@ -160,73 +157,21 @@ class ConfigController extends AbstractController {
$clean[$input_key] = $_POST[$input_key];
}
}
// save all values to the database
$changed = false;
$language_refresh = ($clean['language'] != psm_get_conf('language'));
foreach($clean as $key => $value) {
// check if key already exists, otherwise add it
$old_value = psm_get_conf($key);
if($old_value === null) {
// not yet set, add it
$this->db->save(
PSM_DB_PREFIX . 'config',
array(
'key' => $key,
'value' => $value,
)
);
$changed = true;
} else if($value != $old_value) {
// update
$this->db->save(
PSM_DB_PREFIX . 'config',
array('value' => $value),
array('key' => $key)
);
$changed = true;
}
}
if($changed) {
$this->addMessage(psm_get_lang('config', 'updated'), 'success');
} else {
$this->addMessage(psm_get_lang('config', 'nochanges'));
psm_update_conf($key, $value);
}
$this->addMessage(psm_get_lang('config', 'updated'), 'success');
if(!empty($_POST['test_email'])) {
// build mail object
$mail = psm_build_mail();
$message = psm_get_lang('config', 'test_message');
$mail->Subject = $message;
$mail->Priority = 1;
$mail->Body = $message;
$mail->AltBody = str_replace('<br/>', "\n", $message);
$user = $this->user->getUser();
$mail->AddAddress($user->email, $user->name);
if($mail->Send()) {
$this->addMessage(psm_get_lang('config', 'email_sent'), 'success');
} else {
$this->addMessage(psm_get_lang('config', 'email_error') . ': ' . $mail->ErrorInfo, 'error');
}
$this->testEmail();
} elseif(!empty($_POST['test_sms'])) {
// build sms object
$sms = psm_build_sms();
if($sms) {
$user = $this->user->getUser();
if(empty($user->mobile)) {
$this->addMessage(psm_get_lang('config', 'sms_error_nomobile'), 'error');
} else {
$sms->addRecipients($user->mobile);
if($sms->sendSMS(psm_get_lang('config', 'test_message'))) {
$this->addMessage(psm_get_lang('config', 'sms_sent'), 'success');
} else {
$this->addMessage(psm_get_lang('config', 'sms_error'), 'error');
}
}
}
$this->testSMS();
} elseif(!empty($_POST['test_pushover'])) {
$this->testPushover();
}
if($clean['language'] != psm_get_conf('language')) {
if($language_refresh) {
header('Location: ' . psm_build_url(array('mod' => 'config'), true, false));
die();
}
@ -237,13 +182,94 @@ class ConfigController extends AbstractController {
$this->default_tab = 'email';
} elseif(isset($_POST['sms_submit']) || !empty($_POST['test_sms'])) {
$this->default_tab = 'sms';
} elseif(isset($_POST['pushover_submit'])) {
} elseif(isset($_POST['pushover_submit']) || !empty($_POST['test_pushover'])) {
$this->default_tab = 'pushover';
}
}
$this->initializeAction('index');
}
/**
* Execute email test
*
* @todo move test to separate class
*/
protected function testEmail() {
$mail = psm_build_mail();
$message = psm_get_lang('config', 'test_message');
$mail->Subject = psm_get_lang('config', 'test_subject');
$mail->Priority = 1;
$mail->Body = $message;
$mail->AltBody = str_replace('<br/>', "\n", $message);
$user = $this->user->getUser();
$mail->AddAddress($user->email, $user->name);
if($mail->Send()) {
$this->addMessage(psm_get_lang('config', 'email_sent'), 'success');
} else {
$this->addMessage(psm_get_lang('config', 'email_error') . ': ' . $mail->ErrorInfo, 'error');
}
}
/**
* Execute SMS test
*
* @todo move test to separate class
*/
protected function testSMS() {
$sms = psm_build_sms();
if($sms) {
$user = $this->user->getUser();
if(empty($user->mobile)) {
$this->addMessage(psm_get_lang('config', 'sms_error_nomobile'), 'error');
} else {
$sms->addRecipients($user->mobile);
if($sms->sendSMS(psm_get_lang('config', 'test_message'))) {
$this->addMessage(psm_get_lang('config', 'sms_sent'), 'success');
} else {
$this->addMessage(psm_get_lang('config', 'sms_error'), 'error');
}
}
}
}
/**
* Execute pushover test
*
* @todo move test to separate class
*/
protected function testPushover() {
$pushover = psm_build_pushover();
$pushover->setDebug(true);
$user = $this->user->getUser();
$api_token = psm_get_conf('pushover_api_token');
if(empty($api_token)) {
$this->addMessage(psm_get_lang('config', 'pushover_error_noapp'), 'error');
} elseif(empty($user->pushover_key)) {
$this->addMessage(psm_get_lang('config', 'pushover_error_nokey'), 'error');
} else {
$pushover->setPriority(0);
$pushover->setTitle(psm_get_lang('config', 'test_subject'));
$pushover->setMessage(psm_get_lang('config', 'test_message'));
$pushover->setUser($user->pushover_key);
if($user->pushover_device != '') {
$pushover->setDevice($user->pushover_device);
}
$result = $pushover->send();
if(isset($result['output']->status) && $result['output']->status == 1) {
$this->addMessage(psm_get_lang('config', 'pushover_sent'), 'success');
} else {
if(isset($result['output']->errors->error)) {
$error = $result['output']->errors->error;
} else {
$error = 'Unknown';
}
$this->addMessage(sprintf(psm_get_lang('config', 'pushover_error'), $error), 'error');
}
}
}
// override parent::createHTMLLabels()
protected function createHTMLLabels() {
$this->tpl->addTemplateData(
@ -283,8 +309,10 @@ class ConfigController extends AbstractController {
'label_sms_gateway_username' => psm_get_lang('config', 'sms_gateway_username'),
'label_sms_gateway_password' => psm_get_lang('config', 'sms_gateway_password'),
'label_sms_from' => psm_get_lang('config', 'sms_from'),
'label_pushover_description' => psm_get_lang('config', 'pushover_description'),
'label_pushover_status' => psm_get_lang('config', 'pushover_status'),
'label_pushover_api_token' => psm_get_lang('config', 'pushover_api_token'),
'label_pushover_api_token_description' => psm_get_lang('config', 'pushover_api_token_description'),
'label_alert_type' => psm_get_lang('config', 'alert_type'),
'label_alert_type_description' => psm_get_lang('config', 'alert_type_description'),
'label_alert_type_status' => psm_get_lang('config', 'alert_type_status'),

View File

@ -241,8 +241,6 @@ class StatusNotifier {
$pushover->setRetry(300); //Used with Priority = 2; Pushover will resend the notification every 60 seconds until the user accepts.
$pushover->setExpire(3600); //Used with Priority = 2; Pushover will resend the notification every 60 seconds for 3600 seconds. After that point, it stops sending notifications.
}
$pushover->setTimestamp(time());
$message = psm_parse_msg($this->status_new, 'pushover_message', $this->server);
$pushover->setTitle(psm_parse_msg($this->status_new, 'pushover_title', $this->server));

View File

@ -169,7 +169,7 @@
</div>
<div class="control-group">
<div class="controls">
<button class="btn btn-primary show-modal" data-modal-id="testSMS">{label_test}</button>
<button class="btn btn-primary show-modal" data-modal-id="testSms">{label_test}</button>
<input type="hidden" name="test_sms" value="0" />
</div>
</div>
@ -184,6 +184,7 @@
<div class="control-group">
<div class="controls">
<label class="checkbox" for="pushover_status"><input type="checkbox" id="pushover_status" name="pushover_status[]" {pushover_status_checked} /> {label_pushover_status}</label>
<p class="help-block">{label_pushover_description}</p>
</div>
</div>
<div class="control-group">
@ -195,8 +196,15 @@
<label class="control-label" for="pushover_api">{label_pushover_api_token}</label>
<div class="controls">
<input type="text" id="pushover_api_token" name="pushover_api_token" value="{pushover_api_token}" maxlength="255" />
<p class="help-block">{label_pushover_api_token_description}</p>
</div>
</div>
<div class="control-group">
<div class="controls">
<button class="btn btn-primary show-modal" data-modal-id="testPushover">{label_test}</button>
<input type="hidden" name="test_pushover" value="0" />
</div>
</div>
<div class="form-actions">
<button class="btn btn-success" type="submit" name="pushover_submit">{label_save}</button>
</div>