Merge pull request #1 from phpservermon/develop

Sync with original dev.
This commit is contained in:
Petr Suchy 2020-02-10 08:11:29 +01:00 committed by GitHub
commit 39bd09958e
47 changed files with 239 additions and 172 deletions

View File

@ -23,8 +23,9 @@ A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- Version [e.g. 3.3.5, develop]
**Version (please complete the following information):**
- Version [e.g. 3.3.5]
- PHP [e.g. 7.3]
**Additional context**
Add any other context about the problem here.

View File

@ -2,7 +2,7 @@
name: Feature request
about: Suggest an idea for this project
title: "[Feature Request]"
labels: ''
labels: 'Type: Feature'
assignees: ''
---

View File

@ -2,7 +2,7 @@
name: Question
about: Ask your questions
title: "[Question] "
labels: ''
labels: 'Type: Question'
assignees: ''
---

0
Makefile Executable file → Normal file
View File

0
README.rst Executable file → Normal file
View File

0
composer.json Executable file → Normal file
View File

0
config.php.sample Executable file → Normal file
View File

0
manifest.json Executable file → Normal file
View File

0
phpservermon.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

0
service-worker.js Executable file → Normal file
View File

View File

@ -555,22 +555,31 @@ namespace {
// update last check date
psm_update_conf('last_update_check', time());
$latest = psm_curl_get(PSM_UPDATE_URL);
// extract latest version from Github.
preg_match('/"tag_name":"[v](([\d][.][\d][.][\d])(-?\w*))"/', $latest, $latest);
// add latest version to database
if (!empty($latest) && strlen($latest[2]) < 15) {
psm_update_conf('version_update_check', $latest[2]);
if ($latest['info'] === false || (int)$latest['info']['http_code'] >= 300) {
// error
return false;
}
// extract latest version from Github.
$githubInfo = json_decode($latest['exec']);
if (property_exists($githubInfo, 'tag_name') === false) {
// version not found
return false;
}
$tagName = $githubInfo->tag_name;
$latestVersion = str_replace('v', '', $tagName);
// check from old version ... maybe has reason but I don't think so ...
if (empty($latestVersion) === true || strlen($latestVersion) >= 15) {
// weird version
return false;
}
// add latest version to database
psm_update_conf('version_update_check', $latestVersion);
} else {
$latest[2] = psm_get_conf('version_update_check');
$latestVersion = psm_get_conf('version_update_check');
}
if (!empty($latest)) {
$current = psm_get_conf('version');
return version_compare($latest[2], $current, '>');
} else {
return false;
}
$current = psm_get_conf('version');
return version_compare($latestVersion, $current, '>');
}
/**
@ -595,7 +604,10 @@ namespace {
$phpmailer->SMTPSecure = psm_get_conf('email_smtp_security');
$smtp_user = psm_get_conf('email_smtp_username');
$smtp_pass = psm_get_conf('email_smtp_password');
$smtp_pass = psm_password_decrypt(
psm_get_conf('password_encrypt_key'),
psm_get_conf('email_smtp_password')
);
if ($smtp_user != '' && $smtp_pass != '') {
$phpmailer->SMTPAuth = true;

View File

@ -30,7 +30,7 @@
/**
* Current PSM version
*/
define('PSM_VERSION', '3.4.6-beta.1');
define('PSM_VERSION', '3.4.6-beta.2');
/**
* URL to check for updates. Will not be checked if turned off on config page.

View File

@ -99,8 +99,8 @@ $sm_lang = array(
'pushover' => 'Pushover',
'pushover_description' => 'Pushover е услуга, която улеснява получаването на
известия в реално време. Посетете <a
href="https://pushover.net/">техния сайт</a> за повече
информация.',
href="https://pushover.net/" target="_blank">техния сайт</a> за
повече информация.',
'pushover_key' => 'Pushover Ключ',
'pushover_device' => 'Pushover Устройство',
'pushover_device_description' => 'Име на устройство, което да получава
@ -232,8 +232,8 @@ $sm_lang = array(
'pushover_status' => 'Позволява изпращането на Pushover съобщения',
'pushover_description' => 'Pushover е услуга, която улеснява получаването на
известия в реално време. Посетете <a
href="https://pushover.net/">техния сайт</a> за повече
информация.',
href="https://pushover.net/" target="_blank">техния сайт</a> за
повече информация.',
'pushover_clone_app' => 'Кликнете тук за да създаване на вашият Pushover App',
'pushover_api_token' => 'Pushover App API Token',
'pushover_api_token_description' => 'Преди да използвате Pushover, трябва да <a

View File

@ -109,16 +109,17 @@ $sm_lang = array(
'email' => 'Correu',
'pushover' => 'Pushover',
'pushover_description' => 'Pushover és un servei que fa fàcil obtenir notificacions en temps real. Veieu <a
href="https://pushover.net/">la seva web</a> per a més informació.',
href="https://pushover.net/" target="_blank">la seva web</a> per a més
informació.',
'pushover_key' => 'Clau Pushover',
'pushover_device' => 'Dispositiu Pushover',
'pushover_device_description' => 'Nom del dispositiu al qual enviar els missatges. Deixau en blanc per enviar
a tots els dispositius.',
'telegram' => 'Telegram',
'telegram_description' => '<a href="https://telegram.org/">Telegram</a> és una app de missatgeria que
facilita el rebre notificacions en temps real. Consulteu la <a
href="http://docs.phpservermonitor.org/">documentació</a> per a més informació i
per saber com instal·lar-ho.',
'telegram_description' => '<a href="https://telegram.org/" target="_blank">Telegram</a> és una app de
missatgeria que facilita el rebre notificacions en temps real. Consulteu la <a
href="http://docs.phpservermonitor.org/" target="_blank">documentació</a> per a
més informació i per saber com instal·lar-ho.',
'telegram_chat_id' => 'Codi ID del xat a Telegram',
'telegram_chat_id_description' => 'Els missatges seran enviats al xat de Telegram amb aquest ID.',
'telegram_get_chat_id' => 'Premeu aquí per a obtenir el codi ID del vostre xat',
@ -298,15 +299,14 @@ $sm_lang = array(
target="_blank">registrar una app</a> al seu portal web i introduïr
aquí el Token de la API.',
'telegram_status' => 'Permetre l\'enviament de missatges per Telegram',
'telegram_description' => '<a href="https://telegram.org/">Telegram</a> és una app de xat (mòbil i PC) que
facilita la recepció de notificacions en temps real. Veieu la <a
href="http://docs.phpservermonitor.org/">documentació</a> per saber més i saber
com activar-ho.',
'telegram_description' => '<a href="https://telegram.org/" target="_blank">Telegram</a> és una app de xat
(mòbil i PC) que facilita la recepció de notificacions en temps real. Veieu la <a
href="http://docs.phpservermonitor.org/" target="_blank">documentació</a> per
saber més i saber com activar-ho.',
'telegram_api_token' => 'Token de l\'API de Telegram',
'telegram_api_token_description' => 'Abans de poder emprar Telegram necessiteu obtenir un token de l\'API.
Consulteu la <a
href="http://docs.phpservermonitor.org/">documentació</a> per saber
més.',
Consulteu la <a href="http://docs.phpservermonitor.org/"
target="_blank">documentació</a> per saber més.',
'alert_type' => 'Seleccioneu quan voleu ser notificats.',
'alert_type_description' => '<b>Canvi d\'estat:</b> Rebreu una notificació quan un servidor tingui un canvi
d\'estat. És a dir, passi d\'estar en línia a fora de línia o viceversa.<br

View File

@ -95,7 +95,7 @@ $sm_lang = array(
'email' => 'E-mail',
'pushover' => 'Pushover',
'pushover_description' => 'Pushover je služba umožňující jednoduše zasílat real-time upozornění.
Více na <a href="https://pushover.net/">webu Pushover</a>',
Více na <a href="https://pushover.net/" target="_blank">webu Pushover</a>',
'pushover_key' => 'Pushover Token',
'pushover_device' => 'Pushover Zařízení',
'pushover_device_description' => 'Název zařízení, na které být zráva odeslána. Ponechte prázdné
@ -227,7 +227,7 @@ $sm_lang = array(
'sms_from' => 'Telefonní číslo odesilatele',
'pushover_status' => 'Povolit zasílání Pushover zpráv',
'pushover_description' => 'Pushover je služba umožňující jednoduše zasílat real-time upozornění.
Více na <a href="https://pushover.net/">webu Pushover</a>',
Více na <a href="https://pushover.net/" target="_blank">webu Pushover</a>',
'pushover_clone_app' => 'Klikněte pro vytvoření Pushover aplikace',
'pushover_api_token' => 'Pushover App API Token',
'pushover_api_token_description' => 'Pře použitím Pushoveru se musíte <a href="%1$s" target="_blank"

View File

@ -92,7 +92,8 @@ $sm_lang = array(
'email' => 'E-mail',
'pushover' => 'Pushover',
'pushover_description' => 'Pushover er en service der gør det let at modtage real-time notifikationer. Se <a
href="https://pushover.net/">deres website</a> for mere information.',
href="https://pushover.net/" target="_blank">deres website</a> for mere
information.',
'pushover_key' => 'Pushover nøgle',
'pushover_device' => 'Pushover enhed',
'pushover_device_description' => 'Navnet enheden som beskeden skal sendes til. Lad denne være tom hvis
@ -208,7 +209,8 @@ $sm_lang = array(
'sms_from' => 'Afsenderens navn.',
'pushover_status' => 'Tillad at sende Pushover beskeder',
'pushover_description' => 'Pushover er en service det gør det nemt at modtage real-time notifikationer. Se <a
href="https://pushover.net/">deres website</a> for yderligere information.',
href="https://pushover.net/" target="_blank">deres website</a> for yderligere
information.',
'pushover_clone_app' => 'Klik her for at oprette din Pushover app',
'pushover_api_token' => 'Pushover App API Token',
'pushover_api_token_description' => 'Før du kan benytte Pushover, skal du <a href="%1$s" target="_blank"

View File

@ -93,8 +93,8 @@ $sm_lang = array(
'email' => 'E-Mail',
'pushover' => 'Pushover',
'pushover_description' => 'Pushover ist ein Dienst, der es stark vereinfacht, Statusbenachrichtigungen in
Echtzeit zu erhalten. Besuchen Sie <a href="https://pushover.net/">pushover.net</a>
für weitere Informationen.',
Echtzeit zu erhalten. Besuchen Sie <a href="https://pushover.net/"
target="_blank">pushover.net</a> für weitere Informationen.',
'pushover_key' => 'Pushover Key/Schlüssel',
'pushover_device' => 'Pushover Gerät',
'pushover_device_description' => 'Name des Gerätes, an das die Nachricht gesendet werden soll. Leer lassen,
@ -213,8 +213,8 @@ $sm_lang = array(
'sms_from' => 'SMS-Sendernummer',
'pushover_status' => 'Ermögliche das Senden von Pushover-Nachrichten',
'pushover_description' => 'Pushover ist ein Dienst, der es stark vereinfacht, Statusbenachrichtigungen in
Echtzeit zu erhalten. Besuchen Sie <a href="https://pushover.net/">pushover.net</a>
für weitere Informationen.',
Echtzeit zu erhalten. Besuchen Sie <a href="https://pushover.net/"
target="_blank">pushover.net</a> für weitere Informationen.',
'pushover_clone_app' => 'Klicken Sie hier, um Ihre Pushover-Anwendung zu erstellen',
'pushover_api_token' => 'Pushover-Anwendungs-API-Token',
'pushover_api_token_description' => 'Bevor Sie Pushover verwenden können, müssen Sie Ihre <a href="%1$s"

View File

@ -113,15 +113,15 @@ $sm_lang = array(
'email' => 'Email',
'pushover' => 'Pushover',
'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.',
href="https://pushover.net/" target="_blank">their website</a> for more info.',
'pushover_key' => 'Pushover Key',
'pushover_device' => 'Pushover Device',
'pushover_device_description' => 'Device name to send the message to. Leave empty to send it to all devices.',
'telegram' => 'Telegram',
'telegram_description' => '<a href="https://telegram.org/">Telegram</a> is a chat app that makes it easy to
get real-time notifications. Visit the <a
href="http://docs.phpservermonitor.org/">documentation</a> for more info and an
install guide.',
'telegram_description' => '<a href="https://telegram.org/" target="_blank">Telegram</a> is a chat app that
makes it easy to get real-time notifications. Visit the <a
href="http://docs.phpservermonitor.org/" target="_blank">documentation</a> for more
info and an install guide.',
'telegram_chat_id' => 'Telegram chat id',
'telegram_chat_id_description' => 'The message will be send to the corresponding chat.',
'telegram_get_chat_id' => 'Click here to get your chat id',
@ -269,8 +269,8 @@ $sm_lang = array(
'error_server_ip_bad_website' => 'The website URL is not valid.',
'error_server_type_invalid' => 'The selected server type is invalid.',
'error_server_warning_threshold_invalid' => 'The warning threshold must be a valid integer greater than 0.',
'error_server_ssl_cert_expiry_days' => 'The remaining days for SSL certificate validity must be a valid integer
greater than or equal to 0.',
'error_server_ssl_cert_expiry_days' => 'The remaining days for SSL certificate validity must be a valid
integer greater than or equal to 0.',
),
'config' => array(
'general' => 'General',
@ -301,20 +301,21 @@ $sm_lang = array(
'sms_from' => 'Sender\'s phone number',
'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.',
href="https://pushover.net/" target="_blank">their website</a> for more info.',
'pushover_clone_app' => 'Click here to create your Pushover app',
'pushover_api_token' => 'Pushover App API Token',
'pushover_api_token_description' => 'Before you can use Pushover, you need to <a href="%1$s" target="_blank"
rel="noopener">register an App</a> at their website and enter the App API
Token here.',
'telegram_status' => 'Allow sending Telegram messages',
'telegram_description' => '<a href="https://telegram.org/">Telegram</a> is a chat app that makes it easy to
get real-time notifications. Visit the <a
href="http://docs.phpservermonitor.org/">documentation</a> for more info and an
install guide.',
'telegram_description' => '<a href="https://telegram.org/" target="_blank">Telegram</a> is a chat app that
makes it easy to get real-time notifications. Visit the <a
href="http://docs.phpservermonitor.org/" target="_blank">documentation</a> for more
info and an install guide.',
'telegram_api_token' => 'Telegram API Token',
'telegram_api_token_description' => 'Before you can use Telegram, you need to get a API token. Visit the <a
href="http://docs.phpservermonitor.org/">documentation</a> for help.',
href="http://docs.phpservermonitor.org/"
target="_blank">documentation</a> for help.',
'alert_type' => 'Select when you\'d like to be notified.',
'alert_type_description' => '<b>Status change:</b> You will receive a notification when a server has a change
in status. So from online -> offline or offline -> online.<br><br><b>Offline:</b>

View File

@ -116,17 +116,17 @@ $sm_lang = array(
'email' => 'Email',
'pushover' => 'Pushover',
'pushover_description' => 'Pushover es un servicio que hace que sea fácil de obtener notificaciones en tiempo
real. Vea <a href="https://pushover.net/"> su página web </a> para más
información.',
real. Vea <a href="https://pushover.net/" target="_blank"> su página web </a> para
más información.',
'pushover_key' => 'Clave Pushover',
'pushover_device' => 'Dispositivo Pushover',
'pushover_device_description' => 'Nombre del dispositivo para enviar el mensaje. Dejar en blanco para enviarlo
a todos los dispositivos.',
'telegram' => 'Telegram',
'telegram_description' => '<a href="https://telegram.org/">Telegram</a> is a chat app that makes it easy to
get real-time notifications. Visit the <a
href="http://docs.phpservermonitor.org/">documentation</a> for more info and an
install guide.',
'telegram_description' => '<a href="https://telegram.org/" target="_blank">Telegram</a> is a chat app that
makes it easy to get real-time notifications. Visit the <a
href="http://docs.phpservermonitor.org/" target="_blank">documentation</a> for more
info and an install guide.',
'telegram_chat_id' => 'Telegram chat id',
'telegram_chat_id_description' => 'El mensaje será enviado al chat correspondiente.',
'telegram_get_chat_id' => 'Haga click aquí para obtener su chat id',
@ -302,22 +302,22 @@ $sm_lang = array(
'sms_from' => 'Número origen del SMS',
'pushover_status' => '¿Habilitar el envío de mensajes Pushover?',
'pushover_description' => 'Pushover es un servicio que hace que sea fácil de obtener notificaciones en tiempo
real. Vea <a href="https://pushover.net/"> su página web </a> para más
información.',
real. Vea <a href="https://pushover.net/" target="_blank"> su página web </a> para
más información.',
'pushover_clone_app' => 'Haga clic aquí para crear tu aplicación Pushover',
'pushover_api_token' => 'Token API de Pushover',
'pushover_api_token_description' => 'Antes de poder utilizar Pushover, necesita <a href="%1$s" target="_blank"
rel="noopener"> registrar </a> su aplicación en la página web e
ingresar el token API.',
'telegram_status' => '¿Habilitar el envío de mensajes de Telegram?',
'telegram_description' => '<a href="https://telegram.org/">Telegram</a> es una aplicación de mensajería
instantánea que permite recibir notificaciones en tiempo real. Visite la <a
href="http://docs.phpservermonitor.org/">documentación</a> para una guía mas
detallada.',
'telegram_description' => '<a href="https://telegram.org/" target="_blank">Telegram</a> es una aplicación de
mensajería instantánea que permite recibir notificaciones en tiempo real. Visite
la <a href="http://docs.phpservermonitor.org/" target="_blank">documentación</a>
para una guía mas detallada.',
'telegram_api_token' => 'Token API de Telegram',
'telegram_api_token_description' => 'Antes de utilizar Telegram, necesita un Token de API. Visite la <a
href="http://docs.phpservermonitor.org/">documentación</a> para más
información.',
href="http://docs.phpservermonitor.org/"
target="_blank">documentación</a> para más información.',
'alert_type' => '¿Cuándo desea recibir notificaciones?',
'alert_type_description' => '<b>Al cambiar el estado:</b> p.ej. en línea -> fuera de línea o fuera de línea
-> en línea.<br><br /><b>Fuera de Línea:</b> Recibirá una notificación cuando

View File

@ -93,7 +93,8 @@ $sm_lang = array(
'email' => 'Email',
'pushover' => 'Pushover',
'pushover_description' => 'Pushover on teenus, mis teeb reaalaja teavitused imelihtsaks. Vaata <a
href="https://pushover.net/">nende kodulehte</a> rohkema info jaoks.',
href="https://pushover.net/" target="_blank">nende kodulehte</a> rohkema info
jaoks.',
'pushover_key' => 'Pushoveri Võti',
'pushover_device' => 'Pushoveri Seade',
'pushover_device_description' => 'Seadme nimi, kuhu teavitus saata. Jäta tühjaks, et saata igale seadmele.',
@ -207,7 +208,8 @@ $sm_lang = array(
'sms_from' => 'Saatja telefoni number',
'pushover_status' => 'Luba Pushoveri sõnumite saatmine',
'pushover_description' => 'Pushover on teenus, mis teeb reaalaja teavitused imelihtsaks. Vaata <a
href="https://pushover.net/">nende kodulehte</a> rohkema info jaoks.',
href="https://pushover.net/" target="_blank">nende kodulehte</a> rohkema info
jaoks.',
'pushover_clone_app' => 'Kliki siia, et teha oma Pushover äpp',
'pushover_api_token' => 'Pushover Äppi API Žetoon',
'pushover_api_token_description' => 'Enne, kui saad Pushoverida pead sa <a href="%1$s" target="_blank"

View File

@ -97,7 +97,8 @@ $sm_lang = array(
'pushover' => 'Pushover',
'pushover_description' => 'Pushover سرویسی است که دریافت اطلاعیه های بلادرنگ
را ساده می کند. برای اطلاعات بیشتر <a
href="https://pushover.net/">سایت آن ها</a> را ببینید.',
href="https://pushover.net/" target="_blank">سایت آن ها</a> را
ببینید.',
'pushover_key' => 'کلید Pushover',
'pushover_device' => 'دستگاه Pushover',
'pushover_device_description' => 'نام دستگاه برای ارسال پیام. برای ارسال به
@ -217,7 +218,8 @@ $sm_lang = array(
'pushover_status' => 'اجازه ارسال پیام های Pushover',
'pushover_description' => 'Pushover سرویسی است که دریافت اطلاعیه های بلادرنگ
را ساده می کند. برای اطلاعات بیشتر <a
href="https://pushover.net/">سایت آن ها</a> را ببینید.',
href="https://pushover.net/" target="_blank">سایت آن ها</a> را
ببینید.',
'pushover_clone_app' => 'برای ایجاد برنامه پوش آور خود اینجا را کلیک
کنید.',
'pushover_api_token' => 'رمز API برنامه پوش آور',

View File

@ -94,7 +94,7 @@ $sm_lang = array(
'email' => 'Sähköposti',
'pushover' => 'Pushover',
'pushover_description' => 'Pushover on palvelu jolla on helppo lähettää reaaliaikaisia tilaviestejä. Katso
<a href="https://pushover.net/">verkkosivuilta</a> lisäinfoa.',
<a href="https://pushover.net/" target="_blank">verkkosivuilta</a> lisäinfoa.',
'pushover_key' => 'Pushover avain',
'pushover_device' => 'Pushover laite',
'pushover_device_description' => 'Laitteen nimi johon viesti lähetetään. Jätä tyhjäksi lähettääksesi
@ -209,7 +209,7 @@ $sm_lang = array(
'sms_from' => 'Lähettäjän puhelinnumero',
'pushover_status' => 'Salli Pushover-viestien lähetys',
'pushover_description' => 'Pushover on palvelu jolla on helppo lähettää reaaliaikaisia tilaviestejä. Katso
<a href="https://pushover.net/">verkkosivuilta</a> lisäinfoa.',
<a href="https://pushover.net/" target="_blank">verkkosivuilta</a> lisäinfoa.',
'pushover_clone_app' => 'Paina tästä luodaksesi Pushover-sovelluksesi',
'pushover_api_token' => 'Pushover API-avain',
'pushover_api_token_description' => 'Ennen kuin voit käyttää Pushoveria, sinun täytyy <a href="%1$s"

View File

@ -113,16 +113,18 @@ $sm_lang = array(
'email' => 'Email',
'pushover' => 'Pushover',
'pushover_description' => 'Pushover est un service qui simplifie les notifications en temps réel. Voir <a
href="https://pushover.net/">leur site web</a> pour plus d\'informations.',
href="https://pushover.net/" target="_blank">leur site web</a> pour plus
d\'informations.',
'pushover_key' => 'Clé Pushover',
'pushover_device' => 'Appareil Pushover',
'pushover_device_description' => 'Nom de l\'appareil auquel le message doit être envoyé. Laissez vide pour
l\'envoyer à tous les appareils.',
'telegram' => 'Telegram',
'telegram_description' => '<a href="https://telegram.org/">Telegram</a> est une application de messagerie
instantanée qui facilite la réception de notification en temps réel. Lisez la <a
href="http://docs.phpservermonitor.org/">documentation</a> pour obtenir plus
d\'informations sur la configuration de ce service.',
'telegram_description' => '<a href="https://telegram.org/" target="_blank">Telegram</a> est une application de
messagerie instantanée qui facilite la réception de notification en temps réel.
Lisez la <a href="http://docs.phpservermonitor.org/"
target="_blank">documentation</a> pour obtenir plus d\'informations sur la
configuration de ce service.',
'telegram_chat_id' => 'ID de conversation (Chat ID) Telegram',
'telegram_chat_id_description' => 'Les notifications seront envoyées à la conversation correspondante.',
'telegram_get_chat_id' => 'Cliquez ici pour obtenir votre ID de conversation (Chat ID)',
@ -302,22 +304,23 @@ $sm_lang = array(
'sms_from' => 'SMS de l\'expéditeur',
'pushover_status' => 'Autoriser l\'envoi des messages Pushover',
'pushover_description' => 'Pushover est un service qui simplifie les notifications en temps réel. Voir <a
href="https://pushover.net/">leur site web</a> pour plus d\'informations.',
href="https://pushover.net/" target="_blank">leur site web</a> pour plus
d\'informations.',
'pushover_clone_app' => 'Cliquez ici pour créer votre application Pushover',
'pushover_api_token' => 'Jeton application Pushover',
'pushover_api_token_description' => 'Avant de pouvoir utiliser Pushover, vous devez <a href="%1$s"
target="_blank" rel="noopener">créer une application</a> sur leur site
web et entrer ici le jeton (Token) de l\'application.',
'telegram_status' => 'Autorise l\'envoi de message Telegram',
'telegram_description' => '<a href="https://telegram.org/">Telegram</a> est une application de messagerie
instantanée qui facilite la réception de notification en temps réel. Lisez la <a
href="http://docs.phpservermonitor.org/">documentation</a> pour obtenir plus
d\'informations sur la configuration de ce service.',
'telegram_description' => '<a href="https://telegram.org/" target="_blank">Telegram</a> est une application de
messagerie instantanée qui facilite la réception de notification en temps réel.
Lisez la <a href="http://docs.phpservermonitor.org/"
target="_blank">documentation</a> pour obtenir plus d\'informations sur la
configuration de ce service.',
'telegram_api_token' => 'Token API Telegram',
'telegram_api_token_description' => 'Afin de pouvoir utiliser Telegram, il vous faut obtenir un token api.
Consultez la <a
href="http://docs.phpservermonitor.org/">documentation</a> pour obtenir
de l\'aide.',
Consultez la <a href="http://docs.phpservermonitor.org/"
target="_blank">documentation</a> pour obtenir de l\'aide.',
'alert_type' => 'Choisissez quand vous souhaitez être notifié',
'alert_type_description' => '<b>Changement d\'état&nbsp;: </b>Vous recevez une notification chaque fois que
le serveur change d\'état. C\'est-à-dire passe de l\'état OK à HORS SERVICE

View File

@ -110,7 +110,7 @@ $sm_lang = array(
'email' => 'Email',
'pushover' => 'Pushover',
'pushover_description' => 'Pushover is een dienst die het gemakkelijk maakt om real-time notificaties te
ontvangen. Zie <a href="https://pushover.net/">hun website</a> voor meer
ontvangen. Zie <a href="https://pushover.net/" target="_blank">hun website</a> voor meer
informatie.',
'pushover_key' => 'Pushover Key',
'pushover_device' => 'Pushover Device',
@ -264,7 +264,7 @@ $sm_lang = array(
'sms_from' => 'Telefoonnummer afzender',
'pushover_status' => 'Sta Pushover berichten toe?',
'pushover_description' => 'Pushover is een dienst die het gemakkelijk maakt om real-time notificaties te
ontvangen. Zie <a href="https://pushover.net/">hun website</a> voor meer
ontvangen. Zie <a href="https://pushover.net/" target="_blank">hun website</a> voor meer
informatie.',
'pushover_clone_app' => 'Klik hier om je Pushover app te maken',
'pushover_api_token' => 'Pushover App API Token',

View File

@ -107,16 +107,16 @@ $sm_lang = array(
'email' => 'E-post',
'pushover' => 'Pushover',
'pushover_description' => 'Pushover er en tjeneste som gjør det enkelt å meldinger i sanntid. Se <a
href="https://pushover.net/">deres nettside</a> for mer info.',
href="https://pushover.net/" target="_blank">deres nettside</a> for mer info.',
'pushover_key' => 'Pushover Key',
'pushover_device' => 'Pushover Device',
'pushover_device_description' => 'Enhetsnavn for å sende meldingen til. La det være tomt for å sende det
til alle enheter.',
'telegram' => 'Telegram',
'telegram_description' => '<a href="https://telegram.org/">Telegram</a> er en chat-app som gjør det enkelt å
meldinger i sanntid. til <a
href="http://docs.phpservermonitor.org/">dokumentasjonen</a> for mer informasjon og
en installasjonsguide. ',
'telegram_description' => '<a href="https://telegram.org/" target="_blank">Telegram</a> er en chat-app som
gjør det enkelt å meldinger i sanntid. til <a
href="http://docs.phpservermonitor.org/" target="_blank">dokumentasjonen</a> for
mer informasjon og en installasjonsguide. ',
'telegram_chat_id' => 'Telegram chat-ID',
'telegram_chat_id_description' => 'Meldingen vil bli sendt til tilhørende chat.',
'telegram_get_chat_id' => 'Klikk her for å få chat-ID',
@ -276,21 +276,21 @@ $sm_lang = array(
'sms_from' => 'Avsenderens telefonnummer',
'pushover_status' => 'Tillat sending av Pushover-meldinger',
'pushover_description' => 'Pushover er en tjeneste som gjør det enkelt å meldinger i sanntid. Se <a
href="https://pushover.net/">deres nettside</a> for mer info.',
href="https://pushover.net/" target="_blank">deres nettside</a> for mer info.',
'pushover_clone_app' => 'Klikk her for å lage din Pushover-app',
'pushover_api_token' => 'Pushover App API Token',
'pushover_api_token_description' => 'Før du kan bruke Pushover, du <a href="%1$s" target="_blank"
rel="noopener"> registrere en app </a> deres nettside og angi App API
Token her.',
'telegram_status' => 'Tillat sending av Telegram-meldinger',
'telegram_description' => '<a href="https://telegram.org/">Telegram</a> er en chat-app som gjør det enkelt å
meldinger i sanntid. til <a
href="http://docs.phpservermonitor.org/">dokumentasjonen</a> for mer informasjon og
en installasjonsveiledning.',
'telegram_description' => '<a href="https://telegram.org/" target="_blank">Telegram</a> er en chat-app som
gjør det enkelt å meldinger i sanntid. til <a
href="http://docs.phpservermonitor.org/" target="_blank">dokumentasjonen</a> for
mer informasjon og en installasjonsveiledning.',
'telegram_api_token' => 'Telegram API Token',
'telegram_api_token_description' => 'Før du kan bruke Telegram, du en API-token. til <a
href="http://docs.phpservermonitor.org/">dokumentasjonen</a> for å
hjelp.',
href="http://docs.phpservermonitor.org/"
target="_blank">dokumentasjonen</a> for å hjelp.',
'alert_type' => 'Velg når du vil bli varslet.',
'alert_type_description' => '<b>Statusendring:</b> Du vil motta et varsel når en server har endret status.
fra online -> offline eller offline -> online.<br><br /><b>Offline:</b> Du

View File

@ -95,7 +95,7 @@ $sm_lang = array(
'email' => 'Email',
'pushover' => 'Pushover',
'pushover_description' => 'Pushover jest usługą szybkich notyfikacji. Sprawdź <a
href="https://pushover.net/">ich stronę</a> po więcej informacji.',
href="https://pushover.net/" target="_blank">ich stronę</a> po więcej informacji.',
'pushover_key' => 'Pushover Key',
'pushover_device' => 'Urządzenie dla Pushover',
'pushover_device_description' => 'Nazwa urządzenia do którego wysłać powiadomienie. Pozostaw puste aby
@ -211,7 +211,7 @@ $sm_lang = array(
'sms_from' => 'Numer nadawcy',
'pushover_status' => 'Pozwól na wysyłkę notyfikacji Pushover',
'pushover_description' => 'Pushover jest usługą ułatwiającą otrzymywanie powiadomień w czasie
rzeczywistym. Sprawdź <a href="https://pushover.net/">ich stronę</a> aby uzyskać
rzeczywistym. Sprawdź <a href="https://pushover.net/" target="_blank">ich stronę</a> aby uzyskać
więcej informacji.',
'pushover_clone_app' => 'Kliknij tutaj aby stworzyć aplikację korzystającą z Pushover',
'pushover_api_token' => 'Pushover App API Token',

View File

@ -93,7 +93,7 @@ $sm_lang = array(
'email' => 'Email',
'pushover' => 'Pushover',
'pushover_description' => 'Pushover para enviar notificações em real-tome. Veja <a
href="https://pushover.net/">o website</a> para mais informações.',
href="https://pushover.net/" target="_blank">o website</a> para mais informações.',
'pushover_key' => 'Pushover Key',
'pushover_device' => 'Pushover Device',
'pushover_device_description' => 'Nome do Device para enviar a mensagem. Deixe em branco para enviar a todos
@ -209,7 +209,7 @@ $sm_lang = array(
'sms_from' => 'Número de telefone de envio',
'pushover_status' => 'Habilitar envio de mensagens Pushover',
'pushover_description' => 'Pushover é um serviço de notificações em tempo real. Veja <a
href="https://pushover.net/">o website</a> para mais informações.',
href="https://pushover.net/" target="_blank">o website</a> para mais informações.',
'pushover_clone_app' => 'Clique aqui para criar sua app Pushover',
'pushover_api_token' => 'Pushover App API Token',
'pushover_api_token_description' => 'Before you can use Pushover, you need to <a href="%1$s" target="_blank"

View File

@ -113,7 +113,7 @@ $sm_lang = array(
'pushover_description' => 'Pushover - это сервис, который позволяет легко
получать уведомления в режиме реального
времени. Больше информации на <a
href="https://pushover.net/">их веб-сайте</a>.',
href="https://pushover.net/" target="_blank">их веб-сайте</a>.',
'pushover_key' => 'Pushover ключ',
'pushover_device' => 'Pushover устройство',
'pushover_device_description' => 'Имя устройства, на которое будут
@ -121,10 +121,10 @@ $sm_lang = array(
пустым, что бы отправлять уведомления на
все устройства.',
'telegram' => 'Telegram',
'telegram_description' => '<a href="https://telegram.org/">Telegram</a> удобный мессенджер
'telegram_description' => '<a href="https://telegram.org/" target="_blank">Telegram</a> удобный мессенджер
для получения уведомлений в реальном
времени. Посетите <a
href="http://docs.phpservermonitor.org/">раздел документации</a>
href="http://docs.phpservermonitor.org/" target="_blank">раздел документации</a>
для получения доп. информации и инструкций по
установке.',
'telegram_chat_id' => 'Telegram chat id',
@ -304,7 +304,7 @@ $sm_lang = array(
'pushover_description' => 'Pushover - это сервис, который позволяет легко
получать уведомления в режиме реального
времени. Больше информации на <a
href="https://pushover.net/">их веб-сайте</a>.',
href="https://pushover.net/" target="_blank">их веб-сайте</a>.',
'pushover_clone_app' => 'Нажмите здесь чтобы создать ваш Pushover app',
'pushover_api_token' => 'Pushover App API Token',
'pushover_api_token_description' => 'Прежде чем вы сможете начать
@ -313,17 +313,17 @@ $sm_lang = array(
rel="noopener">"App"</a> на их веб-сайте и ввести "App
API Token" сюда.',
'telegram_status' => 'Разрешить отправку уведомлений в Telegram',
'telegram_description' => '<a href="https://telegram.org/">Telegram</a> удобный мессенджер
'telegram_description' => '<a href="https://telegram.org/" target="_blank">Telegram</a> удобный мессенджер
для получения уведомлений в реальном
времени. Посетите <a
href="http://docs.phpservermonitor.org/">раздел документации</a>
href="http://docs.phpservermonitor.org/" target="_blank">раздел документации</a>
для получения доп. информации и инструкций по
установке.',
'telegram_api_token' => 'Telegram API Token',
'telegram_api_token_description' => 'Прежде чем вы сможете начать
пользоваться Telegram, вам необходимо
получить API Token. Посетите <a
href="http://docs.phpservermonitor.org/">раздел
href="http://docs.phpservermonitor.org/" target="_blank">раздел
документации</a> для получения помощи.',
'alert_type' => 'Тип уведомлений',
'alert_type_description' => '<b>Изменение статуса:</b> Вы получите

View File

@ -92,7 +92,7 @@ $sm_lang = array(
'email' => 'E-pošta',
'pushover' => 'Pushover',
'pushover_description' => 'Pushover je storitev, ki omogoča enostavno prejemanje obvestil v realnem času.
Več informacij je na voljo <a href="https://pushover.net/">na njihovi spletni
Več informacij je na voljo <a href="https://pushover.net/" target="_blank">na njihovi spletni
strani</a>.',
'pushover_key' => 'Pushover ključ',
'pushover_device' => 'Pushover naprava',
@ -209,7 +209,7 @@ $sm_lang = array(
'sms_from' => 'Telefonska številka pošiljatelja',
'pushover_status' => 'Dovolim pošiljanje Pushover sporočil',
'pushover_description' => 'Pushover je storitev, ki omogoča enostavno prejemanje obvestil v realnem času.
Več informacij je na voljo <a href="https://pushover.net/">na njihovi spletni
Več informacij je na voljo <a href="https://pushover.net/" target="_blank">na njihovi spletni
strani</a>.',
'pushover_clone_app' => 'Kliknite za ustvarjanje vaše Pushover aplikacije',
'pushover_api_token' => 'Pushover API žeton',

View File

@ -94,7 +94,7 @@ $sm_lang = array(
'email' => 'Email',
'pushover' => 'Pushover',
'pushover_description' => 'Pushover är en tjänst som skickar meddelande i realtid. Se <a
href="https://pushover.net/">deras webbsida</a> för mer information.',
href="https://pushover.net/" target="_blank">deras webbsida</a> för mer information.',
'pushover_key' => 'Pushover Key',
'pushover_device' => 'Pushover Device',
'pushover_device_description' => 'Enhetsnman att skicka meddelande till. Lämna tomt för att skicka till alla
@ -210,7 +210,7 @@ $sm_lang = array(
'sms_from' => 'Avsändarens telefonnummer',
'pushover_status' => 'Tillåt Pushover-meddelande',
'pushover_description' => 'Pushover är en tjänst som skickar meddelande i realtid. Se <a
href="https://pushover.net/">deras webbsida</a> för mer info.',
href="https://pushover.net/" target="_blank">deras webbsida</a> för mer info.',
'pushover_clone_app' => 'Klicka här för att skapa din Pushover app',
'pushover_api_token' => 'Pushover App API Token',
'pushover_api_token_description' => 'Innan du kan använda Pushover behöver du <a href="%1$s" target="_blank"

View File

@ -95,7 +95,7 @@ $sm_lang = array(
'email' => 'E-posta',
'pushover' => 'Pushover',
'pushover_description' => 'Pushover gerçek zamanlı bildirim alabilmek için bir servistir. Daha fazla bilgi
için <a href="https://pushover.net/">sitesine</a> bakabilirsiniz.',
için <a href="https://pushover.net/" target="_blank">sitesine</a> bakabilirsiniz.',
'pushover_key' => 'Pushover Anahtarı',
'pushover_device' => 'Pushover Aracı',
'pushover_device_description' => 'Mesajın gönderileceği cihazın adı. Tüm cihazlara göndermek için boş
@ -211,7 +211,7 @@ $sm_lang = array(
'sms_from' => 'Gönderen numarası',
'pushover_status' => 'Pushover mesaj gönderimine izin ver',
'pushover_description' => 'Pushover gerçek zamanlı bildirim alabilmek için bir servistir. Daha fazla bilgi
için <a href="https://pushover.net/">sitesine</a> bakabilirsiniz.',
için <a href="https://pushover.net/" target="_blank">sitesine</a> bakabilirsiniz.',
'pushover_clone_app' => 'Pushover uygulaması oluşturmak için buraya tıklayınız.',
'pushover_api_token' => 'Pushover Uygulaması API Token Bilgisi',
'pushover_api_token_description' => 'Pushover kullanmadan önce, <a href="%1$s" target="_blank"

View File

@ -116,7 +116,7 @@ $sm_lang = array(
'pushover' => 'Pushover',
'pushover_description' => 'Pushover сервіс, що дозволяє легко отримувати
сповіщення у реальному часі. За деталями
перейдіть на <a href="https://pushover.net/">їхній
перейдіть на <a href="https://pushover.net/" target="_blank">їхній
вебсайт</a>.',
'pushover_key' => 'Ключ Pushover',
'pushover_device' => 'Пристрій Pushover',
@ -124,11 +124,11 @@ $sm_lang = array(
повідомлення. Залиште пустим, щоб
надсилати на всі пристрої.',
'telegram' => 'Telegram',
'telegram_description' => '<a href="https://telegram.org/">Telegram</a> чат-застосунок, що
'telegram_description' => '<a href="https://telegram.org/" target="_blank">Telegram</a> чат-застосунок, що
дозволяє легко отримувати сповіщення у
реальному часі. За деталями й інструкцією зі
встановлення зверніться до <a
href="http://docs.phpservermonitor.org/">документації</a>.',
href="http://docs.phpservermonitor.org/" target="_blank">документації</a>.',
'telegram_chat_id' => 'Ідентифікатор чату Telegram',
'telegram_chat_id_description' => 'Повідомлення буде надіслане у
відповідний чат.',
@ -331,7 +331,7 @@ $sm_lang = array(
'pushover_description' => 'Pushover сервіс, що дозволяє легко отримувати
сповіщення у реальному часі. За детальнішою
інформацію перейдіть на <a
href="https://pushover.net/">їхній вебсайт</a>.',
href="https://pushover.net/" target="_blank">їхній вебсайт</a>.',
'pushover_clone_app' => 'Натисніть тут, щоб створити ваш Pushover-додаток',
'pushover_api_token' => 'Токен API Pushover-додатку',
'pushover_api_token_description' => 'Перед використанням Pushover ви маєте <a
@ -339,16 +339,16 @@ $sm_lang = array(
Додаток</a> на їхньому вебсайті та ввести
токен API Додатку тут.',
'telegram_status' => 'Дозволити надсилання Telegram-повідомлень',
'telegram_description' => '<a href="https://telegram.org/">Telegram</a> чат-застосунок, що
'telegram_description' => '<a href="https://telegram.org/" target="_blank">Telegram</a> чат-застосунок, що
дозволяє легко отримувати сповіщення у
реальному часі. Детальніша інформація та
інструкція зі встановлення доступні у <a
href="http://docs.phpservermonitor.org/">документації</a>.',
href="http://docs.phpservermonitor.org/" target="_blank">документації</a>.',
'telegram_api_token' => 'Токен Telegram API',
'telegram_api_token_description' => 'Перед використанням Telegram ви маєте
отримати токен API. За довідкою
зверніться до <a
href="http://docs.phpservermonitor.org/">документації</a>.',
href="http://docs.phpservermonitor.org/" target="_blank">документації</a>.',
'alert_type' => 'Виберіть, коли б вам хотілося отримувати
сповіщення.',
'alert_type_description' => '<b>Зміна статусу:</b> Ви отримуватимете

View File

@ -91,7 +91,7 @@ $sm_lang = array(
'email' => 'Email',
'pushover' => 'Pushover',
'pushover_description' => 'Pushover một dịch vụ dễ dàng nhận các thông báo theo thời gian
thực. Xem <a href="https://pushover.net/">website của họ</a> để biết
thực. Xem <a href="https://pushover.net/" target="_blank">website của họ</a> để biết
thêm thông tin.',
'pushover_key' => 'Pushover Key',
'pushover_device' => 'Pushover Device',
@ -208,7 +208,7 @@ $sm_lang = array(
'sms_from' => 'Số điện thoại của người gửi',
'pushover_status' => 'Cho phép gửi tin nhắn bằng Pushover',
'pushover_description' => 'Pushover một dịch vụ dễ dàng nhận các thông báo theo thời gian
thực. Xem <a href="https://pushover.net/">website của họ</a> để biết
thực. Xem <a href="https://pushover.net/" target="_blank">website của họ</a> để biết
thêm thông tin.',
'pushover_clone_app' => 'Nhấn vào đây để tạo ứng dụng Pushover của bạn',
'pushover_api_token' => 'Pushover App API Token',

View File

@ -110,9 +110,9 @@ $sm_lang = array(
'pushover_device' => 'Pushover 裝置',
'pushover_device_description' => '發送訊息的裝置名稱,若保留空白,將會發送到所有的裝置。',
'telegram' => 'Telegram 通知',
'telegram_description' => '<a href="https://telegram.org/">Telegram</a>
'telegram_description' => '<a href="https://telegram.org/" target="_blank">Telegram</a>
是一種聊天應用程式,它提供很容易使用的的即時通知能力。您可以到
<a href="http://docs.phpservermonitor.org/">documentation</a>
<a href="http://docs.phpservermonitor.org/" target="_blank">documentation</a>
了解更多的內容。',
'telegram_chat_id' => 'Telegram Chat ID',
'telegram_chat_id_description' => '將訊息發送到指定的聊天室',
@ -258,18 +258,18 @@ $sm_lang = array(
'sms_from' => '發送人電話號碼',
'pushover_status' => '啟用Pushover通知',
'pushover_description' => 'Pushover是線上服務讓您可以方便的收到即時通知請參考 <a
href="https://pushover.net/"> 網站</a> 可以得到更詳細的資訊。</a> ',
href="https://pushover.net/" target="_blank"> 網站</a> 可以得到更詳細的資訊。</a> ',
'pushover_clone_app' => '點選這裡可快速建立Pushover App',
'pushover_api_token_description' => '在您使用 Pushover 通知之前,需要先到這裡-><a href="%1$s"
target="_blank" rel="noopener">註冊Pushover App帳號</a>
接著在這個網頁輸入你的的Pushover App API Token號碼。',
'telegram_status' => '允許發送 Telegram 訊息',
'telegram_description' => '<a href="https://telegram.org/">Telegram</a>
'telegram_description' => '<a href="https://telegram.org/" target="_blank">Telegram</a>
是一種聊天應用程式,它提供很容易使用的即時通知服務。請參考
<a href="http://docs.phpservermonitor.org/">文件庫</a>
<a href="http://docs.phpservermonitor.org/" target="_blank">文件庫</a>
可以取得更多資訊與安裝說明。',
'telegram_api_token_description' => '使用 Telegram 通知之前,您必需先取得 API Token。請到 <a
href="http://docs.phpservermonitor.org/">文件庫</a> 取得說明。',
href="http://docs.phpservermonitor.org/" target="_blank">文件庫</a> 取得說明。',
'alert_type' => '需要提醒的類別',
'alert_type_description' => '<b>狀態改變:</b> 伺服器 連線 -> 離線或連線 ->
連線的狀態變化將會收到提醒通知。<br/><br /><b>離線:</b>

View File

@ -67,7 +67,6 @@ class ConfigController extends AbstractController
'email_smtp_host',
'email_smtp_port',
'email_smtp_username',
'email_smtp_password',
'sms_gateway_username',
'sms_gateway_password',
'sms_from',
@ -75,6 +74,14 @@ class ConfigController extends AbstractController
'telegram_api_token',
);
/**
* Fields for saving encrypted.
* @var array
*/
protected $encryptedFields = [
'email_smtp_password'
];
private $default_tab = 'general';
public function __construct(Database $db, \Twig_Environment $twig)
@ -177,6 +184,10 @@ class ConfigController extends AbstractController
foreach ($this->fields as $input_key) {
$tpl_data[$input_key] = (isset($config[$input_key])) ? $config[$input_key] : '';
}
// encrypted fields
foreach ($this->encryptedFields as $encryptedField) {
$tpl_data[$encryptedField] = '';
}
$tpl_data[$this->default_tab . '_active'] = 'active';
@ -224,6 +235,13 @@ class ConfigController extends AbstractController
$clean[$input_key] = $_POST[$input_key];
}
}
foreach ($this->encryptedFields as $encryptedField) {
$value = filter_input(INPUT_POST, $encryptedField);
if ($value !== null && $value !== '') {
$clean[$encryptedField] = psm_password_encrypt(psm_get_conf('password_encrypt_key'), $value);
}
// else { leave as is }
}
$language_refresh = ($clean['language'] != psm_get_conf('language'));
foreach ($clean as $key => $value) {
psm_update_conf($key, $value);
@ -451,6 +469,7 @@ class ConfigController extends AbstractController
'label_log_retention_period_description' => psm_get_lang('config', 'log_retention_period_description'),
'label_log_retention_days' => psm_get_lang('config', 'log_retention_days'),
'label_days' => psm_get_lang('config', 'log_retention_days'),
'label_leave_blank' => psm_get_lang('users', 'password_leave_blank'),
);
}

View File

@ -97,13 +97,6 @@ class ServerController extends AbstractServerController
psm_get_lang('menu', 'server_update')
);
$icons = array(
'email' => 'icon-envelope',
'sms' => 'icon-mobile',
'pushover' => 'icon-pushover',
'telegram' => 'icon-telegram',
);
$servers = $this->getServers();
$server_count = count($servers);
@ -114,6 +107,9 @@ class ServerController extends AbstractServerController
$servers[$x]['ip'] = '<a href="' . $servers[$x]['ip'] .
'" target="_blank" rel="noopener">' . $ip . '</a>';
}
if ($servers[$x]['type'] == 'ping') {
$servers[$x]['port'] = '';
}
if (($servers[$x]['active'] == 'yes')) {
$servers[$x]['active_title'] = psm_get_lang('servers', 'monitoring');
} else {
@ -123,6 +119,12 @@ class ServerController extends AbstractServerController
$servers[$x] = $this->formatServer($servers[$x]);
}
$tpl_data['servers'] = $servers;
$tpl_data['config']['email'] = psm_get_conf('email_status');
$tpl_data['config']['sms'] = psm_get_conf('sms_status');
$tpl_data['config']['pushover'] = psm_get_conf('pushover_status');
$tpl_data['config']['telegram'] = psm_get_conf('telegram_status');
return $this->twig->render('module/server/server/list.tpl.html', $tpl_data);
}

View File

@ -396,7 +396,6 @@ class UserController extends AbstractController
'label_pushover_device' => psm_get_lang('users', 'pushover_device'),
'label_pushover_device_description' => psm_get_lang('users', 'pushover_device_description'),
'label_telegram' => psm_get_lang('users', 'telegram'),
'label_telegram_description' => psm_get_lang('users', 'telegram_description'),
'label_telegram_id' => psm_get_lang('users', 'telegram_chat_id'),
'label_telegram_id_description' => psm_get_lang('users', 'telegram_chat_id_description'),
'label_email' => psm_get_lang('users', 'email'),

0
src/psm/Txtmsg/FreeVoipDeal.php Executable file → Normal file
View File

View File

@ -348,6 +348,9 @@ class Installer
if (version_compare($version_from, '3.4.6-beta.1', '<')) {
$this->upgrade346();
}
if (version_compare($version_from, '3.4.6-beta.2', '<')) {
$this->upgrade346();
}
psm_update_conf('version', $version_to);
}
@ -671,8 +674,22 @@ class Installer
$queries = array();
$queries[] = "ALTER TABLE `" . PSM_DB_PREFIX . "servers`
ADD `ssl_cert_expiry_days` MEDIUMINT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER `warning_threshold_counter`";
$queries[] = "ALTER TABLE `" . PSM_DB_PREFIX . "servers`
$queries[] = "ALTER TABLE `" . PSM_DB_PREFIX . "servers`
ADD `ssl_cert_expired_time` VARCHAR(255) NULL AFTER `ssl_cert_expiry_days`";
if (
@psm_password_decrypt(
psm_get_conf('password_encrypt_key'),
psm_get_conf('email_smtp_password')
) === false
) {
// Prevents encrypting the password multiple times.
$queries[] = "UPDATE `" . PSM_DB_PREFIX . "config`
SET `value` = '" .
psm_password_encrypt(psm_get_conf('password_encrypt_key'), psm_get_conf('email_smtp_password')) .
"' WHERE `key` = 'email_smtp_password'";
$this->log('SMTP password is now encrypted.');
}
$this->execSQL($queries);
}
}

View File

@ -366,8 +366,10 @@ class StatusUpdater
}
}
// Check ssl cert
$this->checkSsl($this->server, $this->error, $result);
// Check ssl cert just when other error is not already in...
if ($result !== false) {
$this->checkSsl($this->server, $this->error, $result);
}
// check if server is available and rerun if asked.
if (!$result && $run < $max_runs) {
@ -404,7 +406,7 @@ class StatusUpdater
*/
private function checkSsl($server, &$error, &$result)
{
if (version_compare(PHP_RELEASE_VERSION, '7.1', '<')) {
if (version_compare(PHP_VERSION, '7.1', '<')) {
$error = "The server you're running PSM on must use PHP 7.1 or higher to test the SSL expiration.";
return;
}
@ -413,14 +415,21 @@ class StatusUpdater
$server['ssl_cert_expiry_days'] > 0
) {
$cert_expiration_date = strtotime($this->curl_info['certinfo'][0]['Expire date']);
$expiration_time = round((int)($cert_expiration_date - time()) / 86400);
$expiration_time =
round((int)($cert_expiration_date - time()) / 86400);
$latest_time = time() + (86400 * $server['ssl_cert_expiry_days']);
if ($expiration_time >= 0) {
if ($expiration_time - $server['ssl_cert_expiry_days'] < 0) {
// Cert is not expired, but date is withing user set range
$this->header = psm_get_lang('servers', 'ssl_cert_expiring') . " " .
psm_date($this->curl_info['certinfo'][0]['Expire date']) .
"\n\n" . $this->header;
$save['ssl_cert_expired_time'] = $expiration_time - $server['ssl_cert_expiry_days'];
} elseif ($expiration_time >= 0) {
// Cert is not expired
$save['ssl_cert_expired_time'] = null;
} else {
// Cert is expired
$error = psm_get_lang('servers', 'ssl_cert_expired') . " " .
psm_timespan($cert_expiration_date) . ".\n\n" .
$error;

View File

@ -99,7 +99,7 @@
<!-- email user -->
{{ macro.input_field("text", "email_smtp_username", null, "email_smtp_username", label_email_smtp_username, email_smtp_username, label_email_smtp_username, "255") }}
<!-- email password -->
{{ macro.input_field("password", "email_smtp_password", null, "email_smtp_password", label_email_smtp_password, email_smtp_password, label_email_smtp_password, "255", null, null, null, true) }}
{{ macro.input_field("password", "email_smtp_password", null, "email_smtp_password", label_email_smtp_password, email_smtp_password, label_leave_blank, "255", null, null, null, true) }}
{{ macro.button_test("testEmail", label_test) }}
{{ macro.input_hidden("test_email", "0") }}
{{ macro.button_save("email_submit", label_save) }}
@ -129,6 +129,7 @@
<div class="tab-pane {{ pushover_active }}" id="config-pushover" role="tabpanel" aria-labelledby="config-telegram-tab">
<fieldset>
<legend>{{ label_settings_pushover }}</legend>
<p>{{ label_pushover_description|raw }}</p>
<!-- enable pushover -->
{{ macro.input_checkbox("pushover_status", "pushover_status", label_pushover_status, pushover_status_checked) }}
<!-- enable pushover log -->
@ -143,6 +144,7 @@
<div class="tab-pane {{ telegram_active }}" id="config-telegram" role="tabpanel" aria-labelledby="config-pushover-tab">
<fieldset>
<legend>{{ label_settings_telegram }}</legend>
<p>{{ label_telegram_description|raw }}</p>
<!-- enable telegram -->
{{ macro.input_checkbox("telegram_status", "telegram_status[]", label_telegram_status, telegram_status_checked) }}
<!-- enable telegram log -->

View File

@ -12,8 +12,8 @@
If no errors have occurred, you are good to go.</p>
<div class="w-100 mb-4"></div>
<a class="btn btn-primary btn-lg" href="index.php">Go to your monitor</a>
<a class="btn btn-secondary btn-lg" target="_blank" rel="noopener" href="http://www.phpservermonitor.org/">PHP Server Monitor</a>
<a class="btn btn-secondary btn-lg" target="_blank" rel="noopener" href="http://docs.phpservermonitor.org/">Documentation</a>
<a class="btn btn-secondary btn-lg" target="_blank" rel="noopener" href="http://www.phpservermonitor.org/ " target="_blank">PHP Server Monitor</a>
<a class="btn btn-secondary btn-lg" target="_blank" rel="noopener" href="http://docs.phpservermonitor.org/" target="_blank">Documentation</a>
</div>
</div>
{% endblock %}

View File

@ -50,19 +50,19 @@
{% else %}
<i class="fas fa-eye-slash" title="{{ server.active_title }}"></i>
{% endif %}
{% if server.email|lower == 'yes'%}
{% if server.email|lower == 'yes' and config.email|lower%}
<i class="fas fa-envelope" title="{{ label_email }}"></i>
{% endif %}
{% if server.sms|lower == 'yes'%}
{% if server.sms|lower == 'yes' and config.sms|lower%}
<i class="fas fa-sms" title="{{ label_sms }}"></i>
{% endif %}
{% if server.pushover|lower == 'yes'%}
{% if server.pushover|lower == 'yes'and config.pushover|lower %}
<span class="fa-layers">
<i class="fas fa-circle" title="{{ label_pushover }}"></i>
<span class="fa-layers-text fa-inverse" style="font-weight:400; font-size:75%">P</span>
</span>
{% endif %}
{% if server.telegram|lower == 'yes'%}
{% if server.telegram|lower == 'yes' and config.telegram|lower%}
<span class="fa-layers">
<i class="fas fa-circle" title="{{ label_telegram }}"></i>
<span class="fa-layers-text fa-inverse" style="font-weight:400; font-size:75%">T</span>

View File

@ -5,9 +5,8 @@
<div class="row">
{% for server in servers_offline %}
<div class="col-sm-4 col-md-3">
<noscript><a href="{{ server.url_view|raw }}"></noscript>
<div class="card text-white bg-danger mb-3" onclick="window.location.href='{{ server.url_view|raw }}'">
<div class="card-header">{{ server.label }}<span class="sr-only"> ({{ label_offline }})</span></div>
<div class="card-header"><a href="{{ server.url_view|raw }}" class="text-white">{{ server.label }}<span class="sr-only"> ({{ label_offline }})</span></a></div>
<div class="card-body">
<p class="card-text">
{{ label_last_online }}: {{ server.last_online_nice }}<br>
@ -15,14 +14,12 @@
</p>
</div>
</div>
<noscript></a></noscript>
</div>
{% endfor %}
{% for server in servers_warning %}
<div class="col-sm-4 col-md-3">
<noscript><a href="{{ server.url_view|raw }}"></noscript>
<div class="card text-white bg-warning mb-3" onclick="window.location.href='{{ server.url_view|raw }}'">
<div class="card-header">{{ server.label }}<span class="sr-only"> ({{ label_warning }})</span></div>
<div class="card-header"><a href="{{ server.url_view|raw }}" class="text-white">{{ server.label }}<span class="sr-only"> ({{ label_warning }})</span></a></div>
<div class="card-body">
<p class="card-text">
{{ label_last_online }}: {{ server.last_online_nice }}<br>
@ -30,14 +27,12 @@
</p>
</div>
</div>
<noscript></a></noscript>
</div>
{% endfor %}
{% for server in servers_online %}
<div class="col-sm-4 col-md-3">
<noscript><a href="{{ server.url_view|raw }}"></noscript>
<div class="card text-white bg-success mb-3" onclick="window.location.href='{{ server.url_view|raw }}'">
<div class="card-header">{{ server.label }}<span class="sr-only"> ({{ label_online }})</span></div>
<div class="card-header"><a href="{{ server.url_view|raw }}" class="text-white">{{ server.label }}<span class="sr-only"> ({{ label_online }})</span></a></div>
<div class="card-body">
<p class="card-text">
{{ label_last_online }}: {{ server.last_online_nice }}<br>
@ -46,7 +41,6 @@
</p>
</div>
</div>
<noscript></a></noscript>
</div>
{% endfor %}
{% if not servers_offline and not servers_warning and not servers_online %}
@ -72,7 +66,7 @@
<tbody>
{% for server in servers_offline %}
<tr class="bg-danger text-white" onclick="window.location.href='{{ server.url_view|raw }}'">
<th class="full">{{ server.label }}<span class="sr-only"> ({{ label_offline }})</span></th>
<th class="full"><a href="{{ server.url_view|raw }}" class="text-white">{{ server.label }}<span class="sr-only"> ({{ label_offline }})</span></a></th>
<td>{{ server.last_online_nice }}</td>
<td>{{ server.last_checked_nice }}</td>
<td></td>
@ -80,7 +74,7 @@
{% endfor %}
{% for server in servers_warning %}
<tr class="bg-warning text-white" onclick="window.location.href='{{ server.url_view|raw }}'">
<th class="full">{{ server.label }}<span class="sr-only"> ({{ label_warning }})</span></th>
<th class="full"><a href="{{ server.url_view|raw }}" class="text-white">{{ server.label }}<span class="sr-only"> ({{ label_warning }})</span></a></th>
<td>{{ server.last_online_nice }}</td>
<td>{{ server.last_checked_nice }}</td>
<td></td>
@ -100,7 +94,7 @@
<tbody>
{% for server in servers_online %}
<tr class="bg-success text-white" onclick="window.location.href='{{ server.url_view|raw }}'">
<th class="full">{{ server.label }}<span class="sr-only"> ({{ label_online }})</span></th>
<th class="full"><a href="{{ server.url_view|raw }}" class="text-white">{{ server.label }}<span class="sr-only"> ({{ label_online }})</span></a></th>
<td>{{ server.last_online_nice }}</td>
<td>{{ server.last_offline_nice }} {{ server.last_offline_duration_nice }}</td>
<td>{{ server.rtime }}s</td>
@ -130,4 +124,4 @@ setInterval(function() {
});
}, {{ auto_refresh_seconds }} * 1000);
</script>
{% endif %}
{% endif %}

View File

@ -21,7 +21,8 @@
</fieldset>
<!-- Pushover settings -->
<fieldset>
<legend>{{ label_pushover }}</legend>
<legend>{{ label_pushover }}</legend>
<p>{{ label_pushover_description|raw }}</p>
<!-- pushover key -->
{{ macro.input_field("text", "pushover_key", null, "pushover_key", label_pushover_key, pushover_key, label_pushover_key, "255", "pushover_key_help", pushover_key_description) }}
<!-- pushover device -->
@ -29,10 +30,11 @@
</fieldset>
<!-- Telegram settings -->
<fieldset>
<legend>{{ label_telegram }}</legend>
<legend>{{ label_telegram }}</legend>
<p>{{ label_telegram_description|raw }}</p>
<!-- telegram id -->
<div class="form-group">
<a class="btn btn-primary mb-2" href="{{ telegram_get_chat_id_url }}">{{ label_telegram_get_chat_id }}</a>
<a class="btn btn-primary mb-2" href="{{ telegram_get_chat_id_url }}">{{ label_telegram_get_chat_id }}</a>
</div>
{{ macro.input_field("text", "telegram_id", null, "telegram_id", label_telegram_chat_id, telegram_id, label_telegram_chat_id, "255", "telegram_id_help", telegram_id_description) }}
<button class="btn btn-primary show-modal" data-toggle="modal" data-modal-id="activateTelegram">{{ label_activate_telegram }}</button>

0
src/templates/default/static/js/history.js Executable file → Normal file
View File

0
src/templates/default/static/js/scripts.js Executable file → Normal file
View File