diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 19282003..3b079baa 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -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. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 4a439c2d..eee253b6 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -2,7 +2,7 @@ name: Feature request about: Suggest an idea for this project title: "[Feature Request]" -labels: '' +labels: 'Type: Feature' assignees: '' --- diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md index c522ec69..d1b6afb8 100644 --- a/.github/ISSUE_TEMPLATE/question.md +++ b/.github/ISSUE_TEMPLATE/question.md @@ -2,7 +2,7 @@ name: Question about: Ask your questions title: "[Question] " -labels: '' +labels: 'Type: Question' assignees: '' --- diff --git a/Makefile b/Makefile old mode 100755 new mode 100644 diff --git a/README.rst b/README.rst old mode 100755 new mode 100644 diff --git a/composer.json b/composer.json old mode 100755 new mode 100644 diff --git a/config.php.sample b/config.php.sample old mode 100755 new mode 100644 diff --git a/manifest.json b/manifest.json old mode 100755 new mode 100644 diff --git a/phpservermon.png b/phpservermon.png old mode 100755 new mode 100644 diff --git a/service-worker.js b/service-worker.js old mode 100755 new mode 100644 diff --git a/src/includes/functions.inc.php b/src/includes/functions.inc.php index 3036c8fa..689fce0c 100644 --- a/src/includes/functions.inc.php +++ b/src/includes/functions.inc.php @@ -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; diff --git a/src/includes/psmconfig.inc.php b/src/includes/psmconfig.inc.php index 314eccdb..5afcf2d7 100644 --- a/src/includes/psmconfig.inc.php +++ b/src/includes/psmconfig.inc.php @@ -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. diff --git a/src/lang/bg_BG.lang.php b/src/lang/bg_BG.lang.php index 9f15fdbb..c38d7fab 100644 --- a/src/lang/bg_BG.lang.php +++ b/src/lang/bg_BG.lang.php @@ -99,8 +99,8 @@ $sm_lang = array( 'pushover' => 'Pushover', 'pushover_description' => 'Pushover е услуга, която улеснява получаването на известия в реално време. Посетете техния сайт за повече - информация.', + href="https://pushover.net/" target="_blank">техния сайт за + повече информация.', 'pushover_key' => 'Pushover Ключ', 'pushover_device' => 'Pushover Устройство', 'pushover_device_description' => 'Име на устройство, което да получава @@ -232,8 +232,8 @@ $sm_lang = array( 'pushover_status' => 'Позволява изпращането на Pushover съобщения', 'pushover_description' => 'Pushover е услуга, която улеснява получаването на известия в реално време. Посетете техния сайт за повече - информация.', + href="https://pushover.net/" target="_blank">техния сайт за + повече информация.', 'pushover_clone_app' => 'Кликнете тук за да създаване на вашият Pushover App', 'pushover_api_token' => 'Pushover App API Token', 'pushover_api_token_description' => 'Преди да използвате Pushover, трябва да 'Correu', 'pushover' => 'Pushover', 'pushover_description' => 'Pushover és un servei que fa fàcil obtenir notificacions en temps real. Veieu la seva web per a més informació.', + href="https://pushover.net/" target="_blank">la seva web 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' => 'Telegram és una app de missatgeria que - facilita el rebre notificacions en temps real. Consulteu la documentació per a més informació i - per saber com instal·lar-ho.', + 'telegram_description' => 'Telegram és una app de + missatgeria que facilita el rebre notificacions en temps real. Consulteu la documentació 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 al seu portal web i introduïr aquí el Token de la API.', 'telegram_status' => 'Permetre l\'enviament de missatges per Telegram', - 'telegram_description' => 'Telegram és una app de xat (mòbil i PC) que - facilita la recepció de notificacions en temps real. Veieu la documentació per saber més i saber - com activar-ho.', + 'telegram_description' => 'Telegram és una app de xat + (mòbil i PC) que facilita la recepció de notificacions en temps real. Veieu la documentació 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 documentació per saber - més.', + Consulteu la documentació per saber més.', 'alert_type' => 'Seleccioneu quan voleu ser notificats.', 'alert_type_description' => 'Canvi d\'estat: 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.
'E-mail', 'pushover' => 'Pushover', 'pushover_description' => 'Pushover je služba umožňující jednoduše zasílat real-time upozornění. - Více na webu Pushover', + Více na webu Pushover', 'pushover_key' => 'Pushover Token', 'pushover_device' => 'Pushover Zařízení', 'pushover_device_description' => 'Název zařízení, na které má 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 webu Pushover', + Více na webu Pushover', '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 'E-mail', 'pushover' => 'Pushover', 'pushover_description' => 'Pushover er en service der gør det let at modtage real-time notifikationer. Se deres website for mere information.', + href="https://pushover.net/" target="_blank">deres website for mere + information.', 'pushover_key' => 'Pushover nøgle', 'pushover_device' => 'Pushover enhed', 'pushover_device_description' => 'Navnet på 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 deres website for yderligere information.', + href="https://pushover.net/" target="_blank">deres website 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 'E-Mail', 'pushover' => 'Pushover', 'pushover_description' => 'Pushover ist ein Dienst, der es stark vereinfacht, Statusbenachrichtigungen in - Echtzeit zu erhalten. Besuchen Sie pushover.net - für weitere Informationen.', + Echtzeit zu erhalten. Besuchen Sie pushover.net 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 pushover.net - für weitere Informationen.', + Echtzeit zu erhalten. Besuchen Sie pushover.net 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 'Email', 'pushover' => 'Pushover', 'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See their website for more info.', + href="https://pushover.net/" target="_blank">their website 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' => 'Telegram is a chat app that makes it easy to - get real-time notifications. Visit the documentation for more info and an - install guide.', + 'telegram_description' => 'Telegram is a chat app that + makes it easy to get real-time notifications. Visit the documentation 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 their website for more info.', + href="https://pushover.net/" target="_blank">their website 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 register an App at their website and enter the App API Token here.', 'telegram_status' => 'Allow sending Telegram messages', - 'telegram_description' => 'Telegram is a chat app that makes it easy to - get real-time notifications. Visit the documentation for more info and an - install guide.', + 'telegram_description' => 'Telegram is a chat app that + makes it easy to get real-time notifications. Visit the documentation 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 documentation for help.', + href="http://docs.phpservermonitor.org/" + target="_blank">documentation for help.', 'alert_type' => 'Select when you\'d like to be notified.', 'alert_type_description' => 'Status change: You will receive a notification when a server has a change in status. So from online -> offline or offline -> online.

Offline: diff --git a/src/lang/es_ES.lang.php b/src/lang/es_ES.lang.php index ba2b9711..f869320a 100644 --- a/src/lang/es_ES.lang.php +++ b/src/lang/es_ES.lang.php @@ -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 su página web para más - información.', + real. Vea su página web 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' => 'Telegram is a chat app that makes it easy to - get real-time notifications. Visit the documentation for more info and an - install guide.', + 'telegram_description' => 'Telegram is a chat app that + makes it easy to get real-time notifications. Visit the documentation 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 su página web para más - información.', + real. Vea su página web 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 registrar 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' => 'Telegram es una aplicación de mensajería - instantánea que permite recibir notificaciones en tiempo real. Visite la documentación para una guía mas - detallada.', + 'telegram_description' => 'Telegram es una aplicación de + mensajería instantánea que permite recibir notificaciones en tiempo real. Visite + la documentación + 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 documentación para más - información.', + href="http://docs.phpservermonitor.org/" + target="_blank">documentación para más información.', 'alert_type' => '¿Cuándo desea recibir notificaciones?', 'alert_type_description' => 'Al cambiar el estado: p.ej. en línea -> fuera de línea o fuera de línea -> en línea.

Fuera de Línea: Recibirá una notificación cuando diff --git a/src/lang/et_ET.lang.php b/src/lang/et_ET.lang.php index 22921fb5..31d5850f 100644 --- a/src/lang/et_ET.lang.php +++ b/src/lang/et_ET.lang.php @@ -93,7 +93,8 @@ $sm_lang = array( 'email' => 'Email', 'pushover' => 'Pushover', 'pushover_description' => 'Pushover on teenus, mis teeb reaalaja teavitused imelihtsaks. Vaata nende kodulehte rohkema info jaoks.', + href="https://pushover.net/" target="_blank">nende kodulehte 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 nende kodulehte rohkema info jaoks.', + href="https://pushover.net/" target="_blank">nende kodulehte 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 'Pushover', 'pushover_description' => 'Pushover سرویسی است که دریافت اطلاعیه های بلادرنگ را ساده می کند. برای اطلاعات بیشتر سایت آن ها را ببینید.', + href="https://pushover.net/" target="_blank">سایت آن ها را + ببینید.', 'pushover_key' => 'کلید Pushover', 'pushover_device' => 'دستگاه Pushover', 'pushover_device_description' => 'نام دستگاه برای ارسال پیام. برای ارسال به @@ -217,7 +218,8 @@ $sm_lang = array( 'pushover_status' => 'اجازه ارسال پیام های Pushover', 'pushover_description' => 'Pushover سرویسی است که دریافت اطلاعیه های بلادرنگ را ساده می کند. برای اطلاعات بیشتر سایت آن ها را ببینید.', + href="https://pushover.net/" target="_blank">سایت آن ها را + ببینید.', 'pushover_clone_app' => 'برای ایجاد برنامه پوش آور خود اینجا را کلیک کنید.', 'pushover_api_token' => 'رمز API برنامه پوش آور', diff --git a/src/lang/fi_FI.lang.php b/src/lang/fi_FI.lang.php index b0271779..8c3d8da2 100644 --- a/src/lang/fi_FI.lang.php +++ b/src/lang/fi_FI.lang.php @@ -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 - verkkosivuilta lisäinfoa.', + verkkosivuilta 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 - verkkosivuilta lisäinfoa.', + verkkosivuilta 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 'Email', 'pushover' => 'Pushover', 'pushover_description' => 'Pushover est un service qui simplifie les notifications en temps réel. Voir leur site web pour plus d\'informations.', + href="https://pushover.net/" target="_blank">leur site web 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' => 'Telegram est une application de messagerie - instantanée qui facilite la réception de notification en temps réel. Lisez la documentation pour obtenir plus - d\'informations sur la configuration de ce service.', + 'telegram_description' => 'Telegram est une application de + messagerie instantanée qui facilite la réception de notification en temps réel. + Lisez la documentation 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 leur site web pour plus d\'informations.', + href="https://pushover.net/" target="_blank">leur site web 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 créer une application sur leur site web et entrer ici le jeton (Token) de l\'application.', 'telegram_status' => 'Autorise l\'envoi de message Telegram', - 'telegram_description' => 'Telegram est une application de messagerie - instantanée qui facilite la réception de notification en temps réel. Lisez la documentation pour obtenir plus - d\'informations sur la configuration de ce service.', + 'telegram_description' => 'Telegram est une application de + messagerie instantanée qui facilite la réception de notification en temps réel. + Lisez la documentation 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 documentation pour obtenir - de l\'aide.', + Consultez la documentation pour obtenir de l\'aide.', 'alert_type' => 'Choisissez quand vous souhaitez être notifié', 'alert_type_description' => 'Changement d\'état : Vous recevez une notification chaque fois que le serveur change d\'état. C\'est-à-dire passe de l\'état OK à HORS SERVICE diff --git a/src/lang/nl_NL.lang.php b/src/lang/nl_NL.lang.php index bc1da5e1..7ca106a4 100644 --- a/src/lang/nl_NL.lang.php +++ b/src/lang/nl_NL.lang.php @@ -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 hun website voor meer + ontvangen. Zie hun website 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 hun website voor meer + ontvangen. Zie hun website voor meer informatie.', 'pushover_clone_app' => 'Klik hier om je Pushover app te maken', 'pushover_api_token' => 'Pushover App API Token', diff --git a/src/lang/no_NB.lang.php b/src/lang/no_NB.lang.php index d6b2c44e..4e57b36f 100644 --- a/src/lang/no_NB.lang.php +++ b/src/lang/no_NB.lang.php @@ -107,16 +107,16 @@ $sm_lang = array( 'email' => 'E-post', 'pushover' => 'Pushover', 'pushover_description' => 'Pushover er en tjeneste som gjør det enkelt å få meldinger i sanntid. Se deres nettside for mer info.', + href="https://pushover.net/" target="_blank">deres nettside 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' => 'Telegram er en chat-app som gjør det enkelt å - få meldinger i sanntid. Gå til dokumentasjonen for mer informasjon og - en installasjonsguide. ', + 'telegram_description' => 'Telegram er en chat-app som + gjør det enkelt å få meldinger i sanntid. Gå til dokumentasjonen 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 å få meldinger i sanntid. Se deres nettside for mer info.', + href="https://pushover.net/" target="_blank">deres nettside 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, må du registrere en app på deres nettside og angi App API Token her.', 'telegram_status' => 'Tillat sending av Telegram-meldinger', - 'telegram_description' => 'Telegram er en chat-app som gjør det enkelt å - få meldinger i sanntid. Gå til dokumentasjonen for mer informasjon og - en installasjonsveiledning.', + 'telegram_description' => 'Telegram er en chat-app som + gjør det enkelt å få meldinger i sanntid. Gå til dokumentasjonen for + mer informasjon og en installasjonsveiledning.', 'telegram_api_token' => 'Telegram API Token', 'telegram_api_token_description' => 'Før du kan bruke Telegram, må du få en API-token. Gå til dokumentasjonen for å få - hjelp.', + href="http://docs.phpservermonitor.org/" + target="_blank">dokumentasjonen for å få hjelp.', 'alert_type' => 'Velg når du vil bli varslet.', 'alert_type_description' => 'Statusendring: Du vil motta et varsel når en server har endret status. Så fra online -> offline eller offline -> online.

Offline: Du diff --git a/src/lang/pl_PL.lang.php b/src/lang/pl_PL.lang.php index 49dd2158..d5061f0d 100644 --- a/src/lang/pl_PL.lang.php +++ b/src/lang/pl_PL.lang.php @@ -95,7 +95,7 @@ $sm_lang = array( 'email' => 'Email', 'pushover' => 'Pushover', 'pushover_description' => 'Pushover jest usługą szybkich notyfikacji. Sprawdź ich stronę po więcej informacji.', + href="https://pushover.net/" target="_blank">ich stronę 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ź ich stronę aby uzyskać + rzeczywistym. Sprawdź ich stronę aby uzyskać więcej informacji.', 'pushover_clone_app' => 'Kliknij tutaj aby stworzyć aplikację korzystającą z Pushover', 'pushover_api_token' => 'Pushover App API Token', diff --git a/src/lang/pt_BR.lang.php b/src/lang/pt_BR.lang.php index 5017ce68..1b48c183 100644 --- a/src/lang/pt_BR.lang.php +++ b/src/lang/pt_BR.lang.php @@ -93,7 +93,7 @@ $sm_lang = array( 'email' => 'Email', 'pushover' => 'Pushover', 'pushover_description' => 'Pushover para enviar notificações em real-tome. Veja o website para mais informações.', + href="https://pushover.net/" target="_blank">o website 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 o website para mais informações.', + href="https://pushover.net/" target="_blank">o website 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 'Pushover - это сервис, который позволяет легко получать уведомления в режиме реального времени. Больше информации на их веб-сайте.', + href="https://pushover.net/" target="_blank">их веб-сайте.', 'pushover_key' => 'Pushover ключ', 'pushover_device' => 'Pushover устройство', 'pushover_device_description' => 'Имя устройства, на которое будут @@ -121,10 +121,10 @@ $sm_lang = array( пустым, что бы отправлять уведомления на все устройства.', 'telegram' => 'Telegram', - 'telegram_description' => 'Telegram удобный мессенджер + 'telegram_description' => 'Telegram удобный мессенджер для получения уведомлений в реальном времени. Посетите раздел документации + href="http://docs.phpservermonitor.org/" target="_blank">раздел документации для получения доп. информации и инструкций по установке.', 'telegram_chat_id' => 'Telegram chat id', @@ -304,7 +304,7 @@ $sm_lang = array( 'pushover_description' => 'Pushover - это сервис, который позволяет легко получать уведомления в режиме реального времени. Больше информации на их веб-сайте.', + href="https://pushover.net/" target="_blank">их веб-сайте.', '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" на их веб-сайте и ввести "App API Token" сюда.', 'telegram_status' => 'Разрешить отправку уведомлений в Telegram', - 'telegram_description' => 'Telegram удобный мессенджер + 'telegram_description' => 'Telegram удобный мессенджер для получения уведомлений в реальном времени. Посетите раздел документации + href="http://docs.phpservermonitor.org/" target="_blank">раздел документации для получения доп. информации и инструкций по установке.', 'telegram_api_token' => 'Telegram API Token', 'telegram_api_token_description' => 'Прежде чем вы сможете начать пользоваться Telegram, вам необходимо получить API Token. Посетите раздел + href="http://docs.phpservermonitor.org/" target="_blank">раздел документации для получения помощи.', 'alert_type' => 'Тип уведомлений', 'alert_type_description' => 'Изменение статуса: Вы получите diff --git a/src/lang/sl_SI.lang.php b/src/lang/sl_SI.lang.php index da9b046f..16695895 100644 --- a/src/lang/sl_SI.lang.php +++ b/src/lang/sl_SI.lang.php @@ -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 na njihovi spletni + Več informacij je na voljo na njihovi spletni strani.', '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 na njihovi spletni + Več informacij je na voljo na njihovi spletni strani.', 'pushover_clone_app' => 'Kliknite za ustvarjanje vaše Pushover aplikacije', 'pushover_api_token' => 'Pushover API žeton', diff --git a/src/lang/sv_SE.lang.php b/src/lang/sv_SE.lang.php index 37420272..3c6ec8a6 100644 --- a/src/lang/sv_SE.lang.php +++ b/src/lang/sv_SE.lang.php @@ -94,7 +94,7 @@ $sm_lang = array( 'email' => 'Email', 'pushover' => 'Pushover', 'pushover_description' => 'Pushover är en tjänst som skickar meddelande i realtid. Se deras webbsida för mer information.', + href="https://pushover.net/" target="_blank">deras webbsida 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 deras webbsida för mer info.', + href="https://pushover.net/" target="_blank">deras webbsida 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 'E-posta', 'pushover' => 'Pushover', 'pushover_description' => 'Pushover gerçek zamanlı bildirim alabilmek için bir servistir. Daha fazla bilgi - için sitesine bakabilirsiniz.', + için sitesine 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 sitesine bakabilirsiniz.', + için sitesine 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, 'Pushover', 'pushover_description' => 'Pushover — сервіс, що дозволяє легко отримувати сповіщення у реальному часі. За деталями - перейдіть на їхній + перейдіть на їхній вебсайт.', 'pushover_key' => 'Ключ Pushover', 'pushover_device' => 'Пристрій Pushover', @@ -124,11 +124,11 @@ $sm_lang = array( повідомлення. Залиште пустим, щоб надсилати на всі пристрої.', 'telegram' => 'Telegram', - 'telegram_description' => 'Telegram — чат-застосунок, що + 'telegram_description' => 'Telegram — чат-застосунок, що дозволяє легко отримувати сповіщення у реальному часі. За деталями й інструкцією зі встановлення зверніться до документації.', + href="http://docs.phpservermonitor.org/" target="_blank">документації.', 'telegram_chat_id' => 'Ідентифікатор чату Telegram', 'telegram_chat_id_description' => 'Повідомлення буде надіслане у відповідний чат.', @@ -331,7 +331,7 @@ $sm_lang = array( 'pushover_description' => 'Pushover — сервіс, що дозволяє легко отримувати сповіщення у реальному часі. За детальнішою інформацію перейдіть на їхній вебсайт.', + href="https://pushover.net/" target="_blank">їхній вебсайт.', 'pushover_clone_app' => 'Натисніть тут, щоб створити ваш Pushover-додаток', 'pushover_api_token' => 'Токен API Pushover-додатку', 'pushover_api_token_description' => 'Перед використанням Pushover ви маєте на їхньому вебсайті та ввести токен API Додатку тут.', 'telegram_status' => 'Дозволити надсилання Telegram-повідомлень', - 'telegram_description' => 'Telegram — чат-застосунок, що + 'telegram_description' => 'Telegram — чат-застосунок, що дозволяє легко отримувати сповіщення у реальному часі. Детальніша інформація та інструкція зі встановлення доступні у документації.', + href="http://docs.phpservermonitor.org/" target="_blank">документації.', 'telegram_api_token' => 'Токен Telegram API', 'telegram_api_token_description' => 'Перед використанням Telegram ви маєте отримати токен API. За довідкою зверніться до документації.', + href="http://docs.phpservermonitor.org/" target="_blank">документації.', 'alert_type' => 'Виберіть, коли б вам хотілося отримувати сповіщення.', 'alert_type_description' => 'Зміна статусу: Ви отримуватимете diff --git a/src/lang/vi_VN.lang.php b/src/lang/vi_VN.lang.php index 887abe90..fe587d8a 100644 --- a/src/lang/vi_VN.lang.php +++ b/src/lang/vi_VN.lang.php @@ -91,7 +91,7 @@ $sm_lang = array( 'email' => 'Email', 'pushover' => 'Pushover', 'pushover_description' => 'Pushover là một dịch vụ dễ dàng nhận các thông báo theo thời gian - thực. Xem website của họ để biết + thực. Xem website của họ để 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 là một dịch vụ dễ dàng nhận các thông báo theo thời gian - thực. Xem website của họ để biết + thực. Xem website của họ để 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', diff --git a/src/lang/zh_TW.lang.php b/src/lang/zh_TW.lang.php index 47b73a9f..29157d84 100644 --- a/src/lang/zh_TW.lang.php +++ b/src/lang/zh_TW.lang.php @@ -110,9 +110,9 @@ $sm_lang = array( 'pushover_device' => 'Pushover 裝置', 'pushover_device_description' => '發送訊息的裝置名稱,若保留空白,將會發送到所有的裝置。', 'telegram' => 'Telegram 通知', - 'telegram_description' => 'Telegram + 'telegram_description' => 'Telegram 是一種聊天應用程式,它提供很容易使用的的即時通知能力。您可以到 - documentation + documentation 了解更多的內容。', '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是線上服務,讓您可以方便的收到即時通知,請參考 網站 可以得到更詳細的資訊。 ', + href="https://pushover.net/" target="_blank"> 網站 可以得到更詳細的資訊。 ', 'pushover_clone_app' => '點選這裡可快速建立Pushover App', 'pushover_api_token_description' => '在您使用 Pushover 通知之前,需要先到這裡->註冊Pushover App帳號 接著在這個網頁輸入你的的Pushover App API Token號碼。', 'telegram_status' => '允許發送 Telegram 訊息', - 'telegram_description' => 'Telegram + 'telegram_description' => 'Telegram 是一種聊天應用程式,它提供很容易使用的即時通知服務。請參考 - 文件庫 + 文件庫 可以取得更多資訊與安裝說明。', 'telegram_api_token_description' => '使用 Telegram 通知之前,您必需先取得 API Token。請到 文件庫 取得說明。', + href="http://docs.phpservermonitor.org/" target="_blank">文件庫 取得說明。', 'alert_type' => '需要提醒的類別', 'alert_type_description' => '狀態改變: 伺服器 連線 -> 離線或連線 -> 連線的狀態變化將會收到提醒通知。

離線: diff --git a/src/psm/Module/Config/Controller/ConfigController.php b/src/psm/Module/Config/Controller/ConfigController.php index 52b6920c..0dd3f9b2 100644 --- a/src/psm/Module/Config/Controller/ConfigController.php +++ b/src/psm/Module/Config/Controller/ConfigController.php @@ -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'), ); } diff --git a/src/psm/Module/Server/Controller/ServerController.php b/src/psm/Module/Server/Controller/ServerController.php index ab27dd68..eeef0336 100644 --- a/src/psm/Module/Server/Controller/ServerController.php +++ b/src/psm/Module/Server/Controller/ServerController.php @@ -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'] = '' . $ip . ''; } + 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); } diff --git a/src/psm/Module/User/Controller/UserController.php b/src/psm/Module/User/Controller/UserController.php index 496c0826..58247049 100644 --- a/src/psm/Module/User/Controller/UserController.php +++ b/src/psm/Module/User/Controller/UserController.php @@ -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'), diff --git a/src/psm/Txtmsg/FreeVoipDeal.php b/src/psm/Txtmsg/FreeVoipDeal.php old mode 100755 new mode 100644 diff --git a/src/psm/Util/Install/Installer.php b/src/psm/Util/Install/Installer.php index 78f078c9..78e93ae3 100644 --- a/src/psm/Util/Install/Installer.php +++ b/src/psm/Util/Install/Installer.php @@ -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); } } diff --git a/src/psm/Util/Server/Updater/StatusUpdater.php b/src/psm/Util/Server/Updater/StatusUpdater.php index da0cb72e..22bcab59 100644 --- a/src/psm/Util/Server/Updater/StatusUpdater.php +++ b/src/psm/Util/Server/Updater/StatusUpdater.php @@ -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; diff --git a/src/templates/default/module/config/config.tpl.html b/src/templates/default/module/config/config.tpl.html index 48b2730c..a5c4086c 100644 --- a/src/templates/default/module/config/config.tpl.html +++ b/src/templates/default/module/config/config.tpl.html @@ -99,7 +99,7 @@ {{ macro.input_field("text", "email_smtp_username", null, "email_smtp_username", label_email_smtp_username, email_smtp_username, label_email_smtp_username, "255") }} - {{ 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 @@
{{ label_settings_pushover }} +

{{ label_pushover_description|raw }}

{{ macro.input_checkbox("pushover_status", "pushover_status", label_pushover_status, pushover_status_checked) }} @@ -143,6 +144,7 @@
{{ label_settings_telegram }} +

{{ label_telegram_description|raw }}

{{ macro.input_checkbox("telegram_status", "telegram_status[]", label_telegram_status, telegram_status_checked) }} diff --git a/src/templates/default/module/install/success.tpl.html b/src/templates/default/module/install/success.tpl.html index dc369a9d..cdc3f577 100644 --- a/src/templates/default/module/install/success.tpl.html +++ b/src/templates/default/module/install/success.tpl.html @@ -12,8 +12,8 @@ If no errors have occurred, you are good to go.

Go to your monitor - PHP Server Monitor - Documentation + PHP Server Monitor + Documentation
{% endblock %} \ No newline at end of file diff --git a/src/templates/default/module/server/server/list.tpl.html b/src/templates/default/module/server/server/list.tpl.html index 3a01ac82..70b6dfd7 100644 --- a/src/templates/default/module/server/server/list.tpl.html +++ b/src/templates/default/module/server/server/list.tpl.html @@ -50,19 +50,19 @@ {% else %} {% endif %} - {% if server.email|lower == 'yes'%} + {% if server.email|lower == 'yes' and config.email|lower%} {% endif %} - {% if server.sms|lower == 'yes'%} + {% if server.sms|lower == 'yes' and config.sms|lower%} {% endif %} - {% if server.pushover|lower == 'yes'%} + {% if server.pushover|lower == 'yes'and config.pushover|lower %} P {% endif %} - {% if server.telegram|lower == 'yes'%} + {% if server.telegram|lower == 'yes' and config.telegram|lower%} T diff --git a/src/templates/default/module/server/status/index.tpl.html b/src/templates/default/module/server/status/index.tpl.html index 38abc58a..7a564127 100644 --- a/src/templates/default/module/server/status/index.tpl.html +++ b/src/templates/default/module/server/status/index.tpl.html @@ -5,9 +5,8 @@
{% for server in servers_offline %}
-
-
{{ server.label }} ({{ label_offline }})
+

{{ label_last_online }}: {{ server.last_online_nice }}
@@ -15,14 +14,12 @@

-
{% endfor %} {% for server in servers_warning %}
-
-
{{ server.label }} ({{ label_warning }})
+

{{ label_last_online }}: {{ server.last_online_nice }}
@@ -30,14 +27,12 @@

-
{% endfor %} {% for server in servers_online %}
-
-
{{ server.label }} ({{ label_online }})
+

{{ label_last_online }}: {{ server.last_online_nice }}
@@ -46,7 +41,6 @@

-
{% endfor %} {% if not servers_offline and not servers_warning and not servers_online %} @@ -72,7 +66,7 @@ {% for server in servers_offline %} - {{ server.label }} ({{ label_offline }}) + {{ server.label }} ({{ label_offline }}) {{ server.last_online_nice }} {{ server.last_checked_nice }} @@ -80,7 +74,7 @@ {% endfor %} {% for server in servers_warning %} - {{ server.label }} ({{ label_warning }}) + {{ server.label }} ({{ label_warning }}) {{ server.last_online_nice }} {{ server.last_checked_nice }} @@ -100,7 +94,7 @@ {% for server in servers_online %} - {{ server.label }} ({{ label_online }}) + {{ server.label }} ({{ label_online }}) {{ server.last_online_nice }} {{ server.last_offline_nice }} {{ server.last_offline_duration_nice }} {{ server.rtime }}s @@ -130,4 +124,4 @@ setInterval(function() { }); }, {{ auto_refresh_seconds }} * 1000); -{% endif %} \ No newline at end of file +{% endif %} diff --git a/src/templates/default/module/user/profile.tpl.html b/src/templates/default/module/user/profile.tpl.html index e1768b88..dbf9012e 100644 --- a/src/templates/default/module/user/profile.tpl.html +++ b/src/templates/default/module/user/profile.tpl.html @@ -21,7 +21,8 @@
- {{ label_pushover }} + {{ label_pushover }} +

{{ label_pushover_description|raw }}

{{ macro.input_field("text", "pushover_key", null, "pushover_key", label_pushover_key, pushover_key, label_pushover_key, "255", "pushover_key_help", pushover_key_description) }} @@ -29,10 +30,11 @@
- {{ label_telegram }} + {{ label_telegram }} +

{{ label_telegram_description|raw }}

{{ 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) }} diff --git a/src/templates/default/static/js/history.js b/src/templates/default/static/js/history.js old mode 100755 new mode 100644 diff --git a/src/templates/default/static/js/scripts.js b/src/templates/default/static/js/scripts.js old mode 100755 new mode 100644