Merge branch 'develop' into labsmobileSMS

This commit is contained in:
Tim 2021-05-31 04:10:04 +02:00 committed by GitHub
commit 2cc38a386c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
48 changed files with 2397 additions and 664 deletions

6
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "daily"

View File

@ -5,7 +5,7 @@ PHP Server Monitor
:alt: Join the chat at https://gitter.im/erickrf/nlpnet
:target: https://gitter.im/phpservermon/phpservermon
Version 3.5.2
Version 3.6.0.beta2
PHP Server Monitor is a script that checks whether your websites and servers are up and running.
It comes with a web based user interface where you can manage your services and websites,
@ -16,7 +16,7 @@ Features:
---------
* Monitor services and websites (see below).
* Email, SMS, Pushover, Telegram and Jabber notifications.
* Email, SMS, Discord, Pushover, Telegram and Jabber notifications.
* View history graphs of uptime and latency.
* User authentication with 2 levels (administrator and regular user).
* Logs of connection errors, outgoing emails and text messages.
@ -46,22 +46,24 @@ The following SMS gateways are currently available:
* Inetworx - <https://www.inetworx.ch>
* Messagebird - <https://www.messagebird.com>
* Mosms - <https://www.mosms.com>
* Smsglobal - <https://smsglobal.com/>
* SMSit - <https://www.smsit.dk/>
* Smsglobal - <https://smsglobal.com>
* SMSit - <https://www.smsit.dk>
* Spryng - <https://www.spryng.nl>
* Textmarketer - <https://www.textmarketer.co.uk>
* FreeVoipDeal - <https://www.freevoipdeal.com>
* Nexmo - <https://www.nexmo.com/>
* OctoPush - <https://www.octopush.com/>
* FreeMobile (FR) - <https://mobile.free.fr/>
* Nexmo - <https://www.nexmo.com>
* OctoPush - <https://www.octopush.com>
* FreeMobile (FR) - <https://mobile.free.fr>
* Twilio - <https://twilio.com>
* CM Telecom - <https://www.cm.com/>
* GatewayAPI - <https://gatewayapi.com/>
* SolutionsInfini - <https://solutionsinfini.com/>
* Plivo - <https://www.plivo.com/>
* Callr - <https://www.callr.com/>
* CM Telecom - <https://www.cm.com>
* GatewayAPI - <https://gatewayapi.com>
* SolutionsInfini - <https://solutionsinfini.com>
* Plivo - <https://www.plivo.com>
* Callr - <https://www.callr.com>
* SMSAPI - <https://www.smsapi.com/en>
* OVH SMS PRO - <https://www.ovhtelecom.fr/sms/>
* OVH SMS PRO - <https://www.ovhtelecom.fr/sms>
* PromoSMS - <https://promosms.com>
* Infobip - <https://www.infobip.com>
* LabsMobile - <https://www.labsmobile.com>
Please note: for these gateways you will need an account with sufficient credits.

View File

@ -6,9 +6,10 @@
"require": {
"php": "^5.5.9|>=7.0.8",
"ext-curl": "*",
"ext-json": "*",
"ext-pdo": "*",
"ext-xml": "*",
"phpmailer/phpmailer": ">=6.0.6 ~6.0",
"phpmailer/phpmailer": ">=6.4.1 ~6.0",
"symfony/config": "~3.4",
"symfony/dependency-injection": "~3.4",
"symfony/event-dispatcher": "~3.4",
@ -17,7 +18,8 @@
"php-pushover/php-pushover": "dev-master",
"paragonie/random_compat": "^2.0",
"twig/twig": "~1.35",
"jaxl/jaxl": "^3.1"
"jaxl/jaxl": "^3.1",
"viharm/psm-ldap-auth": "^1.1"
},
"autoload": {
"files": [

460
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "f78e950e2dfef7debe88d7b64e2b4aec",
"content-hash": "21bf20f2a7d6602e659723ca99c80d66",
"packages": [
{
"name": "jaxl/jaxl",
@ -80,17 +80,69 @@
"time": "2016-09-13T01:59:35+00:00"
},
{
"name": "paragonie/random_compat",
"version": "v2.0.18",
"name": "mnsami/composer-custom-directory-installer",
"version": "1.1.1",
"source": {
"type": "git",
"url": "https://github.com/paragonie/random_compat.git",
"reference": "0a58ef6e3146256cc3dc7cc393927bcc7d1b72db"
"url": "https://github.com/mnsami/composer-custom-directory-installer.git",
"reference": "8cc82e0c5801cc3bf53ba452afdcaa5c6ff645a5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/0a58ef6e3146256cc3dc7cc393927bcc7d1b72db",
"reference": "0a58ef6e3146256cc3dc7cc393927bcc7d1b72db",
"url": "https://api.github.com/repos/mnsami/composer-custom-directory-installer/zipball/8cc82e0c5801cc3bf53ba452afdcaa5c6ff645a5",
"reference": "8cc82e0c5801cc3bf53ba452afdcaa5c6ff645a5",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.0",
"php": ">=5.3"
},
"type": "composer-plugin",
"extra": {
"class": [
"Composer\\CustomDirectoryInstaller\\LibraryPlugin",
"Composer\\CustomDirectoryInstaller\\PearPlugin",
"Composer\\CustomDirectoryInstaller\\PluginPlugin"
],
"branch-alias": {
"dev-master": "1.1.x-dev"
}
},
"autoload": {
"psr-0": {
"Composer\\CustomDirectoryInstaller": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mina Nabil Sami",
"email": "mina.nsami@gmail.com"
}
],
"description": "A composer plugin, to help install packages of different types in custom paths.",
"keywords": [
"composer",
"composer-installer",
"composer-plugin"
],
"time": "2016-05-25T08:26:02+00:00"
},
{
"name": "paragonie/random_compat",
"version": "v2.0.20",
"source": {
"type": "git",
"url": "https://github.com/paragonie/random_compat.git",
"reference": "0f1f60250fccffeaf5dda91eea1c018aed1adc2a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/0f1f60250fccffeaf5dda91eea1c018aed1adc2a",
"reference": "0f1f60250fccffeaf5dda91eea1c018aed1adc2a",
"shasum": ""
},
"require": {
@ -126,7 +178,7 @@
"pseudorandom",
"random"
],
"time": "2019-01-03T20:59:08+00:00"
"time": "2021-04-17T09:33:01+00:00"
},
{
"name": "php-pushover/php-pushover",
@ -134,12 +186,12 @@
"source": {
"type": "git",
"url": "https://github.com/cschalenborgh/php-pushover.git",
"reference": "b2d060efacf48e4c6821427691b19db0315ccedd"
"reference": "ef1df985bf3acb17b1f1f8fe2df2c3c9a16bef32"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/cschalenborgh/php-pushover/zipball/b2d060efacf48e4c6821427691b19db0315ccedd",
"reference": "b2d060efacf48e4c6821427691b19db0315ccedd",
"url": "https://api.github.com/repos/cschalenborgh/php-pushover/zipball/ef1df985bf3acb17b1f1f8fe2df2c3c9a16bef32",
"reference": "ef1df985bf3acb17b1f1f8fe2df2c3c9a16bef32",
"shasum": ""
},
"type": "library",
@ -156,34 +208,38 @@
}
],
"description": "PHP class for the Pushover.net project",
"time": "2019-09-26T19:38:11+00:00"
"time": "2021-01-12T12:43:39+00:00"
},
{
"name": "phpmailer/phpmailer",
"version": "v6.1.6",
"version": "v6.4.1",
"source": {
"type": "git",
"url": "https://github.com/PHPMailer/PHPMailer.git",
"reference": "c2796cb1cb99d7717290b48c4e6f32cb6c60b7b3"
"reference": "9256f12d8fb0cd0500f93b19e18c356906cbed3d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/c2796cb1cb99d7717290b48c4e6f32cb6c60b7b3",
"reference": "c2796cb1cb99d7717290b48c4e6f32cb6c60b7b3",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/9256f12d8fb0cd0500f93b19e18c356906cbed3d",
"reference": "9256f12d8fb0cd0500f93b19e18c356906cbed3d",
"shasum": ""
},
"require": {
"ext-ctype": "*",
"ext-filter": "*",
"ext-hash": "*",
"php": ">=5.5.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"doctrine/annotations": "^1.2",
"friendsofphp/php-cs-fixer": "^2.2",
"phpunit/phpunit": "^4.8 || ^5.7"
"phpcompatibility/php-compatibility": "^9.3.5",
"roave/security-advisories": "dev-latest",
"squizlabs/php_codesniffer": "^3.5.6",
"yoast/phpunit-polyfills": "^0.2.0"
},
"suggest": {
"ext-mbstring": "Needed to send email in multibyte encoding charset",
"ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses",
"hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication",
"league/oauth2-google": "Needed for Google XOAUTH2 authentication",
"psr/log": "For optional PSR-3 debug logging",
@ -218,31 +274,26 @@
}
],
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"time": "2020-05-27T12:24:03+00:00"
"time": "2021-04-29T12:25:04+00:00"
},
{
"name": "psr/container",
"version": "1.0.0",
"version": "1.1.1",
"source": {
"type": "git",
"url": "https://github.com/php-fig/container.git",
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f"
"reference": "8622567409010282b7aeebe4bb841fe98b58dcaf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
"url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf",
"reference": "8622567409010282b7aeebe4bb841fe98b58dcaf",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
"php": ">=7.2.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Container\\": "src/"
@ -255,7 +306,7 @@
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common Container Interface (PHP FIG PSR-11)",
@ -267,20 +318,20 @@
"container-interop",
"psr"
],
"time": "2017-02-14T16:28:37+00:00"
"time": "2021-03-05T17:36:06+00:00"
},
{
"name": "symfony/config",
"version": "v3.4.36",
"version": "v3.4.47",
"source": {
"type": "git",
"url": "https://github.com/symfony/config.git",
"reference": "a599a867d0e4a07c342b5f1e656b3915a540ddbe"
"reference": "bc6b3fd3930d4b53a60b42fe2ed6fc466b75f03f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/config/zipball/a599a867d0e4a07c342b5f1e656b3915a540ddbe",
"reference": "a599a867d0e4a07c342b5f1e656b3915a540ddbe",
"url": "https://api.github.com/repos/symfony/config/zipball/bc6b3fd3930d4b53a60b42fe2ed6fc466b75f03f",
"reference": "bc6b3fd3930d4b53a60b42fe2ed6fc466b75f03f",
"shasum": ""
},
"require": {
@ -302,11 +353,6 @@
"symfony/yaml": "To use the yaml reference dumper"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.4-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Config\\": ""
@ -331,20 +377,20 @@
],
"description": "Symfony Config Component",
"homepage": "https://symfony.com",
"time": "2019-12-01T10:45:41+00:00"
"time": "2020-10-24T10:57:07+00:00"
},
{
"name": "symfony/dependency-injection",
"version": "v3.4.36",
"version": "v3.4.47",
"source": {
"type": "git",
"url": "https://github.com/symfony/dependency-injection.git",
"reference": "0d201916bfb3af939fec3c0c8815ea16c60ac1a2"
"reference": "51d2a2708c6ceadad84393f8581df1dcf9e5e84b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/0d201916bfb3af939fec3c0c8815ea16c60ac1a2",
"reference": "0d201916bfb3af939fec3c0c8815ea16c60ac1a2",
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/51d2a2708c6ceadad84393f8581df1dcf9e5e84b",
"reference": "51d2a2708c6ceadad84393f8581df1dcf9e5e84b",
"shasum": ""
},
"require": {
@ -373,11 +419,6 @@
"symfony/yaml": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.4-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\DependencyInjection\\": ""
@ -402,20 +443,20 @@
],
"description": "Symfony DependencyInjection Component",
"homepage": "https://symfony.com",
"time": "2019-12-01T08:33:36+00:00"
"time": "2020-10-24T10:57:07+00:00"
},
{
"name": "symfony/event-dispatcher",
"version": "v3.4.36",
"version": "v3.4.47",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
"reference": "f9031c22ec127d4a2450760f81a8677fe8a10177"
"reference": "31fde73757b6bad247c54597beef974919ec6860"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/f9031c22ec127d4a2450760f81a8677fe8a10177",
"reference": "f9031c22ec127d4a2450760f81a8677fe8a10177",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/31fde73757b6bad247c54597beef974919ec6860",
"reference": "31fde73757b6bad247c54597beef974919ec6860",
"shasum": ""
},
"require": {
@ -427,6 +468,7 @@
"require-dev": {
"psr/log": "~1.0",
"symfony/config": "~2.8|~3.0|~4.0",
"symfony/debug": "~3.4|~4.4",
"symfony/dependency-injection": "~3.3|~4.0",
"symfony/expression-language": "~2.8|~3.0|~4.0",
"symfony/stopwatch": "~2.8|~3.0|~4.0"
@ -436,11 +478,6 @@
"symfony/http-kernel": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.4-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\EventDispatcher\\": ""
@ -465,20 +502,20 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
"time": "2019-10-24T15:33:53+00:00"
"time": "2020-10-24T10:57:07+00:00"
},
{
"name": "symfony/filesystem",
"version": "v3.4.36",
"version": "v3.4.47",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
"reference": "00cdad0936d06fab136944bc2342b762b1c3a4a2"
"reference": "e58d7841cddfed6e846829040dca2cca0ebbbbb3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/00cdad0936d06fab136944bc2342b762b1c3a4a2",
"reference": "00cdad0936d06fab136944bc2342b762b1c3a4a2",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/e58d7841cddfed6e846829040dca2cca0ebbbbb3",
"reference": "e58d7841cddfed6e846829040dca2cca0ebbbbb3",
"shasum": ""
},
"require": {
@ -486,11 +523,6 @@
"symfony/polyfill-ctype": "~1.8"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.4-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Filesystem\\": ""
@ -515,20 +547,20 @@
],
"description": "Symfony Filesystem Component",
"homepage": "https://symfony.com",
"time": "2019-11-25T16:36:22+00:00"
"time": "2020-10-24T10:57:07+00:00"
},
{
"name": "symfony/http-foundation",
"version": "v3.4.36",
"version": "v3.4.47",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
"reference": "d2d0cfe8e319d9df44c4cca570710fcf221d4593"
"reference": "b9885fcce6fe494201da4f70a9309770e9d13dc8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/d2d0cfe8e319d9df44c4cca570710fcf221d4593",
"reference": "d2d0cfe8e319d9df44c4cca570710fcf221d4593",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/b9885fcce6fe494201da4f70a9309770e9d13dc8",
"reference": "b9885fcce6fe494201da4f70a9309770e9d13dc8",
"shasum": ""
},
"require": {
@ -540,11 +572,6 @@
"symfony/expression-language": "~2.8|~3.0|~4.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.4-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\HttpFoundation\\": ""
@ -569,24 +596,24 @@
],
"description": "Symfony HttpFoundation Component",
"homepage": "https://symfony.com",
"time": "2019-11-28T12:52:59+00:00"
"time": "2020-10-24T10:57:07+00:00"
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.13.1",
"version": "v1.22.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3"
"reference": "c6c942b1ac76c82448322025e084cadc56048b4e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f8f0b461be3385e56d6de3dbb5a0df24c0c275e3",
"reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/c6c942b1ac76c82448322025e084cadc56048b4e",
"reference": "c6c942b1ac76c82448322025e084cadc56048b4e",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
"php": ">=7.1"
},
"suggest": {
"ext-ctype": "For best performance"
@ -594,7 +621,11 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.13-dev"
"dev-main": "1.22-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
@ -627,24 +658,24 @@
"polyfill",
"portable"
],
"time": "2019-11-27T13:56:44+00:00"
"time": "2021-01-07T16:49:33+00:00"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.13.1",
"version": "v1.22.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "7b4aab9743c30be783b73de055d24a39cf4b954f"
"reference": "5232de97ee3b75b0360528dae24e73db49566ab1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7b4aab9743c30be783b73de055d24a39cf4b954f",
"reference": "7b4aab9743c30be783b73de055d24a39cf4b954f",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/5232de97ee3b75b0360528dae24e73db49566ab1",
"reference": "5232de97ee3b75b0360528dae24e73db49566ab1",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
"php": ">=7.1"
},
"suggest": {
"ext-mbstring": "For best performance"
@ -652,7 +683,11 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.13-dev"
"dev-main": "1.22-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
@ -686,42 +721,34 @@
"portable",
"shim"
],
"time": "2019-11-27T14:18:11+00:00"
"time": "2021-01-22T09:19:47+00:00"
},
{
"name": "symfony/polyfill-php70",
"version": "v1.13.1",
"version": "v1.20.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php70.git",
"reference": "af23c7bb26a73b850840823662dda371484926c4"
"reference": "5f03a781d984aae42cebd18e7912fa80f02ee644"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/af23c7bb26a73b850840823662dda371484926c4",
"reference": "af23c7bb26a73b850840823662dda371484926c4",
"url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/5f03a781d984aae42cebd18e7912fa80f02ee644",
"reference": "5f03a781d984aae42cebd18e7912fa80f02ee644",
"shasum": ""
},
"require": {
"paragonie/random_compat": "~1.0|~2.0|~9.99",
"php": ">=5.3.3"
"php": ">=7.1"
},
"type": "library",
"type": "metapackage",
"extra": {
"branch-alias": {
"dev-master": "1.13-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Php70\\": ""
"dev-main": "1.20-dev"
},
"files": [
"bootstrap.php"
],
"classmap": [
"Resources/stubs"
]
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@ -745,35 +772,34 @@
"portable",
"shim"
],
"time": "2019-11-27T13:56:44+00:00"
"time": "2020-10-23T14:02:19+00:00"
},
{
"name": "twig/twig",
"version": "v1.42.4",
"version": "v1.44.2",
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
"reference": "e587180584c3d2d6cb864a0454e777bb6dcb6152"
"reference": "138c493c5b8ee7cff3821f80b8896d371366b5fe"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/e587180584c3d2d6cb864a0454e777bb6dcb6152",
"reference": "e587180584c3d2d6cb864a0454e777bb6dcb6152",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/138c493c5b8ee7cff3821f80b8896d371366b5fe",
"reference": "138c493c5b8ee7cff3821f80b8896d371366b5fe",
"shasum": ""
},
"require": {
"php": ">=5.5.0",
"php": ">=7.2.5",
"symfony/polyfill-ctype": "^1.8"
},
"require-dev": {
"psr/container": "^1.0",
"symfony/debug": "^3.4|^4.2",
"symfony/phpunit-bridge": "^4.4@dev|^5.0"
"symfony/phpunit-bridge": "^4.4.9|^5.0.9"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.42-dev"
"dev-master": "1.44-dev"
}
},
"autoload": {
@ -797,7 +823,6 @@
},
{
"name": "Twig Team",
"homepage": "https://twig.symfony.com/contributors",
"role": "Contributors"
},
{
@ -811,7 +836,189 @@
"keywords": [
"templating"
],
"time": "2019-11-11T16:49:32+00:00"
"time": "2021-01-05T10:10:05+00:00"
},
{
"name": "viharm/php-db-auth",
"version": "v2.7.0",
"source": {
"type": "git",
"url": "https://bitbucket.org/viharm/phpdbauth.git",
"reference": "60c1b0a28d26178d5e4960d49185af85734643c6"
},
"dist": {
"type": "zip",
"url": "https://bitbucket.org/viharm/phpdbauth/get/60c1b0a28d26178d5e4960d49185af85734643c6.zip",
"reference": "60c1b0a28d26178d5e4960d49185af85734643c6",
"shasum": ""
},
"require": {
"mnsami/composer-custom-directory-installer": "1.1.*",
"php": ">=5.3.0",
"viharm/php-khelper": "^1.4.1"
},
"type": "library",
"extra": {
"installer-paths": {
"./Lib/phpKhelper": [
"viharm/php-khelper"
]
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Viharm",
"email": "viharm@malviya.net",
"homepage": "http://viharm.malviya.net",
"role": "Developer"
}
],
"description": "PHP library for looking up users in a database table field",
"homepage": "https://bitbucket.org/viharm/phpdbauth",
"keywords": [
"auth",
"database",
"php"
],
"time": "2020-01-05T11:48:12+00:00"
},
{
"name": "viharm/php-khelper",
"version": "v1.4.1",
"source": {
"type": "git",
"url": "https://gitlab.com/viharm/phpKhelper.git",
"reference": "92aea82d609d3c9dc39952c9e386578f532e7140"
},
"dist": {
"type": "zip",
"url": "https://gitlab.com/api/v4/projects/viharm%2FphpKhelper/repository/archive.zip?sha=92aea82d609d3c9dc39952c9e386578f532e7140",
"reference": "92aea82d609d3c9dc39952c9e386578f532e7140",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Viharm",
"email": "viharm@malviya.net",
"homepage": "http://viharm.malviya.net",
"role": "Developer"
}
],
"description": "A companion PHP library to accompany Kint (http://kint-php.github.io/kint/)",
"homepage": "https://gitlab.com/viharm/phpKhelper",
"keywords": [
"debug",
"kint",
"php"
],
"time": "2018-09-15T08:27:02+00:00"
},
{
"name": "viharm/php-ldap-auth",
"version": "v2.5.1",
"source": {
"type": "git",
"url": "https://bitbucket.org/viharm/phpldapauth.git",
"reference": "3a60e626bfb63eda786dad30f09bd75fd5172cb1"
},
"dist": {
"type": "zip",
"url": "https://bitbucket.org/viharm/phpldapauth/get/3a60e626bfb63eda786dad30f09bd75fd5172cb1.zip",
"reference": "3a60e626bfb63eda786dad30f09bd75fd5172cb1",
"shasum": ""
},
"require": {
"mnsami/composer-custom-directory-installer": "1.1.*",
"php": ">=5.3.0",
"viharm/php-khelper": "^1.4.1"
},
"type": "library",
"extra": {
"installer-paths": {
"./Lib/phpKhelper": [
"viharm/php-khelper"
]
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Viharm",
"email": "viharm@malviya.net",
"homepage": "http://viharm.malviya.net",
"role": "Developer"
}
],
"description": "PHP library for authenticating with a directory server",
"homepage": "https://bitbucket.org/viharm/phpldapauth",
"keywords": [
"ad",
"auth",
"ldap",
"openldap",
"php"
],
"time": "2020-11-24T21:56:47+00:00"
},
{
"name": "viharm/psm-ldap-auth",
"version": "v1.1.3",
"source": {
"type": "git",
"url": "https://gitlab.com/viharm/PsmLDAPauth.git",
"reference": "1addeb0403a19e457f2c622a67156f52568da308"
},
"dist": {
"type": "zip",
"url": "https://gitlab.com/api/v4/projects/viharm%2FPsmLDAPauth/repository/archive.zip?sha=1addeb0403a19e457f2c622a67156f52568da308",
"reference": "1addeb0403a19e457f2c622a67156f52568da308",
"shasum": ""
},
"require": {
"php": ">=5.3.0",
"viharm/php-db-auth": "^2.6.0",
"viharm/php-ldap-auth": "^2.4.0"
},
"type": "library",
"notification-url": "https://packagist.org/downloads/",
"license": [
"GPL-3.0-only"
],
"authors": [
{
"name": "Viharm",
"email": "viharm@malviya.net",
"homepage": "http://viharm.malviya.net",
"role": "Developer"
}
],
"description": "Module for authenticating PHP Server Monitor users against a directory",
"homepage": "https://gitlab.com/viharm/PsmLDAPauth",
"keywords": [
"ad",
"auth",
"ldap",
"openldap",
"php",
"php server monitor",
"psm"
],
"time": "2020-11-24T22:57:57+00:00"
}
],
"packages-dev": [],
@ -825,6 +1032,7 @@
"platform": {
"php": "^5.5.9|>=7.0.8",
"ext-curl": "*",
"ext-json": "*",
"ext-pdo": "*",
"ext-xml": "*"
},

View File

@ -7,3 +7,4 @@ define('PSM_DB_HOST', 'localhost');
define('PSM_DB_PORT', '3306'); //3306 is the default port for MySQL. If no specfic port is used, leave it empty.
define('PSM_BASE_URL', '');
define('PSM_WEBCRON_KEY', '');
define('PSM_PUBLIC', false);

View File

@ -51,9 +51,9 @@ copyright = u'2008-2017, Pepijn Over'
# built documents.
#
# The short X.Y version.
version = '3.5'
version = '3.6'
# The full version, including alpha/beta/rc tags.
release = '3.5.2'
release = '3.6.0.beta2'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.

View File

@ -89,6 +89,14 @@ The following people have contributed to the development of PHP Server Monitor:
* SMSAPI gateway
* Daniel Krusky - https://github.com/dkrusky
* Discord webhook support
* Łukasz Szczepański - https://github.com/NixNotCastey
* PromoSMS gateway
Translators
+++++++++++
@ -196,4 +204,4 @@ The following libraries are being used by PHP Server Monitor:
* PHP-Pushover - https://github.com/kryap/php-pushover
* Symfony - https://symfony.com
* Random_compat - https://github.com/paragonie/random_compat
* Hammer.js - https://github.com/hammerjs/hammer.js
* Hammer.js - https://github.com/hammerjs/hammer.js

View File

@ -10,7 +10,7 @@ Users
What are the differences between the user levels?
-------------------------------------------------
There are 2 user levels available: regular user and administrator.
There are 3 user levels available: anonymous, regular user and administrator.
Administrators:
@ -24,6 +24,16 @@ Regular users:
* View the history and logs of their assigned servers.
* Run the updater on their assigned servers.
Anonymous:
Only meant for user '__PUBLIC__' and can't be assigned to any other user.
* View the status of their assigned servers without password.
I removed user '__PUBLIC__', what now?
--------------------------------------
* Go to users -> create new user.
* Set the username to '__PUBLIC__', level to 'anonymous' and the rest is up to you.
Servers
+++++++
@ -101,6 +111,14 @@ After upgrading, my email stopped working.
Run 'php composer.phar update' and you should be good to go!
Setting up a public page.
-------------------------
1. Set PSM_PUBLIC to true in config.php.
2. If not yet existing, create a user with username '__PUBLIC__'. See Users -> "I removed user '__PUBLIC__', what now?" for help.
3. Add servers to user '__PUBLIC__'.
4. Go to /public.php.
Notifications
+++++++++++++

View File

@ -50,6 +50,8 @@ For a regular upgrade, follow these steps:
* Follow the steps
* Enjoy
Alternatively you can use updater.sh script.
From 2.0
--------

40
public.php Normal file
View File

@ -0,0 +1,40 @@
<?php
/**
* PHP Server Monitor
* Monitor your servers and websites.
*
* This file is part of PHP Server Monitor.
* PHP Server Monitor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PHP Server Monitor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PHP Server Monitor. If not, see <http://www.gnu.org/licenses/>.
*
* @package phpservermon
* @author Tim Zandbergen <Tim@Xervion.nl>
* @copyright Copyright (c) 2008-2017 Pepijn Over <pep@mailbox.org>
* @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3
* @version Release: @package_version@
* @link http://www.phpservermonitor.org/
* @since phpservermon 3.6.0
**/
namespace {
define('PSM_PUBLIC_PAGE', true);
require __DIR__ . '/src/bootstrap.php';
$router->run('server_status');
// By destroying the session the login will show when going to another page
session_destroy();
}

View File

@ -108,6 +108,19 @@ namespace {
}
}
// check for a public page var
// This should be defined in the config
if (!defined('PSM_PUBLIC')) {
define('PSM_PUBLIC', false);
}
// check for a public page
// This variable is for internal use
// and should not be changed by the user manualy
if (!defined('PSM_PUBLIC_PAGE')) {
define('PSM_PUBLIC_PAGE', false);
}
$lang = psm_get_conf('language', 'en_US');
psm_load_lang($lang);
}

View File

@ -34,21 +34,21 @@ namespace {
#
###############################################
/**
* Retrieve language settings from the selected language file
* Return false if arg is not found
*
* @return string|bool
* @see psm_load_lang()
*/
/**
* Retrieve language settings from the selected language file
* Return false if arg is not found
*
* @return string|bool
* @see psm_load_lang()
*/
function psm_get_lang()
{
$args = func_get_args();
if (empty($args)) {
return isset($GLOBALS['sm_lang']) ? $GLOBALS['sm_lang'] : $GLOBALS['sm_lang_default'];
}
if (isset($GLOBALS['sm_lang'])) {
$lang = $GLOBALS['sm_lang'];
$not_found = false;
@ -72,13 +72,13 @@ namespace {
return $lang;
}
/**
* Load default language from the English (en_US) language file to the $GLOBALS['sm_lang_default'] variable
* Load language from the language file to the $GLOBALS['sm_lang'] variable if language is different from default
*
* @param string $lang language
* @see psm_get_lang()
*/
/**
* Load default language from the English (en_US) language file to the $GLOBALS['sm_lang_default'] variable
* Load language from the language file to the $GLOBALS['sm_lang'] variable if language is different from default
*
* @param string $lang language
* @see psm_get_lang()
*/
function psm_load_lang($lang)
{
// load default language - English (en_US)
@ -86,29 +86,29 @@ namespace {
$default_lang_file = PSM_PATH_LANG . 'en_US.lang.php';
file_exists($default_lang_file) ? require $default_lang_file :
trigger_error("English translation needs to be installed at all time!", E_USER_ERROR);
trigger_error("English translation needs to be installed at all time!", E_USER_ERROR);
isset($sm_lang) ? $GLOBALS['sm_lang_default'] = $sm_lang :
trigger_error("\$sm_lang not found in English translation!", E_USER_ERROR);
trigger_error("\$sm_lang not found in English translation!", E_USER_ERROR);
unset($sm_lang);
// load translation is the selected language is not English (en_US)
if ($lang != "en_US") {
$lang_file = PSM_PATH_LANG . $lang . '.lang.php';
file_exists($lang_file) ? require $lang_file :
trigger_error("Translation file could not be found! Default language will be used.", E_USER_WARNING);
trigger_error("Translation file could not be found! Default language will be used.", E_USER_WARNING);
isset($sm_lang) ? $GLOBALS['sm_lang'] = $sm_lang :
trigger_error("\$sm_lang not found in translation file! Default language will be used.", E_USER_WARNING);
trigger_error("\$sm_lang not found in translation file! Default language will be used.", E_USER_WARNING);
isset($sm_lang['locale']) ? setlocale(LC_TIME, $sm_lang['locale']) :
trigger_error("locale could not ben found in translation file.", E_USER_WARNING);
trigger_error("locale could not ben found in translation file.", E_USER_WARNING);
}
}
/**
* Retrieve a list with keys of the available languages
*
* @return array
* @see psm_load_lang()
*/
/**
* Retrieve a list with keys of the available languages
*
* @return array
* @see psm_load_lang()
*/
function psm_get_langs()
{
$fn_ext = '.lang.php';
@ -133,11 +133,11 @@ namespace {
return $langs;
}
/**
* Retrieve a list with available sms gateways
*
* @return array
*/
/**
* Retrieve a list with available sms gateways
*
* @return array
*/
function psm_get_sms_gateways()
{
$sms_gateway_files = glob(PSM_PATH_SMS_GATEWAY . '*.php');
@ -155,14 +155,14 @@ namespace {
return $sms_gateways;
}
/**
* Get a setting from the config.
*
* @param string $key
* @param mixed $alt if not set, return this alternative
* @return string
* @see psm_load_conf()
*/
/**
* Get a setting from the config.
*
* @param string $key
* @param mixed $alt if not set, return this alternative
* @return string
* @see psm_load_conf()
*/
function psm_get_conf($key, $alt = null)
{
if (!isset($GLOBALS['sm_config'])) {
@ -173,13 +173,13 @@ namespace {
return $result;
}
/**
* Load config from the database to the $GLOBALS['sm_config'] variable
*
* @global object $db
* @return boolean
* @see psm_get_conf()
*/
/**
* Load config from the database to the $GLOBALS['sm_config'] variable
*
* @return boolean
* @global object $db
* @see psm_get_conf()
*/
function psm_load_conf()
{
global $db;
@ -204,14 +204,14 @@ namespace {
}
}
/**
* Update a config setting.
*
* If the key does not exist yet it will be created.
* @global \psm\Service\Database $db
* @param string $key
* @param string $value
*/
/**
* Update a config setting.
*
* If the key does not exist yet it will be created.
* @param string $key
* @param string $value
* @global \psm\Service\Database $db
*/
function psm_update_conf($key, $value)
{
global $db;
@ -223,8 +223,8 @@ namespace {
$db->save(
PSM_DB_PREFIX . 'config',
array(
'key' => $key,
'value' => $value,
'key' => $key,
'value' => $value,
)
);
} else {
@ -243,16 +243,16 @@ namespace {
#
###############################################
/**
* This function merely adds the message to the log table. It does not perform any checks,
* everything should have been handled when calling this function
*
* @param string $server_id
* @param string $type
* @param string $message
*
* @return int log_id
*/
/**
* This function merely adds the message to the log table. It does not perform any checks,
* everything should have been handled when calling this function
*
* @param string $server_id
* @param string $type
* @param string $message
*
* @return int log_id
*/
function psm_add_log($server_id, $type, $message)
{
global $db;
@ -260,19 +260,19 @@ namespace {
return $db->save(
PSM_DB_PREFIX . 'log',
array(
'server_id' => $server_id,
'type' => $type,
'message' => $message,
'server_id' => $server_id,
'type' => $type,
'message' => $message,
)
);
}
/**
* This function just adds a user to the log_users table.
*
* @param $log_id
* @param $user_id
*/
/**
* This function just adds a user to the log_users table.
*
* @param $log_id
* @param $user_id
*/
function psm_add_log_user($log_id, $user_id)
{
global $db;
@ -280,19 +280,19 @@ namespace {
$db->save(
PSM_DB_PREFIX . 'log_users',
array(
'log_id' => $log_id,
'user_id' => $user_id,
'log_id' => $log_id,
'user_id' => $user_id,
)
);
}
/**
* This function adds the result of a check to the uptime table for logging purposes.
*
* @param int $server_id
* @param int $status
* @param string $latency
*/
/**
* This function adds the result of a check to the uptime table for logging purposes.
*
* @param int $server_id
* @param int $status
* @param string $latency
*/
function psm_log_uptime($server_id, $status, $latency)
{
global $db;
@ -300,62 +300,62 @@ namespace {
$db->save(
PSM_DB_PREFIX . 'servers_uptime',
array(
'server_id' => $server_id,
'date' => date('Y-m-d H:i:s'),
'status' => $status,
'latency' => $latency,
'server_id' => $server_id,
'date' => date('Y-m-d H:i:s'),
'status' => $status,
'latency' => $latency,
)
);
}
/**
* Converts an interval into a string
*
* @param DateInterval $interval
* @return string
*/
/**
* Converts an interval into a string
*
* @param DateInterval $interval
* @return string
*/
function psm_format_interval(DateInterval $interval)
{
$result = "";
if ($interval->y) {
$result .= $interval->format("%y ") . (($interval->y == 1) ?
psm_get_lang('system', 'year') : psm_get_lang('system', 'years')) . " ";
psm_get_lang('system', 'year') : psm_get_lang('system', 'years')) . " ";
}
if ($interval->m) {
$result .= $interval->format("%m ") . (($interval->m == 1) ?
psm_get_lang('system', 'month') : psm_get_lang('system', 'months')) . " ";
psm_get_lang('system', 'month') : psm_get_lang('system', 'months')) . " ";
}
if ($interval->d) {
$result .= $interval->format("%d ") . (($interval->d == 1) ?
psm_get_lang('system', 'day') : psm_get_lang('system', 'days')) . " ";
psm_get_lang('system', 'day') : psm_get_lang('system', 'days')) . " ";
}
if ($interval->h) {
$result .= $interval->format("%h ") . (($interval->h == 1) ?
psm_get_lang('system', 'hour') : psm_get_lang('system', 'hours')) . " ";
psm_get_lang('system', 'hour') : psm_get_lang('system', 'hours')) . " ";
}
if ($interval->i) {
$result .= $interval->format("%i ") . (($interval->i == 1) ?
psm_get_lang('system', 'minute') : psm_get_lang('system', 'minutes')) . " ";
psm_get_lang('system', 'minute') : psm_get_lang('system', 'minutes')) . " ";
}
if ($interval->s) {
$result .= $interval->format("%s ") . (($interval->s == 1) ?
psm_get_lang('system', 'second') : psm_get_lang('system', 'seconds')) . " ";
psm_get_lang('system', 'second') : psm_get_lang('system', 'seconds')) . " ";
}
return $result;
}
/**
* Parses a string from the language file with the correct variables replaced in the message
*
* @param boolean|null $status
* @param string $type is either 'sms', 'email', 'pushover_title', 'pushover_message' or 'telegram_message'
* @param array $vars server information about the server which may be placed in a message:
* %KEY% will be replaced by your value
* @param boolean $combi parse other message if notifications need to be send combined
* @return string parsed message
*/
/**
* Parses a string from the language file with the correct variables replaced in the message
*
* @param boolean|null $status
* @param string $type is either 'sms', 'email', 'pushover_title', 'pushover_message', 'webhook_title', 'webhook_message' or 'telegram_message'
* @param array $vars server information about the server which may be placed in a message:
* %KEY% will be replaced by your value
* @param boolean $combi parse other message if notifications need to be send combined
* @return string parsed message
*/
function psm_parse_msg($status, $type, $vars, $combi = false)
{
if (is_bool($status)) {
@ -378,20 +378,20 @@ namespace {
return $message;
}
/**
* Shortcut to curl_init(), curl_exec and curl_close()
*
* @param string $href
* @param boolean $header return headers?
* @param boolean $body return body?
* @param int|null $timeout connection timeout in seconds. defaults to PSM_CURL_TIMEOUT (10 secs).
* @param boolean $add_agent add user agent?
* @param string|bool $website_username Username website
* @param string|bool $website_password Password website
* @param string|null $request_method Request method like GET, POST etc.
* @param string|null $post_field POST data
* @return array cURL result
*/
/**
* Shortcut to curl_init(), curl_exec and curl_close()
*
* @param string $href
* @param boolean $header return headers?
* @param boolean $body return body?
* @param int|null $timeout connection timeout in seconds. defaults to PSM_CURL_TIMEOUT (10 secs).
* @param boolean $add_agent add user agent?
* @param string|bool $website_username Username website
* @param string|bool $website_password Password website
* @param string|null $request_method Request method like GET, POST etc.
* @param string|null $post_field POST data
* @return array cURL result
*/
function psm_curl_get(
$href,
$header = false,
@ -419,7 +419,8 @@ namespace {
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_ENCODING, '');
curl_setopt($ch, CURLOPT_CERTINFO, 1);
curl_setopt($ch, CURLOPT_COOKIEFILE, '');
if (!empty($request_method)) {
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $request_method);
}
@ -453,32 +454,32 @@ namespace {
if ($add_agent) {
curl_setopt($ch, CURLOPT_USERAGENT, psm_get_conf('user_agent', 'Mozilla/5.0 (compatible; phpservermon/' .
PSM_VERSION . '; +https://github.com/phpservermon/phpservermon)'));
PSM_VERSION . '; +https://github.com/phpservermon/phpservermon)'));
}
$result['exec'] = curl_exec($ch);
$result['info'] = curl_getinfo($ch);
curl_close($ch);
if (defined('PSM_DEBUG') && PSM_DEBUG === true && psm_is_cli()) {
echo PHP_EOL .
'==============cURL Result for: ' . $href . '===========================================' . PHP_EOL;
'==============cURL Result for: ' . $href . '===========================================' . PHP_EOL;
print_r($result);
echo PHP_EOL .
'==============END cURL Resul for: ' . $href . '===========================================' . PHP_EOL;
'==============END cURL Resul for: ' . $href . '===========================================' . PHP_EOL;
}
return $result;
}
/**
* Get a "nice" timespan message
*
* Source: http://www.interactivetools.com/forum/forum-posts.php?postNum=2208966
* @param string $time
* @return string
*/
/**
* Get a "nice" timespan message
*
* Source: http://www.interactivetools.com/forum/forum-posts.php?postNum=2208966
* @param string $time
* @return string
*/
function psm_timespan($time)
{
if (empty($time) || $time == '0000-00-00 00:00:00') {
@ -489,7 +490,7 @@ namespace {
}
if ($time < strtotime(date('Y-m-d 00:00:00')) - 60 * 60 * 24 * 3) {
$format = psm_get_lang('system', (date('Y') !== date('Y', $time)) ?
'long_day_format' : 'short_day_format');
'long_day_format' : 'short_day_format');
// Check for Windows to find and replace the %e
// modifier correctly
if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
@ -500,7 +501,7 @@ namespace {
$d = time() - $time;
if ($d >= 60 * 60 * 24) {
$format = psm_get_lang('system', (date('l', time() - 60 * 60 * 24) == date('l', $time)) ?
'yesterday_format' : 'other_day_format');
'yesterday_format' : 'other_day_format');
return strftime($format, $time);
}
if ($d >= 60 * 60 * 2) {
@ -522,11 +523,11 @@ namespace {
return psm_get_lang('system', 'a_second_ago');
}
/**
* Get a localised date from MySQL date format
* @param string $time
* @return string
*/
/**
* Get a localised date from MySQL date format
* @param string $time
* @return string
*/
function psm_date($time)
{
if (empty($time) || $time == '0000-00-00 00:00:00') {
@ -535,12 +536,12 @@ namespace {
return strftime('%x %X', strtotime($time));
}
/**
* Check if an update is available for PHP Server Monitor.
*
* Will only check for new version if user turned updates on in config.
* @return boolean
*/
/**
* Check if an update is available for PHP Server Monitor.
*
* Will only check for new version if user turned updates on in config.
* @return boolean
*/
function psm_update_available()
{
if (!psm_get_conf('show_update')) {
@ -582,14 +583,14 @@ namespace {
return version_compare($latestVersion, $current, '>');
}
/**
* Prepare a new phpmailer instance.
*
* If the from name and email are left blank they will be prefilled from the config.
* @param string $from_name
* @param string $from_email
* @return \PHPMailer\PHPMailer\PHPMailer
*/
/**
* Prepare a new phpmailer instance.
*
* If the from name and email are left blank they will be prefilled from the config.
* @param string $from_name
* @param string $from_email
* @return \PHPMailer\PHPMailer\PHPMailer
*/
function psm_build_mail($from_name = null, $from_email = null)
{
$phpmailer = new \PHPMailer\PHPMailer\PHPMailer();
@ -600,7 +601,7 @@ namespace {
if (psm_get_conf('email_smtp') == '1') {
$phpmailer->IsSMTP();
$phpmailer->Host = psm_get_conf('email_smtp_host');
$phpmailer->Port = (int) psm_get_conf('email_smtp_port');
$phpmailer->Port = (int)psm_get_conf('email_smtp_port');
$phpmailer->SMTPSecure = psm_get_conf('email_smtp_security');
$smtp_user = psm_get_conf('email_smtp_username');
@ -628,11 +629,11 @@ namespace {
return $phpmailer;
}
/**
* Prepare a new Pushover util.
*
* @return \Pushover
*/
/**
* Prepare a new Pushover util.
*
* @return \Pushover
*/
function psm_build_pushover()
{
$pushover = new \Pushover();
@ -641,10 +642,22 @@ namespace {
return $pushover;
}
/**
*
* @return \Telegram
*/
/**
* Prepare a new Webhook util.
*
* @return Webhook
*/
function psm_build_webhook()
{
$webhook = new Webhook();
return $webhook;
}
/**
*
* @return \Telegram
*/
function psm_build_telegram()
{
$telegram = new \Telegram();
@ -656,12 +669,12 @@ namespace {
/**
* Send message via XMPP.
*
* @param string $host
* @param string $username
* @param string $password
* @param array $receivers
* @param string $message
* @param int|null $port
* @param string $host
* @param string $username
* @param string $password
* @param array $receivers
* @param string $message
* @param int|null $port
* @param string|null $domain
*/
function psm_jabber_send_message($host, $username, $password, $receivers, $message, $port = null, $domain = null)
@ -707,11 +720,11 @@ namespace {
}
}
/**
* Prepare a new SMS util.
*
* @return \psm\Txtmsg\TxtmsgInterface
*/
/**
* Prepare a new SMS util.
*
* @return \psm\Txtmsg\TxtmsgInterface
*/
function psm_build_sms()
{
$sms = null;
@ -743,6 +756,9 @@ namespace {
case 'smsglobal':
$sms = new \psm\Txtmsg\Smsglobal();
break;
case 'infobip':
$sms = new \psm\Txtmsg\Infobip();
break;
case 'freevoipdeal':
$sms = new \psm\Txtmsg\FreeVoipDeal();
break;
@ -782,9 +798,13 @@ namespace {
case 'solutionsinfini':
$sms = new \psm\Txtmsg\SolutionsInfini();
break;
case 'ysmal':
$sms = new \psm\Txtmsg\Ysmal();
case 'smsapi':
$sms = new \psm\Txtmsg\SMSAPI();
break;
case 'promosms':
$sms = new \psm\Txtmsg\PromoSMS();
case 'labsmobile':
$sms = new \psm\Txtmsg\LabsMobile();
break;
@ -799,20 +819,20 @@ namespace {
return $sms;
}
/**
* Generate a new link to the current monitor
* @param array|string $params key value pairs or pre-formatted string
* @param boolean $urlencode urlencode all params?
* @param boolean $htmlentities use entities in url?
* @return string
*/
/**
* Generate a new link to the current monitor
* @param array|string $params key value pairs or pre-formatted string
* @param boolean $urlencode urlencode all params?
* @param boolean $htmlentities use entities in url?
* @return string
*/
function psm_build_url($params = array(), $urlencode = true, $htmlentities = true)
{
if (defined('PSM_BASE_URL') && PSM_BASE_URL !== null) {
$url = PSM_BASE_URL;
} else {
$url = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') ||
$_SERVER['SERVER_PORT'] == 443 ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'];
$_SERVER['SERVER_PORT'] == 443 ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'];
// on Windows, dirname() adds both back- and forward slashes (http://php.net/dirname).
// for urls, we only want the forward slashes.
$url .= dirname($_SERVER['SCRIPT_NAME']);
@ -839,12 +859,12 @@ namespace {
return $url;
}
/**
* Try existence of a GET var, if not return the alternative
* @param string $key
* @param string $alt
* @return mixed
*/
/**
* Try existence of a GET var, if not return the alternative
* @param string $key
* @param string $alt
* @return mixed
*/
function psm_GET($key, $alt = null)
{
if (isset($_GET[$key])) {
@ -854,12 +874,12 @@ namespace {
}
}
/**
* Try existence of a POST var, if not return the alternative
* @param string $key
* @param string|array|bool $alt
* @return mixed
*/
/**
* Try existence of a POST var, if not return the alternative
* @param string $key
* @param string|array|bool $alt
* @return mixed
*/
function psm_POST($key, $alt = null)
{
if (isset($_POST[$key])) {
@ -869,12 +889,12 @@ namespace {
}
}
/**
* Check if we are in CLI mode
*
* Note, php_sapi cannot be used because cgi-fcgi returns both for web and cli.
* @return boolean
*/
/**
* Check if we are in CLI mode
*
* Note, php_sapi cannot be used because cgi-fcgi returns both for web and cli.
* @return boolean
*/
function psm_is_cli()
{
return (!isset($_SERVER['SERVER_SOFTWARE']) || php_sapi_name() == 'cli');
@ -886,11 +906,11 @@ namespace {
#
###############################################
/**
* Only used for debugging and testing
*
* @param mixed $arr
*/
/**
* Only used for debugging and testing
*
* @param mixed $arr
*/
function pre($arr = null)
{
echo "<pre>";
@ -901,9 +921,9 @@ namespace {
echo "</pre>";
}
/**
* Send headers to the browser to avoid caching
*/
/**
* Send headers to the browser to avoid caching
*/
function psm_no_cache()
{
header("Expires: Mon, 20 Dec 1998 01:00:00 GMT");
@ -912,14 +932,14 @@ namespace {
header("Pragma: no-cache");
}
/**
* Encrypts the password for storage in the database
*
* @param string $key
* @param string $password
* @return string
* @author Pavel Laupe Dvorak <pavel@pavel-dvorak.cz>
*/
/**
* Encrypts the password for storage in the database
*
* @param string $key
* @param string $password
* @return string
* @author Pavel Laupe Dvorak <pavel@pavel-dvorak.cz>
*/
function psm_password_encrypt($key, $password)
{
if (empty($password)) {
@ -948,14 +968,14 @@ namespace {
return $encrypted;
}
/**
* Decrypts password stored in the database for future use
*
* @param string $key
* @param string $encryptedString
* @return string
* @author Pavel Laupe Dvorak <pavel@pavel-dvorak.cz>
*/
/**
* Decrypts password stored in the database for future use
*
* @param string $key
* @param string $encryptedString
* @return string
* @author Pavel Laupe Dvorak <pavel@pavel-dvorak.cz>
*/
function psm_password_decrypt($key, $encryptedString)
{
if (empty($encryptedString)) {
@ -963,7 +983,7 @@ namespace {
}
if (empty($key)) {
throw new \InvalidArgumentException('invalid_encryption_key');
throw new \InvalidArgumentException('invalid_encryption_key');
}
// using open ssl
@ -978,16 +998,16 @@ namespace {
OPENSSL_RAW_DATA,
$iv
);
return $decrypted;
}
/**
* Send notification to Telegram
*
* @return string
* @author Tim Zandbergen <tim@xervion.nl>
*/
/**
* Send notification to Telegram
*
* @return string
* @author Tim Zandbergen <tim@xervion.nl>
*/
class Telegram
{
private $token;
@ -997,12 +1017,14 @@ namespace {
public function setToken($token)
{
$this->token = (string) $token;
$this->token = (string)$token;
}
public function setUser($user)
{
$this->user = (string) $user;
$this->user = (string)$user;
}
public function setMessage($message)
{
$message = str_replace("<ul>", "", $message);
@ -1011,8 +1033,9 @@ namespace {
$message = str_replace("</li>", "\n", $message);
$message = str_replace("<br>", "\n", $message);
$message = str_replace("<br/>", "\n", $message);
$this->message = (string) $message;
$this->message = (string)$message;
}
public function sendurl()
{
$con = curl_init($this->url);
@ -1023,15 +1046,17 @@ namespace {
$response = json_decode($response, true);
return $response;
}
public function send()
{
if (!empty($this->token) && !empty($this->user) && !empty($this->message)) {
$this->url = 'https://api.telegram.org/bot' . urlencode($this->token) .
'/sendMessage?chat_id=' . urlencode($this->user) . '&text=' .
urlencode($this->message) . '&parse_mode=HTML&disable_web_page_preview=True';
'/sendMessage?chat_id=' . urlencode($this->user) . '&text=' .
urlencode($this->message) . '&parse_mode=HTML&disable_web_page_preview=True';
}
return $this->sendurl();
}
// Get the bots username
public function getBotUsername()
{
@ -1041,4 +1066,120 @@ namespace {
return $this->sendurl();
}
}
/**
* Send notification via webhooks
*
* @return string
* @author Malte Grosse
*/
class Webhook
{
protected $url;
protected $json;
/**
* Send Webhook
*
* @return bool|string
* @var array $replacements an array of the replacements
*
*/
public function sendWebhook($replacements)
{
$error = "";
$success = 1;
$replacements['#message'] = $this->stripTagsFromMessage($replacements['#message']);
$jsonMessage = strtr($this->json, $replacements);
$curl = curl_init($this->url);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $jsonMessage);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($curl, CURLOPT_TIMEOUT, 60);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
$result = curl_exec($curl);
$httpcode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
$err = curl_errno($curl);
if ($err != 0 || $httpcode < 200 || $httpcode >= 300) {
$success = 0;
$error = "HTTP_code: " . $httpcode . ".\ncURL error (" . $err . "): " . $err . ". \nResult: " . $result;
}
curl_close($curl);
if ($success) {
return 1;
}
return $error;
}
/**
* setUrl
*
* @var string $url
*
*/
public function setUrl($url)
{
$this->url = $url;
}
/**
* getUrl
*
* @return string
*/
public function getUrl()
{
return $this->url;
}
/**
* setJson
*
* @var string $json
*
*/
public function setJson($json)
{
$this->json = $json;
}
/**
* getJson
*
* @return string
*/
public function getJson()
{
return $this->json;
}
/**
* Set message
*
* @return string
* @var string $message
*
*/
public function stripTagsFromMessage($message)
{
$message = str_replace("<ul>", "", $message);
$message = str_replace("</ul>", "\n", $message);
$message = str_replace("<li>", "- ", $message);
$message = str_replace("</li>", "\n", $message);
$message = str_replace("<br>", "\n", $message);
$message = str_replace("<br/>", "\n", $message);
$message = str_replace("<b>", "", $message);
$message = str_replace("<b/>", "", $message);
$message = strip_tags($message);
return (string)$message;
}
}
}

View File

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

View File

@ -59,7 +59,7 @@ $sm_lang = array(
'long_day_format' => '%B %e, %Y',
'yesterday_format' => 'Gestern um %k:%M Uhr',
'other_day_format' => '%A um %k:%M Uhr',
'never' => 'Never',
'never' => 'Nie',
'hours_ago' => 'vor %d Stunden',
'an_hour_ago' => 'vor über einer Stunde',
'minutes_ago' => 'vor %d Minuten',
@ -125,10 +125,10 @@ $sm_lang = array(
'email' => 'E-Mail',
'sms' => 'SMS',
'pushover' => 'Pushover',
'no_logs' => 'Keine Logs vorhanden.',
'clear' => 'Protokoll Logs',
'delete_title' => 'Protokoll Logs',
'delete_message' => 'Bist du sicher, dass du <b>alle</b> logs löschen möchtest?',
'no_logs' => 'Keine Protokolle vorhanden.',
'clear' => 'Protokoll löschen',
'delete_title' => 'Protokoll löschen',
'delete_message' => 'Bist du sicher, dass du <b>alle</b> Protokolle löschen möchtest?',
),
'servers' => array(
'server' => 'Server',
@ -196,14 +196,15 @@ $sm_lang = array(
'general' => 'Allgemein',
'language' => 'Sprache',
'show_update' => 'Wöchentlich auf Aktualisierungen prüfen?',
'email_add_url' => 'Server URL an E-Mail anhängen?',
'email_status' => 'E-Mail-Versand erlauben?',
'email_from_email' => 'Absenderadresse',
'email_from_name' => 'Name des Absenders',
'email_smtp' => 'SMTP-Versand aktivieren',
'email_smtp_host' => 'SMTP Server/Host',
'email_smtp_port' => 'SMTP Port',
'email_smtp_security' => 'SMTP security',
'email_smtp_security_none' => 'None',
'email_smtp_security' => 'SMTP Authentifizierung',
'email_smtp_security_none' => 'Keine',
'email_smtp_username' => 'SMTP Benutzername',
'email_smtp_password' => 'SMTP Passwort',
'email_smtp_noauth' => 'Feld leer lassen, bei fehlender Authentifizierung',
@ -221,6 +222,9 @@ $sm_lang = array(
'pushover_api_token_description' => 'Bevor Sie Pushover verwenden können, müssen Sie Ihre <a href="%1$s"
target="_blank" rel="noopener">Anwendung hier registrieren</a> und Ihren
Anwendungs-API-Token hier eingeben.',
'telegram_status' => 'Telegram Nachrichten erlauben?',
'telegram_add_url' => 'Server URL an Nachricht anhängen?',
'jabber_status' => 'Allow sending Jabber (XMPP) messages',
'alert_type' => 'Wann möchten Sie benachrichtigt werden?',
'alert_type_description' => '<b>Status geändert:</b> ... wenn sich der Status ändert<br>z. B. online ->
offline oder offline -> online.<br><br><b>Offline: </b>Sie bekommen eine
@ -237,6 +241,7 @@ $sm_lang = array(
'log_email' => 'E-Mail-Versand protokollieren?',
'log_sms' => 'SMS-Versand protokollieren?',
'log_pushover' => 'Pushover-Versand protokollieren?',
'log_telegram' => 'Telegram-Versand protokollieren?',
'updated' => 'Die Einstellungen wurden gespeichert.',
'tab_email' => 'E-Mail',
'tab_sms' => 'SMS',
@ -286,14 +291,14 @@ $sm_lang = array(
'off_pushover_message' => 'Kann keine funktionierende Verbindung zum Dienst bzw. der Webseite
aufbauen:<br><br>Dienst/Webseite: %LABEL%<br>IP: %IP%<br>Port: %PORT%<br>Fehler:
%ERROR%<br>Datum: %DATE% Uhr',
'on_sms' => 'Dienst/Webseite \'%LABEL%\' ist wieder online: ip=%IP%, port=%PORT%, it was down for
'on_sms' => 'Dienst/Webseite \'%LABEL%\' ist wieder online: ip=%IP%, port=%PORT%, offline r
%LAST_OFFLINE_DURATION%',
'on_email_subject' => 'Hinweis: Dienst/Webseite \'%LABEL%\' ist wieder online.',
'on_email_body' => 'Dienst/Webseite \'%LABEL%\' ist wieder erreichbar, it was down for
'on_email_body' => 'Dienst/Webseite \'%LABEL%\' ist wieder erreichbar, offline r
%LAST_OFFLINE_DURATION%:<br><br>Server: %LABEL%<br>IP: %IP%<br>Port: %PORT%<br>Datum:
%DATE% Uhr',
'on_pushover_title' => 'Dienst/Webseite \'%LABEL%\' ist wieder online.',
'on_pushover_message' => 'Dienst/Webseite \'%LABEL%\' ist wieder erreichbar, it was down for
'on_pushover_message' => 'Dienst/Webseite \'%LABEL%\' ist wieder erreichbar, offline r
%LAST_OFFLINE_DURATION%:<br><br>Server: %LABEL%<br>IP: %IP%<br>Port:
%PORT%<br>Datum: %DATE% Uhr',
),
@ -313,7 +318,7 @@ $sm_lang = array(
'password_reset' => 'Passwort zurücksetzen',
'password_reset_email_subject' => 'Setzen Sie Ihr Zugangspasswort für den Server Monitor',
'password_reset_email_body' => 'Benutzen Sie bitte den folgenden Link, um Ihr Zugangspasswort zurückzusetzen.
Bitte beachten Sie: Der Link verfällt in 1 Stunde.<br><br>%link%',
Bitte beachten Sie: Der Link verfällt in einer Stunde.<br><br>%link%',
'error_user_incorrect' => 'Der angegebene Benutzername konnte nicht gefunden werden.',
'error_login_incorrect' => 'Die angegebenen Informationen sind leider nicht korrekt.',
'error_login_passwords_nomatch' => 'Die angegebenen Passwörter stimmen nicht überein.',

View File

@ -50,9 +50,7 @@ $sm_lang = array(
'no' => 'No',
'insert' => 'Insert',
'add_new' => 'Add new',
'update_available' => 'A new version ({version}) is available. Click <a
href="https://github.com/phpservermon/phpservermon/releases/latest" target="_blank"
rel="noopener">here</a> to download the update.',
'update_available' => 'A new version ({version}) is available. Click <a href="https://github.com/phpservermon/phpservermon/releases/latest" target="_blank" rel="noopener">here</a> to download the update.',
'back_to_top' => 'Back to top',
'go_back' => 'Go back',
'ok' => 'OK',
@ -108,36 +106,39 @@ $sm_lang = array(
'level' => 'Level',
'level_10' => 'Administrator',
'level_20' => 'User',
'level_30' => 'Anonymous',
'level_description' => '<b>Administrators</b> have full access: they can manage servers, users and edit the
global configuration.<br><b>Users</b> can only view and run the updater for the
servers that have been assigned to them.',
'mobile' => 'Mobile',
'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/" target="_blank">their website</a> for more info.',
'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See <a 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.',
'discord' => 'Discord',
'discord_label' => 'Discord',
'discord_description' => 'Put your <a href="https://discordjs.guide/popular-topics/webhooks.html" target="_blank">webhook</a> here.',
'telegram' => 'Telegram',
'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_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',
'activate_telegram' => 'Activate Telegram notifications',
'activate_telegram_description' => 'Allow Telegram notifications to be sent to the specified chat id. Without
this permission, Telegram doesn\'t allow us to send notifications to you.',
'telegram_bot_username_found' => 'The bot was found!<br><a href="%s" target="_blank" rel="noopener"><button
class="btn btn-primary">Next step</button></a> <br>This will open a chat
with the bot. Here you need to press start or type /start.',
'activate_telegram_description' => 'Allow Telegram notifications to be sent to the specified chat id. Without this permission, Telegram doesn\'t allow us to send notifications to you.',
'telegram_bot_username_found' => 'The bot was found!<br><a href="%s" target="_blank" rel="noopener"><button class="btn btn-primary">Next step</button></a> <br>This will open a chat with the bot. Here you need to press start or type /start.',
'telegram_bot_username_error_token' => '401 - Unauthorized. Please make sure that the API token is valid.',
'telegram_bot_error' => 'An error has occurred while activating Telegram notification: %s',
'jabber' => 'Jabber',
'jabber_label' => 'Jabber',
'jabber_description' => 'You Jabber account',
'webhook' => 'Webhook',
'webhook_description' => 'Send a json webhook to a certain endpoint.',
'webhook_url' => 'Webhook Url',
'webhook_url_description' => 'Webhook public endpoint url, should start with https://.',
'webhook_json' => 'Webhook JSON',
'webhook_json_description' => 'Define a custom json, e.g. {"username": "servermon: #server_label" "text": "#server_ip is **#status**"}.<br>Available variables: #message, #server_error, #server_ip, #server_label, #server_last_offline_duration and #status',
'delete_title' => 'Delete User',
'delete_message' => 'Are you sure you want to delete user \'%1\'?',
'deleted' => 'User deleted.',
@ -146,8 +147,7 @@ $sm_lang = array(
'profile' => 'Profile',
'profile_updated' => 'Your profile has been updated.',
'error_user_name_bad_length' => 'Usernames must be between 2 and 64 characters.',
'error_user_name_invalid' => 'The username may only contain alphabetic characters (a-z, A-Z), digits (0-9),
dots (.) and underscores (_).',
'error_user_name_invalid' => 'The username may only contain alphabetic characters (a-z, A-Z), digits (0-9), dots (.) and underscores (_).',
'error_user_name_exists' => 'The given username already exists in the database.',
'error_user_email_bad_length' => 'Email addresses must be between 5 and 255 characters.',
'error_user_email_invalid' => 'The email address is invalid.',
@ -156,6 +156,7 @@ $sm_lang = array(
'error_user_password_invalid' => 'The entered password is invalid.',
'error_user_password_no_match' => 'The entered passwords do not match.',
'error_user_admin_cant_be_deleted' => 'You can\'t remove the last administrator.',
'error_user_cant_be_anonymous' => 'Only user \'__public__\' can have the level anonymous.'
),
'log' => array(
'title' => 'Log entries',
@ -163,7 +164,9 @@ $sm_lang = array(
'status' => 'Status',
'email' => 'Email',
'sms' => 'SMS',
'discord' => 'Discord',
'pushover' => 'Pushover',
'webhook' => 'Webhook',
'telegram' => 'Telegram',
'jabber' => 'Jabber',
'no_logs' => 'No logs',
@ -201,17 +204,13 @@ $sm_lang = array(
'type_service' => 'Service',
'type_ping' => 'Ping',
'pattern' => 'Search string/pattern',
'pattern_description' => 'If this pattern is not found on the website, the server will be marked
online/offline. Regular expressions are allowed.',
'pattern_description' => 'If this pattern is not found on the website, the server will be marked online/offline. Regular expressions are allowed.',
'pattern_online' => 'Pattern indicates website is',
'pattern_online_description' => 'Online: If this pattern was found on the website, the server will be marked
online. Offline: If this pattern was not found on the website, the server
will be marked offline.',
'pattern_online_description' => 'Online: If this pattern was found on the website, the server will be marked online. Offline: If this pattern was not found on the website, the server will be marked offline.',
'redirect_check' => 'Redirecting to another domain is',
'redirect_check_description' => 'Redirect to another domain is usually a bad sign.',
'allow_http_status' => 'Allow HTTP status code',
'allow_http_status_description' => 'Mark website as online. HTTP Status codes lower then 400 are marked as
online by default. Seperate with |.',
'allow_http_status_description' => 'Mark website as online. HTTP Status codes lower then 400 are marked as online by default. Seperate with |.',
'header_name' => 'Header name',
'header_value' => 'Header value',
'header_name_description' => 'Case-sensitive.',
@ -229,6 +228,10 @@ $sm_lang = array(
'send_email' => 'Send Email',
'sms' => 'SMS',
'send_sms' => 'Send SMS',
'discord' => 'Discord',
'send_discord' => 'Send Discord notification',
'webhook' => 'Webhook',
'send_webhook' => 'Send Webhook notification',
'pushover' => 'Pushover',
'send_pushover' => 'Send Pushover notification',
'telegram' => 'Telegram',
@ -256,8 +259,7 @@ $sm_lang = array(
'warning_threshold' => 'Warning threshold',
'warning_threshold_description' => 'Number of failed checks required before it is marked offline.',
'ssl_cert_expiry_days' => 'SSL Certificate Validity',
'ssl_cert_expiry_days_description' => 'The minimum remaining days the SSL certificate is still valid. Use 0 to
disable check.',
'ssl_cert_expiry_days_description' => 'The minimum remaining days the SSL certificate is still valid. Use 0 to disable check.',
'ssl_cert_expired' => 'SSL certificate expired since',
'ssl_cert_expiring' => 'SSL certificate expiring:',
'chart_last_week' => 'Last week',
@ -268,6 +270,8 @@ $sm_lang = array(
'chart_short_time_format' => '%H:%M',
'warning_notifications_disabled_sms' => 'SMS notifications are disabled.',
'warning_notifications_disabled_email' => 'Email notifications are disabled.',
'warning_notifications_disabled_discord' => 'Discord notifications are disabled.',
'warning_notifications_disabled_webhook' => 'Webhook notifications are disabled.',
'warning_notifications_disabled_pushover' => 'Pushover notifications are disabled.',
'warning_notifications_disabled_telegram' => 'Telegram notifications are disabled.',
'warning_notifications_disabled_jabber' => 'Jabber notifications are disabled.',
@ -278,8 +282,7 @@ $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',
@ -287,13 +290,13 @@ $sm_lang = array(
'language' => 'Language',
'show_update' => 'Check for updates?',
'password_encrypt_key' => 'The encryption key password',
'password_encrypt_key_note' => 'This key is used to encrypt passwords that are stored on servers for access to
websites. If the key will change the stored password is invalid!',
'password_encrypt_key_note' => 'This key is used to encrypt passwords that are stored on servers for access to websites. If the key will change the stored password is invalid!',
'proxy' => 'Enable proxy',
'proxy_url' => 'Proxy URL',
'proxy_user' => 'Proxy username',
'proxy_password' => 'Proxy password',
'email_status' => 'Allow sending email',
'email_add_url' => 'Add url to the monitor in email',
'email_from_email' => 'Email from address',
'email_from_name' => 'Email from name',
'email_smtp' => 'Enable SMTP',
@ -309,27 +312,26 @@ $sm_lang = array(
'sms_gateway_username' => 'Gateway username',
'sms_gateway_password' => 'Gateway password',
'sms_from' => 'Sender\'s phone number',
'discord_status' => 'Allow sending Discord messages',
'discord_description' => 'Discord is a service that makes it easy to get real-time notifications. See <a href="https://discord.com/" target="_blank">their website</a> for more info.',
'webhook_status' => 'Allow sending webhooks',
'webhook_description' => 'Allow sending webhooks to services like slack. The message payload end endpoint are defined in the profile settings.',
'webhook_url' => 'Webhook Url',
'webhook_url_description' => 'Url to webhook endpoint',
'webhook_json' => 'Webhook Json',
'webhook_json_description' => 'Define a custom json. Available variables: #message, #server_error, #server_ip, #server_label, #server_last_offline_duration and #status',
'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/" target="_blank">their website</a> for more info.',
'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See <a 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.',
'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/" 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_add_url' => 'Add url to the monitor in the message',
'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/"
target="_blank">documentation</a> for help.',
'telegram_api_token_description' => 'Before you can use Telegram, you need to get a API token. Visit the <a href="http://docs.phpservermonitor.org/" target="_blank">documentation</a> for help.',
'jabber_status' => 'Allow sending Jabber (XMPP) messages',
'jabber_description' => 'Visit the <a
href="http://docs.phpservermonitor.org/">documentation</a> for more info and an
install guide.',
'jabber_description' => 'Visit the <a href="http://docs.phpservermonitor.org/">documentation</a> for more info and an install guide.',
'jabber_host' => 'Host',
'jabber_host_description' => 'Host of your Jabber account provider. For Google Account use talk.google.com.',
'jabber_port' => 'Port',
@ -341,52 +343,101 @@ $sm_lang = array(
'jabber_password' => 'Password',
'jabber_password_description' => 'Fill only to set or change.',
'jabber_check' => 'Check your Jabber account if message was received.',
'dirauth_status' => 'Authenticate with directory service',
'authdir_host_locn' => 'Directory host',
'authdir_host_port' => 'Directory port',
'authdir_type' => 'Service type',
'authdir_type_description' => 'OpenLDAP: Directory is an OpenLDAP service.<br>AD
DS: Directory is an Active Directory Domain Service.<br>AD
LDS: Directory is an Active Directory Lightweight Directory
Service.',
'authdir_type_openldap' => 'OpenLDAP',
'authdir_type_adds' => 'AD DS',
'authdir_type_adlds' => 'AD LDS',
'authdir_userdomain' => 'Active Directory domain',
'authdir_userdomain_description' => 'User domain for Active Directory. This is typically the NETBIOS domain
for AD DS and the DNS domain for AD LDS. Not used for OpenLDAP
directories.',
'authdir_ldapver' => 'LDAP protocol version',
'authdir_ldapver_description' => 'Version of the LDAP specification. This is typically Version 3 (default).
Version 2 was deprecated in 2003 (RFC3494).',
'authdir_ldapfollowref' => 'Follow referrals',
'authdir_ldapfollowref_description' => 'Follow referrals if the specified server refers to another server for
the required information. Leave unchecked if you are unaware of this
functionality.',
'authdir_basedn' => 'Base DN*',
'authdir_basedn_description' => 'Base distinguished name (DN) of the directory service. E.g.,
dc=domain,dc=tld. This is a required field.',
'authdir_usernameattrib' => 'Username attribute',
'authdir_usernameattrib_description' => 'Attribute used by the directory service to refer to the username of
the user.',
'authdir_groupnameattrib' => 'Group name attribute',
'authdir_groupnameattrib_description' => 'Attribute used by the directory service to refer to the group name
of a group. This is used to check for group membership.',
'authdir_groupmemattrib' => 'Group member attribute',
'authdir_groupmemattrib_description' => 'Attribute used by the directory service to refer to the group(s) of
which the user is a member. This is used to check for group
membership.',
'authdir_usercontainerrdn' => 'User container RDN',
'authdir_usercontainerrdn_description' => 'Relative distinguished name of the users container in the
directory. E.g., ou=Users',
'authdir_groupcontainerrdn' => 'Group container RDN',
'authdir_groupcontainerrdn_description' => 'Relative distinguished name of the groups container in the
directory. E.g., ou=Groups',
'authdir_groupname' => 'Authorised directory group',
'authdir_groupname_description' => 'Directory group authorised to access application. Directory users not
members of this group will not be authenticated (currently not available
for AD).',
'authdir_defaultrole' => 'Default role',
'authdir_defaultrole_description' => 'Default role to be assigned to users logging in for the first time.',
'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>
You will receive a notification when a server goes offline for the *FIRST TIME
ONLY*. For example, your cronjob is every 15 minutes and your server goes down at
1 am and stays down till 6 am. You will get 1 notification at 1 am and that\'s
it.<br><br><b>Always:</b> You will receive a notification every time the script
runs and a site is down, even if the site has been offline for hours.',
'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> You will receive a notification when a server goes offline for the *FIRST TIME ONLY*. For example, your cronjob is every 15 minutes and your server goes down at 1 am and stays down till 6 am. You will get 1 notification at 1 am and that\'s it.<br><br><b>Always:</b> You will receive a notification every time the script runs and a site is down, even if the site has been offline for hours.',
'alert_type_status' => 'Status change',
'alert_type_offline' => 'Offline',
'alert_type_always' => 'Always',
'combine_notifications' => 'Combine notifications',
'combine_notifications_description' => 'Reduces the amount of notification by combining the notifications into
1 single notification. (This does not affect SMS notifications.)',
'combine_notifications_description' => 'Reduces the amount of notification by combining the notifications into 1 single notification. (This does not affect SMS notifications.)',
'alert_proxy' => 'Even if enabled, proxy is never used for services',
'alert_proxy_url' => 'Format: host:port',
'log_status' => 'Log status',
'log_status_description' => 'If log status is set to TRUE, the monitor will log the event whenever the
notification settings are passed.',
'log_status_description' => 'If log status is set to TRUE, the monitor will log the event whenever the notification settings are passed.',
'log_email' => 'Log emails sent by the script',
'log_sms' => 'Log text messages sent by the script',
'log_discord' => 'Log Discord messages sent by the script',
'log_pushover' => 'Log pushover messages sent by the script',
'log_webhook' => 'Log webhook messages sent by the script',
'log_telegram' => 'Log Telegram messages sent by the script',
'log_jabber' => 'Log Jabber messages sent by the script',
'updated' => 'The configuration has been updated.',
'tab_email' => 'Email',
'tab_sms' => 'SMS',
'tab_discord' => 'Discord',
'tab_pushover' => 'Pushover',
'tab_webhook' => 'Webhook',
'tab_telegram' => 'Telegram',
'tab_jabber' => 'Jabber',
'tab_auth' => 'Authentication',
'settings_email' => 'Email settings',
'settings_sms' => 'Text message settings',
'settings_discord' => 'Discord settings',
'settings_pushover' => 'Pushover settings',
'settings_webhook' => 'Webhook settings',
'settings_telegram' => 'Telegram settings',
'settings_jabber' => 'Jabber settings',
'settings_notification' => 'Notification settings',
'settings_log' => 'Log settings',
'settings_proxy' => 'Proxy settings',
'settings_dirauth' => 'LDAP settings',
'auto_refresh' => 'Auto-refresh',
'auto_refresh_description' => 'Auto-refresh servers page.<br><span class="small">Time in seconds, if 0 the
page won\'t refresh.</span>',
'auto_refresh_description' => 'Auto-refresh servers page.<br><span class="small">Time in seconds, if 0 the page won\'t refresh.</span>',
'test' => 'Test',
'test_email' => 'An email will be sent to the address specified in your user profile.',
'test_sms' => 'An SMS will be sent to the phone number specified in your user profile.',
'test_discord' => 'A Discord notification will be sent to the webhook specified in your user profile.',
'test_pushover' => 'A Pushover notification will be sent to the user key/device specified in your user profile.',
'test_pushover' => 'A Pushover notification will be sent to the user key/device specified in your user
profile.',
'test_webhook' => 'A webhook notification will be sent to the given url endpoint.',
'test_telegram' => 'A Telegram notification will be sent to the chat id specified in your user profile.',
'test_jabber' => 'A Jabber notification will be sent to the jabber account specified in your user profile.',
'send' => 'Send',
@ -397,24 +448,27 @@ $sm_lang = array(
'sms_sent' => 'SMS sent',
'sms_error' => 'An error has occurred while sending the SMS: %s',
'sms_error_nomobile' => 'Unable to send test SMS: no valid phone number found in your profile.',
'discord_sent' => 'Discord notification sent',
'discord_error' => 'An error has occurred while sending the Discord notification: %s',
'discord_error_nowebhook' => 'Unable to send test Discord notification: no valid Discord webhook found in your user profile.',
'webhook_sent' => 'Webhook notification sent',
'webhook_error' => 'An error has occurred while sending the webhook notification: %s',
'webhook_error_nourl' => 'Unable to send test notification: no url found in user profile.',
'webhook_error_nojson' => 'Unable to send test notification: no json found in user profile.',
'pushover_sent' => 'Pushover notification sent',
'pushover_error' => 'An error has occurred while sending the Pushover notification: %s',
'pushover_error_noapp' => 'Unable to send test notification: no Pushover App API token found in the global
configuration.',
'pushover_error_noapp' => 'Unable to send test notification: no Pushover App API token found in the global configuration.',
'pushover_error_nokey' => 'Unable to send test notification: no Pushover key found in your profile.',
'telegram_sent' => 'Telegram notification sent',
'telegram_error' => 'An error has occurred while sending the Telegram notification: %s',
'telegram_error_notoken' => 'Unable to send test notification: no Telegram API token found in the global
configuration.',
'telegram_error_notoken' => 'Unable to send test notification: no Telegram API token found in the global configuration.',
'telegram_error_noid' => 'Unable to send test notification: no chat id found in your profile.',
'jabber_sent' => 'Telegram notification sent',
'jabber_error' => 'An error has occurred while sending the Telegram notification: %s',
'jabber_error_noconfig' => 'Unable to send test notification: no Jabber account set in the global
configuration.',
'jabber_sent' => 'Jabber notification sent',
'jabber_error' => 'An error has occurred while sending the Jabber notification: %s',
'jabber_error_noconfig' => 'Unable to send test notification: no Jabber account set in the global configuration.',
'jabber_error_noaccount' => 'Unable to send test notification: no Jabber account found in your profile.',
'log_retention_period' => 'Log retention period',
'log_retention_period_description' => 'Number of days to keep logs of notifications and archives of server
uptime. Enter 0 to disable log cleanup.',
'log_retention_period_description' => 'Number of days to keep logs of notifications and archives of server uptime. Enter 0 to disable log cleanup.',
'log_retention_days' => 'days',
'user_agent' => 'User Agent',
'user_agent_key_note' => 'Custom user agent used by monitor within communication with external services.',
@ -422,19 +476,27 @@ $sm_lang = array(
'notifications' => array(
'off_sms' => 'Server \'%LABEL%\' is DOWN: ip=%IP%, port=%PORT%. Error=%ERROR%',
'off_email_subject' => 'IMPORTANT: Server \'%LABEL%\' is DOWN',
'off_email_body' => 'Failed to connect to the following server:<br><br>Server: %LABEL%<br>IP: %IP%<br>Port: %PORT%<br>Error: %ERROR%<br>Date: %DATE%',
'off_discord_message' => 'Failed to connect to the following server:<br><br>Server: %LABEL%<br>IP: %IP%<br>Port: %PORT%<br>Error: %ERROR%<br>Date: %DATE%',
'off_email_body' => 'Failed to connect to the following server:<br><br>Server: %LABEL%<br>IP: %IP%<br>Port:
%PORT%<br>Error: %ERROR%<br>Date: %DATE%',
'off_webhook_title' => 'Server \'%LABEL%\' is DOWN',
'off_webhook_message' => 'Failed to connect to the following server:<br><br>Server: %LABEL%<br>IP:
%IP%<br>Port: %PORT%<br>Error: %ERROR%<br>Date: %DATE%',
'off_pushover_title' => 'Server \'%LABEL%\' is DOWN',
'off_pushover_message' => 'Failed to connect to the following server:<br><br>Server: %LABEL%<br>IP:
%IP%<br>Port: %PORT%<br>Error: %ERROR%<br>Date: %DATE%',
'off_telegram_message' => 'Failed to connect to the following server:<br><br>Server: %LABEL%<br>IP:
%IP%<br>Port: %PORT%<br>Error: %ERROR%<br>Date: %DATE%',
'off_jabber_message' => 'Failed to connect to the following server:<br><br>Server: %LABEL%<br>IP:
%IP%<br>Port: %PORT%<br>Error: %ERROR%<br>Date: %DATE%',
'off_pushover_message' => 'Failed to connect to the following server:<br><br>Server: %LABEL%<br>IP: %IP%<br>Port: %PORT%<br>Error: %ERROR%<br>Date: %DATE%',
'off_telegram_message' => 'Failed to connect to the following server:<br><br>Server: %LABEL%<br>IP: %IP%<br>Port: %PORT%<br>Error: %ERROR%<br>Date: %DATE%',
'off_jabber_message' => 'Failed to connect to the following server:<br><br>Server: %LABEL%<br>IP: %IP%<br>Port: %PORT%<br>Error: %ERROR%<br>Date: %DATE%',
'on_sms' => 'Server \'%LABEL%\' is RUNNING: ip=%IP%, port=%PORT%, it was down for %LAST_OFFLINE_DURATION%',
'on_email_subject' => 'IMPORTANT: Server \'%LABEL%\' is RUNNING',
'on_email_body' => 'Server \'%LABEL%\' is running again, it was down for
%LAST_OFFLINE_DURATION%:<br><br>Server: %LABEL%<br>IP: %IP%<br>Port: %PORT%<br>Date:
%DATE%',
'on_discord_message' => 'Server \'%LABEL%\' is running again, it was down for:
%LAST_OFFLINE_DURATION%<br><br>Server: %LABEL%<br>IP: %IP%<br>Port: %PORT%<br>Date: %DATE%',
'on_webhook_title' => 'Server \'%LABEL%\' is RUNNING',
'on_webhook_message' => 'Server \'%LABEL%\' is running again, it was down for
%LAST_OFFLINE_DURATION%:<br><br>Server: %LABEL%<br>IP: %IP%<br>Port: %PORT%<br>Date:
%DATE%',
'on_pushover_title' => 'Server \'%LABEL%\' is RUNNING',
'on_pushover_message' => 'Server \'%LABEL%\' is running again, it was down for
@ -447,6 +509,10 @@ $sm_lang = array(
%LAST_OFFLINE_DURATION%<br><br>Server: %LABEL%<br>IP: %IP%<br>Port: %PORT%<br>Date:
%DATE%',
'combi_off_email_message' => '<ul><li>Server: %LABEL%</li><li>IP: %IP%</li><li>Port: %PORT%</li><li>Error:
%ERROR%</li><li>Date: %DATE%</li></ul>',
'combi_off_discord_message' => '- Server: %LABEL%<br>- IP: %IP%<br>- Port: %PORT%<br>- Error: %ERROR%<br>-
Date: %DATE%<br><br>',
'combi_off_webhook_message' => '<ul><li>Server: %LABEL%</li><li>IP: %IP%</li><li>Port: %PORT%</li><li>Error:
%ERROR%</li><li>Date: %DATE%</li></ul>',
'combi_off_pushover_message' => '<ul><li>Server: %LABEL%</li><li>IP: %IP%</li><li>Port: %PORT%</li><li>Error:
%ERROR%</li><li>Date: %DATE%</li></ul>',
@ -456,6 +522,11 @@ $sm_lang = array(
Date: %DATE%<br><br>',
'combi_on_email_message' => '<ul><li>Server: %LABEL%</li><li>IP: %IP%</li><li>Port: %PORT%</li><li>Downtime:
%LAST_OFFLINE_DURATION%</li><li>Date: %DATE%</li></ul>',
'combi_on_webhook_message' => '<ul><li>Server: %LABEL%</li><li>IP: %IP%</li><li>Port:
%PORT%</li><li>Downtime: %LAST_OFFLINE_DURATION%</li><li>Date:
%DATE%</li></ul>',
'combi_on_discord_message' => '- Server: %LABEL%<br>- IP: %IP%<br>- Port: %PORT%<br>-
Downtime: %LAST_OFFLINE_DURATION%<br>- Date: %DATE%<br><br>',
'combi_on_pushover_message' => '<ul><li>Server: %LABEL%</li><li>IP: %IP%</li><li>Port:
%PORT%</li><li>Downtime: %LAST_OFFLINE_DURATION%</li><li>Date:
%DATE%</li></ul>',
@ -464,8 +535,13 @@ $sm_lang = array(
'combi_on_jabber_message' => '- Server: %LABEL%<br>- IP: %IP%<br>- Port: %PORT%<br>- Downtime:
%LAST_OFFLINE_DURATION%<br>- Date: %DATE%<br><br>',
'combi_email_subject' => 'IMPORTANT: \'%UP%\' servers UP again, \'%DOWN%\' servers DOWN',
'combi_webhook_subject' => '\'%UP%\' servers UP again, \'%DOWN%\' servers DOWN',
'combi_pushover_subject' => '\'%UP%\' servers UP again, \'%DOWN%\' servers DOWN',
'combi_email_message' => '<b>The following servers went down:</b><br>%DOWN_SERVERS%<br><b>The following
servers are up again:</b><br>%UP_SERVERS%',
'combi_discord_message' => '<b>The following servers went down:</b><br>%DOWN_SERVERS%<br><b>The following
servers are up again:</b><br>%UP_SERVERS%',
'combi_webhook_message' => '<b>The following servers went down:</b><br>%DOWN_SERVERS%<br><b>The following
servers are up again:</b><br>%UP_SERVERS%',
'combi_pushover_message' => '<b>The following servers went down:</b><br>%DOWN_SERVERS%<br><b>The following
servers are up again:</b><br>%UP_SERVERS%',
@ -489,8 +565,7 @@ $sm_lang = array(
'password_forgot' => 'Forgot password?',
'password_reset' => 'Reset password',
'password_reset_email_subject' => 'Reset your password for PHP Server Monitor',
'password_reset_email_body' => 'Please use the following link to reset your password. Please note it expires
in 1 hour.<br><br>%link%',
'password_reset_email_body' => 'Please use the following link to reset your password. Please note it expires in 1 hour.<br><br>%link%',
'error_user_incorrect' => 'The provided username could not be found.',
'error_login_incorrect' => 'The information is incorrect.',
'error_login_passwords_nomatch' => 'The provided passwords do not match.',

View File

@ -136,7 +136,7 @@ $sm_lang = array(
rel="noopener"><button class="btn btn-primary">Étape suivante</button></a>
<br>Cela va ouvrir une conversation avec le BOT. Vous devez appuyer sur
\'/start\' ou le saisir.',
'telegram_bot_username_error_token' => '<b>401 - Unauthorized</b>. Assuez-vous que le Token API soit valide.',
'telegram_bot_username_error_token' => '<b>401 - Unauthorized</b>. Assurez-vous que le Token API soit valide.',
'telegram_bot_error' => 'Une erreur s\'est produite en tentant d\'activer les notifications Telegram&nbsp;: %s',
'delete_title' => 'Supprimer un utilisateur',
'delete_message' => 'Êtes-vous sûr de vouloir supprimer l\'utilisateur \'%1\'&nbsp;?',
@ -194,7 +194,7 @@ $sm_lang = array(
'custom_request_method' => 'Type de requête personalisée',
'popular_request_methods' => 'Type de requête prédéfinie',
'post_field' => 'Champ POST',
'post_field_description' => 'Les données qui seront envoyés en utilisant le type de requête choisi.',
'post_field_description' => 'Les données qui seront envoyées en utilisant le type de requête choisi.',
'please_select' => 'Veuillez choisir',
'type' => 'Type',
'type_website' => 'Site Web',
@ -209,14 +209,14 @@ $sm_lang = array(
site, le serveur sera considéré hors-ligne.',
'redirect_check' => 'La redirection vers un autre domaine est',
'redirect_check_description' => 'Une redirection vers un autre domaine est généralement mauvais signe.',
'allow_http_status' => 'Autoriser les codes de status HTTP',
'allow_http_status_description' => 'Marquer le serveur en ligne. Les codes de status HTTP inférieur à 400
sont considérés comme en ligne par défaut. Séparés les valeurs avec
'allow_http_status' => 'Autoriser Les codes de statuts HTTP',
'allow_http_status_description' => 'Marquer le serveur en ligne. Les codes de statuts HTTP inférieur à 400
sont considérés comme en ligne par défaut. Séparer les valeurs avec
|.',
'header_name' => 'Nom d\'en-têtes',
'header_value' => 'Valeur d\'en-tête',
'header_name_description' => 'Sensible à la casse.',
'header_value_description' => 'Les expréssions régulières sont autorisées.',
'header_value_description' => 'Les expressions régulières sont autorisées.',
'last_check' => 'Dernière vérification',
'last_online' => 'Dernière fois OK',
'last_offline' => 'Dernière fois hors-ligne',
@ -277,11 +277,10 @@ $sm_lang = array(
'general' => 'Général',
'language' => 'Langue',
'show_update' => 'Vérifier les nouvelles mises à jour chaque semaine',
'password_encrypt_key' => 'Clée de cryptage des mots de passe',
'password_encrypt_key_note' => 'Cette clée est utilisée pour crypter les mots de passe qui sont enregistrés
dans la base de donnée pour les serveurs qui requiert une authentification.
Si la clé est modifié, les mots de passe enregistré ne seront plus
valide&nbsp;!',
'password_encrypt_key' => 'Clé de chiffrement des mots de passe',
'password_encrypt_key_note' => 'Cette clé est utilisée pour chiffrer les mots
de passe qui sont enregistrés dans la base de données pour les serveurs qui requierent une authentification. Si la clé
est modifiée, les mots de passe enregistrés ne seront plus valide&nbsp;!',
'proxy' => 'Activer le proxy',
'proxy_url' => 'URL du proxy',
'proxy_user' => 'Nom d\'utilisateur du proxy',
@ -358,8 +357,8 @@ $sm_lang = array(
'settings_notification' => 'Configuration des notifications',
'settings_log' => 'Configuration des événements',
'settings_proxy' => 'Configuration du proxy',
'auto_refresh' => 'Auto-rachaîchissement',
'auto_refresh_description' => 'Auto-rachaîchissement de la page serveurs.<br><span class="small">Temps en
'auto_refresh' => 'Auto-rafraîchissement',
'auto_refresh_description' => 'Auto-rafraîchissement de la page serveurs.<br><span class="small">Temps en
secondes. Si 0, la page n\'est pas rafraîchie.</span>',
'test' => 'Tester',
'test_email' => 'Un email va vous être envoyé à l\'adresse définie dans votre profil utilisateur.',
@ -385,9 +384,9 @@ $sm_lang = array(
définie dans votre profil.',
'telegram_sent' => 'Notification Telegram envoyée',
'telegram_error' => 'Une erreur s\'est produite lors de l\'envoi de la notification&nbsp;: %s',
'telegram_error_notoken' => 'Impossible d\'envoyé la notification de test&nbsp;: aucun token APII token
'telegram_error_notoken' => 'Impossible d\'envoyer la notification de test&nbsp;: aucun token APII token
trouvé dans la configuration.',
'telegram_error_noid' => 'Impossible d\'envoyé la notification de test&nbsp;: aucun ID de conversation
'telegram_error_noid' => 'Impossible d\'envoyer la notification de test&nbsp;: aucun ID de conversation
trouvé dans votre profil utilisateur.',
'log_retention_period' => 'Durée de conservation',
'log_retention_period_description' => 'Nombre de jours de conservation des événements envoyés et des temps
@ -416,7 +415,7 @@ $sm_lang = array(
'on_pushover_message' => 'Le Serveur \'%LABEL%\' est de nouveau OK, il était hors-ligne pendant
%LAST_OFFLINE_DURATION%:<br><br>Serveur: %LABEL%<br>IP: %IP%<br>Port:
%PORT%<br>Date: %DATE%',
'on_telegram_message' => 'Server \'%LABEL%\' is running again, it was down for:
'on_telegram_message' => 'Server \'%LABEL%\' est de nouveau OK, il était hors-ligne pendant:
%LAST_OFFLINE_DURATION%<br><br>Server: %LABEL%<br>IP: %IP%<br>Port: %PORT%<br>Date:
%DATE%',
'combi_off_email_message' => '<ul><li>Serveur&nbsp;: %LABEL%</li><li>IP&nbsp;: %IP%</li><li>Port&nbsp;:
@ -433,15 +432,15 @@ $sm_lang = array(
%DATE%</li></ul>',
'combi_on_telegram_message' => '- Serveur&nbsp;: %LABEL%<br>- IP: %IP%<br>- Port&nbsp;: %PORT%<br>-
Durée&nbsp;: %LAST_OFFLINE_DURATION%<br>- Date&nbsp;: %DATE%<br><br>',
'combi_email_subject' => 'IMPORTANT&nbsp;: \'%UP%\' serveurs de nouveaux en ligne, \'%DOWN%\' serveurs
'combi_email_subject' => 'IMPORTANT&nbsp;: \'%UP%\' serveur(s) de nouveau en ligne, \'%DOWN%\'
hors-ligne',
'combi_pushover_subject' => '\'%UP%\' serveurs de nouveaux en ligne, \'%DOWN%\' serveurs hors-ligne',
'combi_email_message' => '<b>Les serveurs suivants sont hors-ligne&nbsp;:</b><br>%DOWN_SERVERS%<br><b>Les
serveurs suivants sont en ligne&nbsp;:</b><br>%UP_SERVERS%',
'combi_pushover_message' => '<b>Les serveurs suivants sont hors-ligne&nbsp;:</b><br>%DOWN_SERVERS%<br><b>Les
serveurs suivants sont en ligne&nbsp;:</b><br>%UP_SERVERS%',
'combi_telegram_message' => '<b>Les serveurs suivants sont hors-ligne&nbsp;:</b><br>%DOWN_SERVERS%<br><b>Les
serveurs suivants sont en ligne&nbsp;:</b><br>%UP_SERVERS%',
'combi_pushover_subject' => '\'%UP%\' serveur(s) de nouveaux en ligne, \'%DOWN%\' serveur(s) hors-ligne',
'combi_email_message' => '<b>Le(s) serveur(s) suivant(s) hors-ligne&nbsp;:</b><br>%DOWN_SERVERS%<br><b>Le(s)
serveur(s) suivant(s) en ligne&nbsp;:</b><br>%UP_SERVERS%',
'combi_pushover_message' => '<b>Le(s) serveur(s) suivant(s) hors-ligne&nbsp;:</b><br>%DOWN_SERVERS%<br><b>Le(s)
serveur(s) suivant(s) en ligne&nbsp;:</b><br>%UP_SERVERS%',
'combi_telegram_message' => '<b>Le(s) serveur(s) suivant(s) hors-ligne&nbsp;:</b><br>%DOWN_SERVERS%<br><b>Le(s)
serveur(s) suivant(s) en ligne&nbsp;:</b><br>%UP_SERVERS%',
),
'login' => array(
'welcome_usermenu' => 'Bonjour %user_name%',

View File

@ -250,6 +250,7 @@ $sm_lang = array(
'language' => 'Taal',
'show_update' => 'Controleer wekelijks voor updates?',
'email_status' => 'Sta email berichten toe?',
'email_add_url' => 'Voeg url van de monitor toe aan de email',
'email_from_email' => 'Email van adres',
'email_from_name' => 'Email van naam',
'email_smtp' => 'SMTP gebruiken',
@ -275,6 +276,7 @@ $sm_lang = array(
target="_blank" rel="noopener">App registreren</a> via hun website, en
daarvan de App API Token hier invullen.',
'telegram_status' => 'Sta Telegram berichten toe?',
'telegram_add_url' => 'voeg url van de monitor toe aan het bericht',
'telegram_api_token' => 'Telegram API Token',
'alert_type' => 'Selecteer wanneer je een notificatie wilt',
'alert_type_description' => '<b>Status verandert:</b> Je ontvangt alleen bericht wanneer een server van status

View File

@ -22,7 +22,7 @@
* @author Arkadiusz Klenczar <a.klenczar@gmail.com>
* @copyright Copyright (c) 2008-2017 Pepijn Over <pep@mailbox.org>
* @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3
* @version Release: @package_version@
* @version Release: v3.5.2
* @link http://www.phpservermonitor.org/
**/
@ -43,6 +43,7 @@ $sm_lang = array(
'save' => 'Zapisz',
'edit' => 'Edycja',
'delete' => 'Usuń',
'view' => 'Zobacz',
'date' => 'Data',
'message' => 'Wiadomość',
'yes' => 'Tak',
@ -54,8 +55,11 @@ $sm_lang = array(
rel="noopener">http://www.phpservermonitor.org</a>.',
'back_to_top' => 'Do góry',
'go_back' => 'Wstecz',
'ok' => 'OK',
'ok' => 'pożądane',
'bad' => 'niepożądane',
'cancel' => 'Anuluj',
'none' => 'Brak',
'activate' => 'Aktywny',
'short_day_format' => '%B %e',
'long_day_format' => '%B %e, %Y',
'yesterday_format' => 'Wczoraj o %k:%M',
@ -67,7 +71,23 @@ $sm_lang = array(
'a_minute_ago' => 'minutę temu',
'seconds_ago' => '%d sekund temu',
'a_second_ago' => 'sekundę temu',
'seconds' => 'sekund',
'year' => 'rok',
'years' => 'lata',
'month' => 'miesiąc',
'months' => 'miesiące',
'day' => 'dzień',
'days' => 'dni',
'hour' => 'godzina',
'hours' => 'godziny',
'minute' => 'minuta',
'minutes' => 'minut',
'second' => 'sekunda',
'seconds' => 'sekundy',
'millisecond' => 'milisekunka',
'milliseconds' => 'milisekundy',
'current' => 'aktualnie',
'settings' => 'Ustawienia',
'search' => 'Szukaj',
),
'menu' => array(
'config' => 'Konfiguracja',
@ -101,6 +121,39 @@ $sm_lang = array(
'pushover_device' => 'Urządzenie dla Pushover',
'pushover_device_description' => 'Nazwa urządzenia do którego wysłać powiadomienie. Pozostaw puste aby
wysłać do wszystkich urządzeń.',
'discord' => 'Discord',
'discord_label' => 'Discord',
'discord_description' => 'Podaj swoje <a href="https://discordjs.guide/popular-topics/webhooks.html"
target="_blank">webhook</a> tutaj.',
'telegram' => 'Telegram',
'telegram_description' => '<a href="https://telegram.org/" target="_blank">Telegram</a> jest komunikatorem
internetowym, który umożliwa notyfikacje w czasie rzeczywistym. Odwiedź stronę
z <a href="http://docs.phpservermonitor.org/" target="_blank">documentacja</a> aby
uzyskać więcej informacji.',
'telegram_chat_id' => 'Telegram chat id',
'telegram_chat_id_description' => 'Wiadomość zostanie wysłana do odpowiedniej rozmowy.',
'telegram_get_chat_id' => 'Kliknij tutaj żeby otrzywać swój chat id',
'activate_telegram' => 'Aktywuj notyfikacje Telegram',
'activate_telegram_description' => 'Zezwól na wysyłanie notyfikacji Telegram do podanego chat id. Bez tej
zgodny Telegram nie zezwoli na wysyłanie notyfikacji do Ciebie.',
'telegram_bot_username_found' => 'Bot został odnaleziony!<br><a href="%s" target="_blank"
rel="noopener"><button class="btn btn-primary">Następny krok</button></a>
<br>Następnie otworzy się okno rozmowy z botem. Musisz nacisnąć start
lub wpisać /start.',
'telegram_bot_username_error_token' => '401 - Błąd autoryzacji. Proszę sprawdzić czy API token jest
prawidłowy.',
'telegram_bot_error' => 'Wystąpił błąd podczas aktywowania notyfikacji Telegram: %s',
'jabber' => 'Jabber',
'jabber_label' => 'Jabber',
'jabber_description' => 'Twoje konto Jabber',
'webhook' => 'Webhook',
'webhook_description' => 'Wyślij json webhook do wybranego endpoint. <br/>Zapytanie json może być dowolnie
dostosowane np. {"text":"servermon: #message"}',
'webhook_url' => 'Webhook URL',
'webhook_url_description' => 'Publiczne webhook endpoint URL powinny się zaczynać od https://.',
'webhook_json' => 'Webhook JSON',
'webhook_json_description' => 'Zdefiniuj niestandardowy json, użyj #message jak zmienną z treścią
wiadomości.',
'delete_title' => 'Usuń użytkownika',
'delete_message' => 'Czy jesteś pewny że chcesz usunąć użytkownika \'%1\'?',
'deleted' => 'Użytkownik usunięty.',
@ -118,6 +171,7 @@ $sm_lang = array(
'error_user_no_match' => 'Użytkownik nie został odnaleziony.',
'error_user_password_invalid' => 'Wprowadzone hasło jest nieprawidłowe.',
'error_user_password_no_match' => 'Wprowadzone hasła są różne.',
'error_user_admin_cant_be_deleted' => 'Nie można usunąć jedynego konta administratora.',
),
'log' => array(
'title' => 'Logi',
@ -125,7 +179,11 @@ $sm_lang = array(
'status' => 'Status',
'email' => 'Email',
'sms' => 'SMS',
'discord' => 'Discord',
'pushover' => 'Pushover',
'webhook' => 'Webhook',
'telegram' => 'Telegram',
'jabber' => 'Jabber',
'no_logs' => 'Brak logów',
'clear' => 'Wyczyść log',
'delete_title' => 'Wyczyść log',
@ -138,23 +196,70 @@ $sm_lang = array(
'domain' => 'Domena/IP',
'timeout' => 'Timeout',
'timeout_description' => 'Liczba sekund do odczekania na odpowiedź serwera.',
'authentication_settings' => 'Ustawienia uwierzytelniania',
'optional' => 'Opcjonalne',
'website_username' => 'Nazwa użytkownika',
'website_username_description' => 'Nazwa użytkownika z dostępem do strony (tylko uwierzytelnianie Apache
jest wspierana).',
'website_password' => 'Hasło',
'website_password_description' => 'Hasło dostęput do strony. Hasło zostanie zaszyfrowane i zapisane w
badzie danych.',
'fieldset_monitoring' => 'Monitoring',
'fieldset_permissions' => 'Uprawnienia',
'permissions' => 'Serwer będzie widoczny dla następujących użytkowników',
'port' => 'Port',
'custom_port' => 'Niestandardowy port',
'popular_ports' => 'Popularne porty',
'request_method' => 'Metoda HTTP',
'custom_request_method' => 'Niestandardowe metoda HTTP',
'popular_request_methods' => 'Popularne metody HTTP',
'post_field' => 'Pole Post',
'post_field_description' => 'Dane zostaną wysłane za pomocą wyżej wybranej metody.',
'please_select' => 'Proszę wybrać',
'type' => 'Typ',
'type_website' => 'Strona',
'type_service' => 'Usługa',
'type_ping' => 'Ping',
'pattern' => 'Wyszukiwane wyrażenie/wzorzec',
'pattern_description' => 'Jeśli wzorzec nie zostanie odnaleziony, status zostanie ustawiony na offline.
Wyrażenia regularne dozwolone.',
'pattern_description' => 'Jeśli wzorzec nie zostanie odnaleziony, status zostanie zmieniony. Dozwolone
wyrażenia regularne.',
'pattern_online' => 'Wykrycie wzorca oznacza, że strona jest',
'pattern_online_description' => 'Online: jeżeli wzorzec zostanie wykryty na stronie to server zostanie
oznaczony jako online. Offline: jeżeli wzorzec nie zostanie wykryty na
stronie to serwer zostanie oznaczony jako offline.',
'redirect_check' => 'Przekierowanie na inną domenę jest',
'redirect_check_description' => 'Przekierowanie na inną domenę zazwyczaj jest niepożądanym zachowaniem.',
'allow_http_status' => 'Dozwolone kody odpowiedzi HTTP',
'allow_http_status_description' => 'Podaj listę dozwolonych kodów odpowiedzi HTTP, kolejne wartości
oddzielone za pomocą |. Domyślnie odpowiedzi o wartości poniżej 400
zostaną uznane jako prawidłowe.',
'header_name' => 'Nazwa nagłówka',
'header_value' => 'Wartość nagłówka',
'header_name_description' => 'Wielkość liter ma znaczenie.',
'header_value_description' => 'Dozwolone są wyrażenia regularne.',
'last_check' => 'Ostatnie sprawdzenie',
'last_online' => 'Ostatnio online',
'last_offline' => 'Ostatnio offline',
'last_output' => 'Ostatni prawidłowy wynik',
'last_error' => 'Ostatni bląd',
'last_error_output' => 'Ostatni wynik blądu',
'output' => 'Wynik',
'monitoring' => 'Monitorowany',
'no_monitoring' => 'Brak monitoringu',
'email' => 'Email',
'send_email' => 'Wyślij Email',
'sms' => 'SMS',
'send_sms' => 'Wyślij SMS',
'discord' => 'Discord',
'send_discord' => 'Wyślij powiadomienie Discord',
'webhook' => 'Webook',
'send_webhook' => 'Wyślij powiadomienie Webhook',
'pushover' => 'Pushover',
'send_pushover' => 'Wyślij powiadomienie Pushover',
'telegram' => 'Telegram',
'send_telegram' => 'Wyślij powiadomienie Telegram',
'jabber' => 'Jabber',
'send_jabber' => 'Wyślij powiadomienie Jabber',
'users' => 'Użytkownicy',
'delete_title' => 'Usuń serwer',
'delete_message' => 'Czy jesteś pewny że chcesz usunąć serwer \'%1\'?',
@ -165,6 +270,8 @@ $sm_lang = array(
'latency_max' => 'Opóźnienie (maksymalne)',
'latency_min' => 'Opóźnienie (minimalne)',
'latency_avg' => 'Opóźnienie (średnie)',
'online' => 'online',
'offline' => 'offline',
'uptime' => 'Czas dostępności',
'year' => 'Rok',
'month' => 'Miesiąc',
@ -173,6 +280,12 @@ $sm_lang = array(
'hour' => 'Godzina',
'warning_threshold' => 'Próg ostrzeżeń',
'warning_threshold_description' => 'Ilość wymaganych niepowodzeń przed oznaczeniem serwera jako offline.',
'ssl_cert_expiry_days' => 'Ważność certyfikatu SSL',
'ssl_cert_expiry_days_description' => 'Minimalna ilość dni, których certyfikat SSL musi być ważny.
Ustawienie wartości 0 spowoduje, że ważność certyfikatu nie
będzie sprawdzana.',
'ssl_cert_expired' => 'Certyfikat SSL wygasł',
'ssl_cert_expiring' => 'Certyfikat SSL wygaśnie:',
'chart_last_week' => 'Ostatni tydzień',
'chart_history' => 'Historia',
'chart_day_format' => '%Y-%m-%d',
@ -181,7 +294,11 @@ $sm_lang = array(
'chart_short_time_format' => '%H:%M',
'warning_notifications_disabled_sms' => 'Powiadomienia SMS są wyłączone.',
'warning_notifications_disabled_email' => 'Powiadomienia Email są wyłączone.',
'warning_notifications_disabled_discord' => 'Powiadomienia Discord są wyłączone.',
'warning_notifications_disabled_webhook' => 'Powiadomienia Webhook są wyłączone.',
'warning_notifications_disabled_pushover' => 'Powiadomienia Pushover są wyłączone.',
'warning_notifications_disabled_telegram' => 'Powiadomienia Telegram są wyłączone.',
'warning_notifications_disabled_jabber' => 'Powiadomienia Jabber są wyłączone.',
'error_server_no_match' => 'Nie odnaleziono serwera.',
'error_server_label_bad_length' => 'Etykieta musi mieć pomiędzy 1 a 255 znaków.',
'error_server_ip_bad_length' => 'Domena/IP musi mieć pomiędzy 1 a 255 znaków.',
@ -189,12 +306,22 @@ $sm_lang = array(
'error_server_ip_bad_website' => 'Adres URL jest nieprawidłowy.',
'error_server_type_invalid' => 'Wybrany typ serwera jest nieprawidłowy.',
'error_server_warning_threshold_invalid' => 'Próg ostrzeżeń musi być liczbą całkowitą większą od 0.',
'error_server_ssl_cert_expiry_days' => 'Minimalna ilość dla ważności certyfikatu SSL musi być liczbą
całkowitą większą lub równą 0.',
),
'config' => array(
'general' => 'Ogólne',
'site_title' => 'Tytuł strony',
'language' => 'Język',
'show_update' => 'Sprawdzić aktualizacje?',
'password_encrypt_key' => 'Klucz szyfrowania haseł',
'password_encrypt_key_note' => 'Klucz będzie użyty do szyfrowania haseł, które zapisane w ustawieniach
serwerów żeby mieć dostęp do stron. Jeżeli klucz zostanie zmienione to
zapisane hasła będą nieprawidłowe!',
'proxy' => 'Włącz proxy',
'proxy_url' => 'Proxy ULR',
'proxy_user' => 'Użytkownik proxy',
'proxy_password' => 'Hasło proxy',
'email_status' => 'Pozwól na wysyłkę email',
'email_from_email' => 'Email z adresu',
'email_from_name' => 'Email od(nazwa)',
@ -205,13 +332,24 @@ $sm_lang = array(
'email_smtp_security_none' => 'None',
'email_smtp_username' => 'SMTP login',
'email_smtp_password' => 'SMTP hasło',
'email_smtp_noauth' => 'Pozostaw puste dla braku autentykacji',
'email_smtp_noauth' => 'Pozostaw puste dla braku uwierzytelniania',
'sms_status' => 'Pozwól na wysyłkę SMS',
'sms_gateway' => 'Bramka SMS',
'sms_gateway_username' => 'Login do bramki',
'sms_gateway_password' => 'Hasło do bramki',
'sms_from' => 'Numer nadawcy',
'pushover_status' => 'Pozwól na wysyłkę notyfikacji Pushover',
'discord_status' => 'Zezwól na wysyłanie powiadomień Discord',
'discord_description' => 'Discord jest serwisem, który umożliwia wysyłania powiadomień w czasie
rzeczywistym. Odwiedź <a href="https://discord.com/" target="_blank">stronę
serwisu</a> żeby otrzymać więcej informacji.',
'webhook_status' => 'Zezwól na wysyłanie powiadomień webhooks.',
'webhook_description' => 'Zezwól na wysyłanie powiadomień webhooks do serwisów takich jak Slack. Endpoint
dla payload wiadomości jest zdefiniowany w ustawieniach profilu użytkownika.',
'webhook_url' => 'Webhook URL',
'webhook_url_description' => 'URL dla webhook endpoint',
'webhook_json' => 'Webhook Json',
'webhook_json_description' => 'Niestandardowsy Json, użyj #message jak zmienną z treścią wiadomości.',
'pushover_status' => 'Zezwól na wysyłanie powiadomień Pushover',
'pushover_description' => 'Pushover jest usługą ułatwiającą otrzymywanie powiadomień w czasie
rzeczywistym. Sprawdź <a href="https://pushover.net/" target="_blank">ich
stronę</a> aby uzyskać więcej informacji.',
@ -220,6 +358,30 @@ $sm_lang = array(
'pushover_api_token_description' => 'Zanim zaczniesz używać Pushover, musisz <a href="%1$s" target="_blank"
rel="noopener"> zarejestrować aplikację</a> na ich stronie internetowej
i wpisać tutaj App API Token.',
'telegram_status' => 'Zezwól na wysyłanie powiadomień Telegram',
'telegram_description' => '<a href="https://telegram.org/" target="_blank">Telegram</a> jest komunikatorem
internetowym, który umożliwa notyfikacje w czasie rzeczywistym. Odwiedź stronę
z <a href="http://docs.phpservermonitor.org/" target="_blank">documentacja</a> aby
uzyskać więcej informacji.',
'telegram_api_token' => 'Telegram API Token',
'telegram_api_token_description' => 'Zanim zaczniesz używać Telegram, potrzebujesz uzyskać API Token.
Odwiedź strone z <a href="http://docs.phpservermonitor.org/"
target="_blank">dokumentacją</a> żeby uzyskać pomocy.',
'jabber_status' => 'Zezwól na wysyłanie powiadomień Jabber (XMPP)',
'jabber_description' => 'Odwiedź stronę <a href="http://docs.phpservermonitor.org/">dokumentacją</a> aby
uzyskać więcej informaji oraz przewodnik po instalacji.',
'jabber_host' => 'Host',
'jabber_host_description' => 'Adres host dostawcy Twojego konta Jabber. Dla konta Google użyj
talk.google.com.',
'jabber_port' => 'Port',
'jabber_port_description' => 'Port Twojego dostawcy Jabber. Domyślnie 5222. Dla konta Google użyj 5223.',
'jabber_username' => 'Nazwa użytkownika',
'jabber_username_description' => 'Dla konta Google użyj razem z domeną np. example@google.com.',
'jabber_domain' => 'Domena',
'jabber_domain_description' => 'Domena Twojego dostawy Jabber. Zostaw puste dla konta Google.',
'jabber_password' => 'Hasło',
'jabber_password_description' => 'Wypełnij tylko żeby ustawić lub zmienić.',
'jabber_check' => 'Sprawdź swoje konto Jabber czy powiadomienie zostało odebrane.',
'alert_type' => 'Wybierz kiedy chcesz być powiadomiony.',
'alert_type_description' => '<b>Zmiana statusu:</b> Otrzymasz powiadomienie gdy serwer zmieni status. Z online
-> offline lub offline -> online.<br><br /><b>Offline:</b> Otrzymasz
@ -231,29 +393,53 @@ $sm_lang = array(
'alert_type_status' => 'Zmiana statusu',
'alert_type_offline' => 'Offline',
'alert_type_always' => 'Zawsze',
'combine_notifications' => 'Scalanie powiadomień',
'combine_notifications_description' => 'Ogranicza ilość wysyłanych powiadomień poprzez scalanie wszystkich
powiadomień w jedną wiadomość (nie dotyczy powiadomień SMS).',
'alert_proxy' => 'Jeżeli włączone to proxy nigdy nie bedzie użyte dla serwisów',
'alert_proxy_url' => 'Fomat: host:port',
'log_status' => 'Status logowania',
'log_status_description' => 'Jeśli status logowania ustawiony jest na TRUE, monitor będzie logował
wydarzenia.',
'log_email' => 'Emaile wysłane przez skrypt',
'log_sms' => 'SMS wysłane przez skrypt',
'log_discord' => 'Notyfikacje Discord wysłane przez skrypt',
'log_pushover' => 'Notyfikacje Pushover wysłane przez skrypt',
'log_webhook' => 'Notyfikacje Webhook wysłane przez skrypt',
'log_telegram' => 'Notyfikacje Telegram wysłane przez skrypt',
'log_jabber' => 'Notyfikacje Jabber wysłane przez skrypt',
'updated' => 'Konfiguracja została zaktualizowana.',
'tab_email' => 'Email',
'tab_sms' => 'SMS',
'tab_discord' => 'Discord',
'tab_pushover' => 'Pushover',
'tab_webhook' => 'Webhook',
'tab_telegram' => 'Telegram',
'tab_jabber' => 'Jabber',
'settings_email' => 'Ustawienia Email',
'settings_sms' => 'Ustawienia SMS',
'settings_discord' => 'Ustawienie Discord',
'settings_pushover' => 'Ustawienia Pushover',
'settings_webhook' => 'Ustawienia Webhook',
'settings_telegram' => 'Ustawienia Telegram',
'settings_jabber' => 'Ustawienia Jabber',
'settings_notification' => 'Ustawienia powiadomień',
'settings_log' => 'Ustawienia Logowania',
'settings_proxy' => 'Ustawienia serwera Proxy',
'auto_refresh' => 'Auto-odświeżanie',
'auto_refresh_description' => 'Auto-odświeżanie strony serwera.<br><span class="small">Czas w sekundach, dla
czasu 0 strona nie będzie odświeżana.</span>',
'test' => 'Test',
'test_email' => 'Email zostanie wysłany na adres podany w Twoim profilu.',
'test_sms' => 'SMS zostanie wysłany na numer podany w Twoim profilu.',
'test_pushover' => 'Powiadomienie Pushover zostanie wysłany na klucz użytkownika/urządzenie podane w Twoim
profilu..',
'test_discord' => 'Powiadomienie Discord zostanie wysłane do webhook, który został podany w Twoim profilu
użytkownika.',
'test_pushover' => 'Powiadomienie Pushover zostanie wysłane na klucz użytkownika/urządzenie podane w Twoim
profilu użytkownika.',
'test_webhook' => 'Powiadomienia Webhook zostanie wysłane do endpoint o podanym URL.',
'test_telegram' => 'Powiadomienie Telegram zostanie wysłane na chat id podane w Twoim profilu użytkownika.',
'test_jabber' => 'Powiadomienie Telegram zostanie wysłane na konto Jabber podane w Twoim profilu
użytkownika.',
'send' => 'Wyślij',
'test_subject' => 'Test',
'test_message' => 'Testowa wiadomość',
@ -262,38 +448,123 @@ $sm_lang = array(
'sms_sent' => 'Sms wysłany',
'sms_error' => 'Błąd podczas wysyłania sms. %s',
'sms_error_nomobile' => 'Nie udało się wysłać testowego SMS: brak poprawnego telefonu w Twoim profilu.',
'discord_sent' => 'Powiadomienie Discord wysłane',
'discord_error' => 'Błąd podczas wysyłania powiadomienia Pushover: %s',
'discord_error_nowebhook' => 'Błąd podczas wysyłania powiadomienia Discord: brak prawidłowego Discord
webhook w profilu użytkownika.',
'webhook_sent' => 'Powiadomienie Webhook wysłane',
'webhook_error' => 'Błąd podczas wysyłania powiadomienia Webhook: %s',
'webhook_error_nourl' => 'Błąd podczas wysyłania testowego powiadomienia: brak Webhook URL w profilu
użytkownika.',
'webhook_error_nojson' => 'Błąd podczas wysyłania testowego powiadomienia: brak json w profilu
użytkownika.',
'pushover_sent' => 'Powiadomienie Pushover wysłane.',
'pushover_error' => 'Błąd podczas wysyłania powiadomienia Pushover: %s',
'pushover_error_noapp' => 'Błąd podczas wysyłania testowego powiadomienia: brak Pushover App API token w
konfuguracji globalnej.',
konfiguracji globalnej.',
'pushover_error_nokey' => 'Błąd podczas wysyłania testowego powiadomienia: brak Pushover key na Twoim
profilu.',
'telegram_sent' => 'Powiadomienie Telegram zostało wysłane',
'telegram_error' => 'Wystąpił błąd podczas wysyłania powiadomienia Telegram: %s',
'telegram_error_notoken' => 'Nie można wysłać testowego powiadomienia: brak Telegram API token w głównych
ustawieniach systemu.',
'telegram_error_noid' => 'Nie można wysłać testowego powiadomienia: brak chat id w ustawieniach profilu
Twojego użytkownika.',
'jabber_sent' => 'Powiadomienie Jabber zostało wysłane',
'jabber_error' => 'Wystąpił błąd podczas wysyłania powiadomienia Jabber: %s',
'jabber_error_noconfig' => 'Nie można wysłać testowego powiadomienia: brak konfiguracji konta Jabber w
głównych ustawieniach systemu.',
'jabber_error_noaccount' => 'Nie można wysłać testowego powiadomienia: brak konfiguracji konta Jabber w
ustawieniach profilu Twojego użytkownika.',
'log_retention_period' => 'Czas rotacji logów',
'log_retention_period_description' => 'Liczba dni przez którą należy przetrzymywać logi powiadomień i
archiwizować uptime serwera. Wpisz 0 aby wyłączyć czyszczenie
logów.',
'log_retention_days' => 'dni',
'user_agent' => 'User Agent',
'user_agent_key_note' => 'Nazwa używana przez monitoring do identyfikacji ze sprawdzaną usługą.',
'user_agent_key_note' => 'Niestandardowy user agent używany przez monitor do komunikacji z zewnętrznymi
serwisami.',
),
'notifications' => array(
'off_sms' => 'Serwer \'%LABEL%\' przestał odpowiadać: ip=%IP%, port=%PORT%. Błąd=%ERROR%',
'off_email_subject' => 'Uwaga: Serwer \'%LABEL%\' nie odpowiada',
'off_email_body' => 'Błąd połączenia do serwera:<br><br>Serwer: %LABEL%<br>IP: %IP%<br>Port:
%PORT%<br>Błąd: %ERROR%<br>Data: %DATE%',
'off_discord_message' => 'Błąd połączenia do serwera:<br><br>Serwer: %LABEL%<br>IP: %IP%<br>Port:
%PORT%<br>Błąd: %ERROR%<br>Data: %DATE%',
'off_webhook_title' => 'Serwer \'%LABEL%\' nie odpowiada',
'off_webhook_message' => 'Błąd połączenia do serwera:<br><br>Serwer: %LABEL%<br>IP: %IP%<br>Port:
%PORT%<br>Błąd: %ERROR%<br>Data: %DATE%',
'off_pushover_title' => 'Serwer \'%LABEL%\' nie odpowiada',
'off_pushover_message' => 'Błąd połączenia do serwera:<br><br>Serwer: %LABEL%<br>IP: %IP%<br>Port:
%PORT%<br>Błąd: %ERROR%<br>Data: %DATE%',
'off_telegram_message' => 'Błąd połączenia do serwera:<br><br>Serwer: %LABEL%<br>IP: %IP%<br>Port:
%PORT%<br>Błąd: %ERROR%<br>Data: %DATE%',
'off_jabber_message' => 'Błąd połączenia do serwera:<br><br>Serwer: %LABEL%<br>IP: %IP%<br>Port:
%PORT%<br>Błąd: %ERROR%<br>Data: %DATE%',
'on_sms' => 'Serwer \'%LABEL%\' działa poprawnie: ip=%IP%, port=%PORT%, it was down for
%LAST_OFFLINE_DURATION%',
'on_email_subject' => 'Uwaga: Serwer \'%LABEL%\' działa poprawnie',
'on_email_body' => 'Serwer \'%LABEL%\' znów odpowiada, it was down for
'on_email_body' => 'Serwer \'%LABEL%\' znów odpowiada, był offline przez
%LAST_OFFLINE_DURATION%:<br><br>Serwer: %LABEL%<br>IP: %IP%<br>Port: %PORT%<br>Data:
%DATE%',
'on_discord_message' => 'Serwer \'%LABEL%\' znów odpowiada, był offline przez
%LAST_OFFLINE_DURATION%:<br><br>Serwer: %LABEL%<br>IP: %IP%<br>Port: %PORT%<br>Data:
%DATE%',
'on_webhook_title' => 'Serwer \'%LABEL%\' działa poprawnie',
'on_webhook_message' => 'Serwer \'%LABEL%\' znów odpowiada, był offline przez
%LAST_OFFLINE_DURATION%:<br><br>Serwer: %LABEL%<br>IP: %IP%<br>Port: %PORT%<br>Data:
%DATE%',
'on_pushover_title' => 'Serwer \'%LABEL%\' działa poprawnie',
'on_pushover_message' => 'Serwer \'%LABEL%\' znów działa poprawnie, it was down for
'on_pushover_message' => 'Serwer \'%LABEL%\' znów działa poprawnie, był offline przez
%LAST_OFFLINE_DURATION%:<br><br>Serwer: %LABEL%<br>IP: %IP%<br>Port: %PORT%<br>Data:
%DATE%',
'on_telegram_message' => 'Serwer \'%LABEL%\' znów działa poprawnie, był offline przez
%LAST_OFFLINE_DURATION%:<br><br>Serwer: %LABEL%<br>IP: %IP%<br>Port: %PORT%<br>Data:
%DATE%',
'on_jabber_message' => 'Serwer \'%LABEL%\' znów działa poprawnie, był offline przez
%LAST_OFFLINE_DURATION%:<br><br>Serwer: %LABEL%<br>IP: %IP%<br>Port: %PORT%<br>Data:
%DATE%',
'combi_off_email_message' => '<ul><li>Server: %LABEL%</li><li>IP: %IP%</li><li>Port: %PORT%</li><li>Error:
%ERROR%</li><li>Date: %DATE%</li></ul>',
'combi_off_discord_message' => '- Server: %LABEL%<br>- IP: %IP%<br>- Port: %PORT%<br>- Error: %ERROR%<br>-
Date: %DATE%<br><br>',
'combi_off_webhook_message' => '<ul><li>Server: %LABEL%</li><li>IP: %IP%</li><li>Port: %PORT%</li><li>Error:
%ERROR%</li><li>Date: %DATE%</li></ul>',
'combi_off_pushover_message' => '<ul><li>Server: %LABEL%</li><li>IP: %IP%</li><li>Port: %PORT%</li><li>Error:
%ERROR%</li><li>Date: %DATE%</li></ul>',
'combi_off_telegram_message' => '- Server: %LABEL%<br>- IP: %IP%<br>- Port: %PORT%<br>- Error: %ERROR%<br>-
Date: %DATE%<br><br>',
'combi_off_jabber_message' => '- Server: %LABEL%<br>- IP: %IP%<br>- Port: %PORT%<br>- Error: %ERROR%<br>-
Date: %DATE%<br><br>',
'combi_on_email_message' => '<ul><li>Server: %LABEL%</li><li>IP: %IP%</li><li>Port: %PORT%</li><li>Downtime:
%LAST_OFFLINE_DURATION%</li><li>Date: %DATE%</li></ul>',
'combi_on_webhook_message' => '<ul><li>Server: %LABEL%</li><li>IP: %IP%</li><li>Port: %PORT%</li><li>Downtime:
%LAST_OFFLINE_DURATION%</li><li>Date: %DATE%</li></ul>',
'combi_on_discord_message' => '- Server: %LABEL%<br>- IP: %IP%<br>- Port: %PORT%<br>- Downtime:
%LAST_OFFLINE_DURATION%<br>- Date: %DATE%<br><br>',
'combi_on_pushover_message' => '<ul><li>Server: %LABEL%</li><li>IP: %IP%</li><li>Port:
%PORT%</li><li>Downtime: %LAST_OFFLINE_DURATION%</li><li>Date:
%DATE%</li></ul>',
'combi_on_telegram_message' => '- Server: %LABEL%<br>- IP: %IP%<br>- Port: %PORT%<br>- Downtime:
%LAST_OFFLINE_DURATION%<br>- Date: %DATE%<br><br>',
'combi_on_jabber_message' => '- Server: %LABEL%<br>- IP: %IP%<br>- Port: %PORT%<br>- Downtime:
%LAST_OFFLINE_DURATION%<br>- Date: %DATE%<br><br>',
'combi_email_subject' => 'WAŻNE: \'%UP%\' serverów znowu ONLINE, \'%DOWN%\' serverów jest OFFLINE',
'combi_webhook_subject' => '\'%UP%\' serverów jest znowu ONLINE UP, \'%DOWN%\' serverów jest OFFLINE',
'combi_pushover_subject' => '\'%UP%\' serverów jest znowu ONLINE UP, \'%DOWN%\' serverów jest OFFLINE',
'combi_email_message' => '<b>Następujące serwery offline:</b><br>%DOWN_SERVERS%<br><b>Następujące
serwery znowu online:</b><br>%UP_SERVERS%',
'combi_discord_message' => '<b>Następujące serwery offline:</b><br>%DOWN_SERVERS%<br><b>Następujące
serwery znowu online:</b><br>%UP_SERVERS%',
'combi_webhook_message' => '<b>Następujące serwery offline:</b><br>%DOWN_SERVERS%<br><b>Następujące
serwery znowu online:</b><br>%UP_SERVERS%',
'combi_pushover_message' => '<b>Następujące serwery offline:</b><br>%DOWN_SERVERS%<br><b>Następujące
serwery znowu online:</b><br>%UP_SERVERS%',
'combi_telegram_message' => '<b>Następujące serwery offline:</b><br>%DOWN_SERVERS%<br><b>Następujące
serwery znowu online:</b><br>%UP_SERVERS%',
'combi_jabber_message' => '<b>Następujące serwery offline:</b><br>%DOWN_SERVERS%<br><b>Następujące
serwery znowu online:</b><br>%UP_SERVERS%',
),
'login' => array(
'welcome_usermenu' => 'Witaj, %user_name%',

View File

@ -124,7 +124,7 @@ abstract class AbstractController implements ControllerInterface
* @var int $user_level_required
* @see setMinUserLevelRequired()
*/
protected $user_level_required = PSM_USER_USER;
protected $user_level_required = (PSM_PUBLIC && PSM_PUBLIC_PAGE) ? PSM_USER_ANONYMOUS : PSM_USER_USER;
/**
* Required user level for certain actions

View File

@ -41,19 +41,27 @@ class ConfigController extends AbstractController
protected $checkboxes = array(
'proxy',
'email_status',
'email_add_url',
'email_smtp',
'sms_status',
'discord_status',
'pushover_status',
'webhook_status',
'telegram_status',
'telegram_add_url',
'jabber_status',
'log_status',
'log_email',
'log_sms',
'log_discord',
'log_pushover',
'log_webhook',
'log_telegram',
'log_jabber',
'show_update',
'combine_notifications',
'dirauth_status',
'authdir_ldapfollowref',
);
/**
@ -72,6 +80,8 @@ class ConfigController extends AbstractController
'sms_gateway_username',
'sms_gateway_password',
'sms_from',
'webhook_url',
'webhook_json',
'pushover_api_token',
'telegram_api_token',
'jabber_host',
@ -79,7 +89,18 @@ class ConfigController extends AbstractController
'jabber_username',
'jabber_domain',
'user_agent',
'site_title'
'site_title',
'authdir_host_locn',
'authdir_host_port',
'authdir_userdomain',
'authdir_ldapver',
'authdir_basedn',
'authdir_usernameattrib',
'authdir_groupnameattrib',
'authdir_groupmemattrib',
'authdir_usercontainerrdn',
'authdir_groupcontainerrdn',
'authdir_groupname',
);
/**
@ -156,6 +177,20 @@ class ConfigController extends AbstractController
);
}
foreach (array("20", "10") as $authdir_defaultrole) {
$tpl_data['authdir_defaultroles'][] = array(
'value' => $authdir_defaultrole,
'label' => psm_get_lang('users', 'level_' . $authdir_defaultrole),
);
}
foreach (array("openldap", "adds", "adlds") as $authdir_type) {
$tpl_data['authdir_type'][] = array(
'value' => $authdir_type,
'label' => psm_get_lang('config', 'authdir_type_' . $authdir_type),
);
}
$tpl_data['email_smtp_security'] = array(
array(
'value' => '',
@ -175,6 +210,10 @@ class ConfigController extends AbstractController
$config['sms_gateway'] : current($sms_gateways);
$tpl_data['alert_type_selected'] = isset($config['alert_type']) ?
$config['alert_type'] : '';
$tpl_data['authdir_type_selected'] = isset($config['authdir_type']) ?
$config['authdir_type'] : '';
$tpl_data['authdir_defaultrole_selected'] = isset($config['authdir_defaultrole']) ?
$config['authdir_defaultrole'] : '20';
$tpl_data['email_smtp_security_selected'] = isset($config['email_smtp_security']) ?
$config['email_smtp_security'] : '';
$tpl_data['auto_refresh_servers'] = isset($config['auto_refresh_servers']) ?
@ -208,7 +247,8 @@ class ConfigController extends AbstractController
$tpl_data[$this->default_tab . '_active'] = 'active';
$testmodals = array('email', 'sms', 'pushover', 'telegram', 'jabber');
$testmodals = array('email', 'sms', 'discord', 'webhook', 'pushover', 'telegram', 'jabber');
foreach ($testmodals as $modal_id) {
$modal = new \psm\Util\Module\Modal(
$this->twig,
@ -237,6 +277,8 @@ class ConfigController extends AbstractController
'site_title' => $_POST['site_title'],
'sms_gateway' => $_POST['sms_gateway'],
'alert_type' => $_POST['alert_type'],
'authdir_defaultrole' => $_POST['authdir_defaultrole'],
'authdir_type' => $_POST['authdir_type'],
'email_smtp_security' =>
in_array($_POST['email_smtp_security'], array('', 'ssl', 'tls'))
? $_POST['email_smtp_security']
@ -270,8 +312,12 @@ class ConfigController extends AbstractController
$this->testEmail();
} elseif (!empty($_POST['test_sms'])) {
$this->testSMS();
} elseif (!empty($_POST['test_discord'])) {
$this->testDiscord();
} elseif (!empty($_POST['test_pushover'])) {
$this->testPushover();
}elseif (!empty($_POST['test_webhook'])) {
$this->testWebhook();
} elseif (!empty($_POST['test_telegram'])) {
$this->testTelegram();
} elseif (!empty($_POST['test_jabber'])) {
@ -285,12 +331,18 @@ class ConfigController extends AbstractController
if (isset($_POST['general_submit'])) {
$this->default_tab = 'general';
} elseif (isset($_POST['auth_submit'])) {
$this->default_tab = 'auth';
} elseif (isset($_POST['email_submit']) || !empty($_POST['test_email'])) {
$this->default_tab = 'email';
} elseif (isset($_POST['sms_submit']) || !empty($_POST['test_sms'])) {
$this->default_tab = 'sms';
} elseif (isset($_POST['discord_submit']) || !empty($_POST['test_discord'])) {
$this->default_tab = 'discord';
} elseif (isset($_POST['pushover_submit']) || !empty($_POST['test_pushover'])) {
$this->default_tab = 'pushover';
} elseif (isset($_POST['webhook_submit']) || !empty($_POST['test_webhook'])) {
$this->default_tab = 'webhook';
} elseif (isset($_POST['telegram_submit']) || !empty($_POST['test_telegram'])) {
$this->default_tab = 'telegram';
} elseif (isset($_POST['jabber_submit']) || !empty($_POST['test_jabber'])) {
@ -346,6 +398,88 @@ class ConfigController extends AbstractController
}
}
/**
* Execute Discord test
*
* @todo move test to separate class
*/
protected function testDiscord()
{
$user = $this->getUser()->getUser();
if (empty($user->discord)) {
$this->addMessage(psm_get_lang('config', 'discord_error_nowebhook'), 'error');
} else {
$success = 0;
$result = 'An unknown error has occurred.';
try {
$curl = curl_init($user->discord);
$json = json_decode(
'{"content":""}',
true
);
$json['content'] = psm_get_lang('config', 'test_message');
$msg = "payload_json=" . urlencode(json_encode($json));
if(isset($curl)) {
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
curl_setopt($curl, CURLOPT_POSTFIELDS, $msg);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($curl);
$httpcode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
$err = curl_errno($curl);
if ($err != 0 || $httpcode != 204) {
$success = 0;
// $result = ($result == '') ? 'Wrong input, please check if all values are correct!' : $result;
$error = "HTTP_code: " . $httpcode . ".\ncURL error (" . $err . "): " .
curl_strerror($err) . ". \nResult: " . $result;
$result = $error;
} else {
$success = 1;
}
curl_close($curl);
}
} catch (Exception $e) {
$success = 0;
$result = $e->getMessage();
}
if ($success === 1) {
$this->addMessage(psm_get_lang('config', 'discord_sent'), 'success');
} else {
$this->addMessage(sprintf(psm_get_lang('config', 'discord_error'), $result), 'error');
}
}
}
/** Execute webhook test
*
* @todo move test to separate class
*/
protected function testWebhook()
{
$user = $this->getUser()->getUser();
if (empty($user->webhook_url)) {
$this->addMessage(psm_get_lang('config', 'webhook_error_nourl'), 'error');
} elseif (empty($user->webhook_json)) {
$this->addMessage(psm_get_lang('config', 'webhook_error_nojson'), 'error');
} else {
$webhook = psm_build_webhook();
$webhook->setUrl($user->webhook_url);
$webhook->setJson($user->webhook_json);
$message = (psm_get_lang('config', 'test_message'));
$result = $webhook->sendWebhook($message);
if ($result==1) {
$this->addMessage(psm_get_lang('config', 'webhook_sent'), 'success');
} else {
$this->addMessage(sprintf(psm_get_lang('config', 'webhook_error'), $result), 'error');
}
}
}
/**
* Execute pushover test
*
@ -444,14 +578,20 @@ class ConfigController extends AbstractController
return array(
'label_tab_email' => psm_get_lang('config', 'tab_email'),
'label_tab_sms' => psm_get_lang('config', 'tab_sms'),
'label_tab_discord' => psm_get_lang('config', 'tab_discord'),
'label_tab_pushover' => psm_get_lang('config', 'tab_pushover'),
'label_tab_webhook' => psm_get_lang('config', 'tab_webhook'),
'label_tab_telegram' => psm_get_lang('config', 'tab_telegram'),
'label_tab_jabber' => psm_get_lang('config', 'tab_jabber'),
'label_tab_auth' => psm_get_lang('config', 'tab_auth'),
'label_settings_email' => psm_get_lang('config', 'settings_email'),
'label_settings_sms' => psm_get_lang('config', 'settings_sms'),
'label_settings_discord' => psm_get_lang('config', 'settings_discord'),
'label_settings_webhook' => psm_get_lang('config', 'settings_webhook'),
'label_settings_pushover' => psm_get_lang('config', 'settings_pushover'),
'label_settings_telegram' => psm_get_lang('config', 'settings_telegram'),
'label_settings_jabber' => psm_get_lang('config', 'settings_jabber'),
'label_settings_dirauth' => psm_get_lang('config', 'settings_dirauth'),
'label_settings_notification' => psm_get_lang('config', 'settings_notification'),
'label_settings_log' => psm_get_lang('config', 'settings_log'),
'label_settings_proxy' => psm_get_lang('config', 'settings_proxy'),
@ -464,6 +604,7 @@ class ConfigController extends AbstractController
'label_proxy_url' => psm_get_lang('config', 'proxy_url'),
'label_proxy_user' => psm_get_lang('config', 'proxy_user'),
'label_proxy_password' => psm_get_lang('config', 'proxy_password'),
'label_email_add_url' => psm_get_lang('config', 'email_add_url'),
'label_email_status' => psm_get_lang('config', 'email_status'),
'label_email_from_email' => psm_get_lang('config', 'email_from_email'),
'label_email_from_name' => psm_get_lang('config', 'email_from_name'),
@ -479,6 +620,14 @@ class ConfigController extends AbstractController
'label_sms_gateway_username' => psm_get_lang('config', 'sms_gateway_username'),
'label_sms_gateway_password' => psm_get_lang('config', 'sms_gateway_password'),
'label_sms_from' => psm_get_lang('config', 'sms_from'),
'label_discord_status' => psm_get_lang('config', 'discord_status'),
'label_discord_description' => psm_get_lang('config', 'discord_description'),
'label_webhook_description' => psm_get_lang('config', 'webhook_description'),
'label_webhook_status' => psm_get_lang('config', 'webhook_status'),
'label_webhook_url' => psm_get_lang('config', 'webhook_url'),
'label_webhook_url_description' => psm_get_lang('config', 'webhook_url_description'),
'label_webhook_json' => psm_get_lang('config', 'webhook_json'),
'label_webhook_json_description' => psm_get_lang('config', 'webhook_json_description'),
'label_pushover_description' => psm_get_lang('config', 'pushover_description'),
'label_pushover_status' => psm_get_lang('config', 'pushover_status'),
'label_pushover_clone_app' => psm_get_lang('config', 'pushover_clone_app'),
@ -490,6 +639,7 @@ class ConfigController extends AbstractController
),
'label_telegram_description' => psm_get_lang('config', 'telegram_description'),
'label_telegram_status' => psm_get_lang('config', 'telegram_status'),
'label_telegram_add_url' => psm_get_lang('config', 'telegram_add_url'),
'label_telegram_api_token' => psm_get_lang('config', 'telegram_api_token'),
'label_telegram_api_token_description' => psm_get_lang('config', 'telegram_api_token_description'),
'label_jabber_status' => psm_get_lang('config', 'jabber_status'),
@ -504,6 +654,36 @@ class ConfigController extends AbstractController
'label_jabber_domain_description' => psm_get_lang('config', 'jabber_domain_description'),
'label_jabber_password' => psm_get_lang('config', 'jabber_password'),
'label_jabber_password_description' => psm_get_lang('config', 'jabber_password_description'),
'label_dirauth_status' => psm_get_lang('config', 'dirauth_status'),
'label_authdir_host_locn' => psm_get_lang('config', 'authdir_host_locn'),
'label_authdir_host_port' => psm_get_lang('config', 'authdir_host_port'),
'label_authdir_type' => psm_get_lang('config', 'authdir_type'),
'label_authdir_type_description' => psm_get_lang('config', 'authdir_type_description'),
'label_authdir_userdomain' => psm_get_lang('config', 'authdir_userdomain'),
'label_authdir_userdomain_description' => psm_get_lang('config', 'authdir_userdomain_description'),
'label_authdir_ldapver' => psm_get_lang('config', 'authdir_ldapver'),
'label_authdir_ldapver_description' => psm_get_lang('config', 'authdir_ldapver_description'),
'label_authdir_ldapfollowref' => psm_get_lang('config', 'authdir_ldapfollowref'),
'label_authdir_ldapfollowref_description' => psm_get_lang('config', 'authdir_ldapfollowref_description'),
'label_authdir_basedn' => psm_get_lang('config', 'authdir_basedn'),
'label_authdir_basedn_description' => psm_get_lang('config', 'authdir_basedn_description'),
'label_authdir_usernameattrib' => psm_get_lang('config', 'authdir_usernameattrib'),
'label_authdir_usernameattrib_description' => psm_get_lang('config', 'authdir_usernameattrib_description'),
'label_authdir_groupnameattrib' => psm_get_lang('config', 'authdir_groupnameattrib'),
'label_authdir_groupnameattrib_description' =>
psm_get_lang('config', 'authdir_groupnameattrib_description'),
'label_authdir_groupmemattrib' => psm_get_lang('config', 'authdir_groupmemattrib'),
'label_authdir_groupmemattrib_description' => psm_get_lang('config', 'authdir_groupmemattrib_description'),
'label_authdir_usercontainerrdn' => psm_get_lang('config', 'authdir_usercontainerrdn'),
'label_authdir_usercontainerrdn_description' =>
psm_get_lang('config', 'authdir_usercontainerrdn_description'),
'label_authdir_groupcontainerrdn' => psm_get_lang('config', 'authdir_groupcontainerrdn'),
'label_authdir_groupcontainerrdn_description' =>
psm_get_lang('config', 'authdir_groupcontainerrdn_description'),
'label_authdir_groupname' => psm_get_lang('config', 'authdir_groupname'),
'label_authdir_groupname_description' => psm_get_lang('config', 'authdir_groupname_description'),
'label_authdir_defaultrole' => psm_get_lang('config', 'authdir_defaultrole'),
'label_authdir_defaultrole_description' => psm_get_lang('config', 'authdir_defaultrole_description'),
'label_alert_type' => psm_get_lang('config', 'alert_type'),
'label_alert_type_description' => psm_get_lang('config', 'alert_type_description'),
'label_combine_notifications' => psm_get_lang('config', 'combine_notifications'),
@ -512,7 +692,9 @@ class ConfigController extends AbstractController
'label_log_status_description' => psm_get_lang('config', 'log_status_description'),
'label_log_email' => psm_get_lang('config', 'log_email'),
'label_log_sms' => psm_get_lang('config', 'log_sms'),
'label_log_discord' => psm_get_lang('config', 'log_discord'),
'label_log_pushover' => psm_get_lang('config', 'log_pushover'),
'label_log_webhook' => psm_get_lang('config', 'log_webhook'),
'label_log_telegram' => psm_get_lang('config', 'log_telegram'),
'label_log_jabber' => psm_get_lang('config', 'log_jabber'),
'label_alert_proxy' => psm_get_lang('config', 'alert_proxy'),

View File

@ -303,7 +303,10 @@ class InstallController extends AbstractController
'level' => PSM_USER_ADMIN,
'pushover_key' => '',
'pushover_device' => '',
'webhook_url' => '',
'webhook_json' => '',
'telegram_id' => '',
'discord' => '',
'jabber' => ''
);

View File

@ -81,6 +81,8 @@ abstract class AbstractServerController extends AbstractController
`s`.`active`,
`s`.`email`,
`s`.`sms`,
`s`.`discord`,
`s`.`webhook`,
`s`.`pushover`,
`s`.`telegram`,
`s`.`jabber`,

View File

@ -55,7 +55,9 @@ class LogController extends AbstractServerController
'label_status' => psm_get_lang('log', 'status'),
'label_email' => psm_get_lang('log', 'email'),
'label_sms' => psm_get_lang('log', 'sms'),
'label_discord' => psm_get_lang('log', 'discord'),
'label_pushover' => psm_get_lang('log', 'pushover'),
'label_webhook' => psm_get_lang('log', 'webhook'),
'label_telegram' => psm_get_lang('log', 'telegram'),
'label_jabber' => psm_get_lang('log', 'jabber'),
'label_title' => psm_get_lang('log', 'title'),
@ -77,7 +79,7 @@ class LogController extends AbstractServerController
$modal->setTitle(psm_get_lang('log', 'delete_title'));
$modal->setMessage(psm_get_lang('log', 'delete_message'));
$modal->setOKButtonLabel(psm_get_lang('system', 'delete'));
$sidebar->addButton(
'clear_logn',
psm_get_lang('log', 'clear'),
@ -89,7 +91,7 @@ class LogController extends AbstractServerController
);
}
$log_types = array('status', 'email', 'sms', 'pushover', 'telegram', 'jabber');
$log_types = array('status', 'email', 'sms', 'pushover', 'telegram', 'jabber', 'discord', 'webhook');
foreach ($log_types as $key) {
$records = $this->getEntries($key);

View File

@ -100,7 +100,9 @@ class ServerController extends AbstractServerController
$icons = array(
'email' => 'icon-envelope',
'sms' => 'icon-mobile',
'discord' => 'icon-discord',
'pushover' => 'icon-pushover',
'webhook' => 'icon-webhook',
'telegram' => 'icon-telegram',
'jabber' => 'icon-jabber'
);
@ -130,6 +132,8 @@ class ServerController extends AbstractServerController
$tpl_data['config']['email'] = psm_get_conf('email_status');
$tpl_data['config']['sms'] = psm_get_conf('sms_status');
$tpl_data['config']['discord'] = psm_get_conf('discord_status');
$tpl_data['config']['webhook'] = psm_get_conf('webhook_status');
$tpl_data['config']['pushover'] = psm_get_conf('pushover_status');
$tpl_data['config']['telegram'] = psm_get_conf('telegram_status');
@ -237,13 +241,15 @@ class ServerController extends AbstractServerController
'edit_active_selected' => $edit_server['active'],
'edit_email_selected' => $edit_server['email'],
'edit_sms_selected' => $edit_server['sms'],
'edit_discord_selected' => $edit_server['discord'],
'edit_webhook_selected' => $edit_server['webhook'],
'edit_pushover_selected' => $edit_server['pushover'],
'edit_telegram_selected' => $edit_server['telegram'],
'edit_jabber_selected' => $edit_server['jabber'],
));
}
$notifications = array('email', 'sms', 'pushover', 'telegram', 'jabber');
$notifications = array('email', 'sms', 'pushover', 'discord', 'webhook', 'telegram', 'jabber');
foreach ($notifications as $notification) {
if (psm_get_conf($notification . '_status') == 0) {
$tpl_data['warning_' . $notification] = true;
@ -271,7 +277,7 @@ class ServerController extends AbstractServerController
// We need the server id to encrypt the password. Encryption will be done after the server is added
$encrypted_password = '';
if (!empty($_POST['website_password'])) {
$new_password = psm_POST('website_password');
@ -311,7 +317,9 @@ class ServerController extends AbstractServerController
'active' => in_array($_POST['active'], array('yes', 'no')) ? $_POST['active'] : 'no',
'email' => in_array($_POST['email'], array('yes', 'no')) ? $_POST['email'] : 'no',
'sms' => in_array($_POST['sms'], array('yes', 'no')) ? $_POST['sms'] : 'no',
'discord' => in_array($_POST['discord'], array('yes', 'no')) ? $_POST['discord'] : 'no',
'pushover' => in_array($_POST['pushover'], array('yes', 'no')) ? $_POST['pushover'] : 'no',
'webhook' => in_array($_POST['webhook'], array('yes', 'no')) ? $_POST['webhook'] : 'no',
'telegram' => in_array($_POST['telegram'], array('yes', 'no')) ? $_POST['telegram'] : 'no',
'jabber' => in_array($_POST['jabber'], array('yes', 'no')) ? $_POST['jabber'] : 'no',
);
@ -589,12 +597,17 @@ class ServerController extends AbstractServerController
'label_send_email' => psm_get_lang('servers', 'send_email'),
'label_sms' => psm_get_lang('servers', 'sms'),
'label_send_sms' => psm_get_lang('servers', 'send_sms'),
'label_discord' => psm_get_lang('servers', 'discord'),
'label_send_discord' => psm_get_lang('servers', 'send_discord'),
'label_pushover' => psm_get_lang('servers', 'pushover'),
'label_send_pushover' => psm_get_lang('servers', 'send_pushover'),
'label_send_webhook' => psm_get_lang('servers', 'send_webhook'),
'label_telegram' => psm_get_lang('servers', 'telegram'),
'label_jabber' => psm_get_lang('servers', 'jabber'),
'label_jabber' => psm_get_lang('servers', 'jabber'),
'label_send_jabber' => psm_get_lang('servers', 'send_jabber'),
'label_webhook' => psm_get_lang('servers', 'webhook'),
'label_pushover' => psm_get_lang('servers', 'pushover'),
'label_send_telegram' => psm_get_lang('servers', 'send_telegram'),
'label_send_jabber' => psm_get_lang('servers', 'send_jabber'),
'label_users' => psm_get_lang('servers', 'users'),
'label_warning_threshold' => psm_get_lang('servers', 'warning_threshold'),
'label_warning_threshold_description' => psm_get_lang('servers', 'warning_threshold_description'),

View File

@ -39,7 +39,7 @@ class ProfileController extends AbstractController
* @var array $profile_fields
*/
protected $profile_fields =
array('name', 'user_name', 'email', 'mobile', 'pushover_key', 'pushover_device', 'telegram_id', 'jabber');
array('name', 'user_name', 'email', 'mobile', 'pushover_key', 'pushover_device', 'discord', 'webhook_url', 'webhook_json', 'telegram_id', 'jabber');
public function __construct(Database $db, \Twig_Environment $twig)
{
@ -78,11 +78,21 @@ class ProfileController extends AbstractController
'label_password_repeat' => psm_get_lang('users', 'password_repeat'),
'label_level' => psm_get_lang('users', 'level'),
'label_mobile' => psm_get_lang('users', 'mobile'),
'label_webhook' => psm_get_lang('users', 'webhook'),
'label_webhook_description' => psm_get_lang('users', 'webhook_description'),
'label_webhook_url' => psm_get_lang('users', 'webhook_url'),
'label_webhook_url_description' => psm_get_lang('users', 'webhook_url_description'),
'label_webhook_json' => psm_get_lang('users', 'webhook_json'),
'label_webhook_json_description' => psm_get_lang('users', 'webhook_json_description'),
'label_pushover' => psm_get_lang('users', 'pushover'),
'label_pushover_description' => psm_get_lang('users', 'pushover_description'),
'label_pushover_key' => psm_get_lang('users', 'pushover_key'),
'label_pushover_device' => psm_get_lang('users', 'pushover_device'),
'label_pushover_device_description' => psm_get_lang('users', 'pushover_device_description'),
'label_discord' => psm_get_lang('users', 'discord'),
'label_discord_description' => psm_get_lang('users', 'discord_description'),
'label_telegram' => psm_get_lang('users', 'telegram'),
'label_telegram_description' => psm_get_lang('users', 'telegram_description'),
'label_telegram_chat_id' => psm_get_lang('users', 'telegram_chat_id'),

View File

@ -158,6 +158,9 @@ class UserController extends AbstractController
'name',
'user_name',
'mobile',
'discord',
'webhook_url',
'webhook_json',
'pushover_key',
'pushover_device',
'telegram_id',
@ -255,6 +258,9 @@ class UserController extends AbstractController
'password_repeat',
'level',
'mobile',
'discord',
'webhook_url',
'webhook_json',
'pushover_key',
'pushover_device',
'telegram_id',
@ -276,12 +282,25 @@ class UserController extends AbstractController
$user_validator->username($clean['user_name'], $user_id);
$user_validator->email($clean['email']);
$user_validator->level($clean['level']);
// Won't allow anonymous level for users other than __PUBLIC__
if ($clean['user_name'] !== "__PUBLIC__" && (int) $clean['level'] === (int) PSM_USER_ANONYMOUS) {
$this->addMessage(psm_get_lang('users', 'error_user_cant_be_anonymous'), 'error');
$clean['level'] = PSM_USER_USER;
}
// always validate password for new users,
// but only validate it for existing users when they change it.
if ($user_id == 0 || ($user_id > 0 && $clean['password'] != '')) {
if (($user_id == 0 || ($user_id > 0 && $clean['password'] != '')) && $clean['user_name'] != '__PUBLIC__') {
$user_validator->password($clean['password'], $clean['password_repeat']);
}
// Auto generate password for __PUBLIC__ user
if ($clean['user_name'] === '__PUBLIC__') {
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%&*_";
$clean['password'] = substr(str_shuffle($chars), 0, 24);
}
if ($user_id > 0) {
$user_validator->userId($user_id);
}
@ -392,6 +411,14 @@ class UserController extends AbstractController
'label_level' => psm_get_lang('users', 'level'),
'label_level_description' => psm_get_lang('users', 'level_description'),
'label_mobile' => psm_get_lang('users', 'mobile'),
'label_discord' => psm_get_lang('users', 'discord'),
'label_discord_description' => psm_get_lang('users', 'discord_description'),
'label_webhook' => psm_get_lang('users', 'webhook'),
'label_webhook_description' => psm_get_lang('users', 'webhook_description'),
'label_webhook_url' => psm_get_lang('users', 'webhook_url'),
'label_webhook_url_description' => psm_get_lang('users', 'webhook_url_description'),
'label_webhook_json' => psm_get_lang('users', 'webhook_json'),
'label_webhook_json_description' => psm_get_lang('users', 'webhook_json_description'),
'label_pushover' => psm_get_lang('users', 'pushover'),
'label_pushover_description' => psm_get_lang('users', 'pushover_description'),
'label_pushover_key' => psm_get_lang('users', 'pushover_key'),

View File

@ -100,6 +100,17 @@ class User
}
$this->session = $session;
if (PSM_PUBLIC === true && PSM_PUBLIC_PAGE === true) {
$query_user = $this->db_connection->prepare('SELECT * FROM ' .
PSM_DB_PREFIX . 'users WHERE user_name = :user_name and level = :level');
$query_user->bindValue(':user_name', "__PUBLIC__", \PDO::PARAM_STR);
$query_user->bindValue(':level', PSM_USER_ANONYMOUS, \PDO::PARAM_STR);
$query_user->execute();
// get result row (as an object)
$this->setUserLoggedIn($query_user->fetchObject()->user_id);
}
if ((!defined('PSM_INSTALL') || !PSM_INSTALL)) {
// check the possible login actions:
// 1. login via session data (happens each time user opens a page on your php project AFTER
@ -219,20 +230,51 @@ class User
{
$user_name = trim($user_name);
$user_password = trim($user_password);
$ldapauthstatus = false;
if (empty($user_name) && empty($user_password)) {
return false;
}
$dirauthconfig = psm_get_conf('dirauth_status');
// LDAP auth enabled
if ($dirauthconfig === '1') {
$ldaplibpath = realpath(
PSM_PATH_SRC . '..' . DIRECTORY_SEPARATOR .
'vendor' . DIRECTORY_SEPARATOR .
'viharm' . DIRECTORY_SEPARATOR .
'psm-ldap-auth' . DIRECTORY_SEPARATOR .
'psmldapauth.php'
);
// If the library is found
if ($ldaplibpath) {
// Delegate the authentication to the PsmLDAPauth module.
// If LDAP auth fails or if library not found, fall back to native auth
include_once($ldaplibpath);
$ldapauthstatus = psmldapauth($user_name, $user_password, $GLOBALS['sm_config'], $this->db_connection);
}
}
$user = $this->getUserByUsername($user_name);
// using PHP 5.5's password_verify() function to check if the provided passwords
// fits to the hash of that user's password
if (!isset($user->user_id)) {
password_verify($user_password, 'dummy_call_against_timing');
return false;
} elseif (!password_verify($user_password, $user->password)) {
return false;
}
// Authenticated
if ($ldapauthstatus === true) {
// Remove password to prevent it from being saved in the DB.
// Otherwise, user may still be authenticated if LDAP is disabled later.
$user_password = null;
@fn_Debug('Authenticated', $user);
} else {
// using PHP 5.5's password_verify() function to check if the provided passwords
// fits to the hash of that user's password
if (!isset($user->user_id)) {
password_verify($user_password, 'dummy_call_against_timing');
return false;
} elseif (!password_verify($user_password, $user->password)) {
return false;
}
} // not authenticated
$this->setUserLoggedIn($user->user_id, true);

View File

@ -0,0 +1,91 @@
<?php
/**
* PHP Server Monitor
* Monitor your servers and websites.
*
* This file is part of PHP Server Monitor.
* PHP Server Monitor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PHP Server Monitor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PHP Server Monitor. If not, see <http://www.gnu.org/licenses/>.
*
* @package phpservermon
* @author Victor Macko
* @copyright Copyright (c) 2008-2017 Pepijn Over <pep@mailbox.org>
* @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3
* @version Release: @package_version@
* @link http://www.phpservermonitor.org/
* @since phpservermon 3.6.0
**/
namespace psm\Txtmsg;
class Infobip extends Core
{
/**
* Send sms using the infobip.com API
*
* @var string $message
* @var string $this->password
* @var array $this->recipients
* @var array $this->originator
* @var string $recipients
*
* @var resource $curl
* @var string $err
* @var mixed $result
*
* @var int $success
* @var string $error
*
* @return bool|string
*/
public function sendSMS($message)
{
$success = 1;
$error = '';
foreach ($this->recipients as $recipient) {
$ch = curl_init();
curl_setopt(
$ch,
CURLOPT_URL,
"https://api.infobip.com/sms/1/text/query?username=" . $this->username .
"&password=" . $this->password .
"&to=" . $recipient .
"&text=" . urlencode($message) .
//add your sender id here
"&from="
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$headers = array();
$headers[] = "Content-Type: application/x-www-form-urlencoded";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
curl_close($ch);
// Check for errors
if (is_numeric(strpos($result, "FAILED"))) {
$error = $result;
$success = 0;
}
}
if ($success == 1) {
return 1;
}
return $error;
}
}

View File

@ -59,7 +59,7 @@ class Octopush extends Core
{
$error = "";
$success = 1;
$smsType = "XXX"; //FR = premium, WWW = world, XXX = Low cost
$smsType = "FR"; //FR = premium, WWW = world, XXX = Low cost
$recipients = join(',', $this->recipients);

View File

@ -74,7 +74,7 @@ class Plivo extends Core
array(
"src" => $this->originator,
"dst" => $recipients,
"text" => urlencode($message)
"text" => $message
)
),
CURLOPT_HTTPHEADER => array(

View File

@ -0,0 +1,93 @@
<?php
/**
* PHP Server Monitor
* Monitor your servers and websites.
*
* This file is part of PHP Server Monitor.
* PHP Server Monitor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PHP Server Monitor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PHP Server Monitor. If not, see <http://www.gnu.org/licenses/>.
*
* @package phpservermon
* @author Łukasz Szczepański <l.szczepanski@webd.pl>
* @copyright Copyright (c) 2008-2017 Pepijn Over <pep@mailbox.org>
* @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3
* @version Release: @package_version@
* @link http://www.phpservermonitor.org/
* @since phpservermon 3.5
**/
namespace psm\Txtmsg;
class PromoSMS extends Core
{
/**
* Send sms using the PromoSMS API
*
* @var string $message
* @var string $this->password
* @var array $this->recipients
* @var array $headers
*
* @var resource $curl
* @var string $err
* @var int $success
* @var string $error
*
* @return bool|string
*/
public function sendSMS($message)
{
$error = "";
$success = 1;
$headers = array();
$headers[] = "Content-Type: application/x-www-form-urlencoded";
$headers[] = "Accept: text/json";
$headers[] = 'Authorization: Basic ' . base64_encode($this->username . ':' . $this->password);
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://promosms.com/api/rest/v3_2/sms",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => $headers,
CURLOPT_POSTFIELDS => http_build_query(array(
'text' => htmlspecialchars($message),
'type' => 1,
'recipients' => $this->recipients,
))
));
$result = curl_exec($curl);
$httpcode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
$err = curl_errno($curl);
if ($err != 0 || ($httpcode != '200' && $httpcode != '201' && $httpcode != '202' && $result != "1")) {
$success = 0;
$error = "HTTP_code: " . $httpcode . ".\ncURL error (" . $err . "): " .
curl_strerror($err) . ". Result: " . $result . "";
}
curl_close($curl);
if ($success) {
return 1;
}
return $error;
}
}

92
src/psm/Txtmsg/Ysmal.php Normal file
View File

@ -0,0 +1,92 @@
<?php
/**
* PHP Server Monitor
* Monitor your servers and websites.
*
* This file is part of PHP Server Monitor.
* PHP Server Monitor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PHP Server Monitor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PHP Server Monitor. If not, see <http://www.gnu.org/licenses/>.
*
* @package phpservermon
* @author Perri Vardy-Mason
* @author Dylan Ysmal <dylan@ysmal.fr>
* @copyright Copyright (c) 2008-2017 Pepijn Over <pep@mailbox.org>
* @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3
* @version Release: @package_version@
* @link http://www.phpservermonitor.org/
* @since phpservermon 3.5
**/
namespace psm\Txtmsg;
class Ysmal extends Core
{
/**
* Send sms using the Hermes SMS API on Ysmal.fr
* @var string $message
* @var array $this->recipients
* @var string $this->password
*
* @var mixed $result
* @var array $headers
*
* @var int $success
* @var string $error
*
* @return bool|string
*/
public function sendSMS($message)
{
$success = 1;
$error = '';
foreach ($this->recipients as $recipient) {
$opts['http'] = [
'method' => 'POST',
'header' => "Content-Type: application/x-www-form-urlencoded\r\n" .
'User-Agent: PHPServerMonitor (+https://phpservermonitor.org)',
'content' => http_build_query([
'key' => $this->password,
'number' => $recipient,
'message' => $message
]),
'ignore_errors' => true
];
$api = 'https://sms-api.ysmal.fr/';
$ctx = stream_context_create($opts);
$res = file_get_contents($api, false, $ctx);
$json = json_decode($res, true);
if ($json === NULL) {
$success = 0;
$error = "($recipient) json_decode_error";
break;
}
if ($json['status'] !== 'success') {
$success = 0;
$error = "($recipient) $json[error]";
break;
}
}
if ($success) {
return 1;
}
return $error;
}
}

View File

@ -134,11 +134,11 @@ class Installer
$queries = array();
$queries[] = "INSERT INTO `" . PSM_DB_PREFIX . "servers` (
`ip`, `port`, `label`, `type`, `pattern`, `pattern_online`, `redirect_check`,
`status`, `rtime`, `active`, `email`, `sms`, `pushover`, `telegram`, `jabber`)
`status`, `rtime`, `active`, `email`, `sms`, `pushover`,`webhook`, `telegram`, `jabber`)
VALUES ('http://sourceforge.net/index.php', 80, 'SourceForge', 'website', '',
'yes', 'bad', 'on', '0.0000000', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes'),
'yes', 'bad', 'on', '0.0000000', 'yes', 'yes', 'yes', 'yes','yes', 'yes', 'yes'),
('smtp.gmail.com', 465, 'Gmail SMTP', 'service', '',
'yes', 'bad','on', '0.0000000', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes')";
'yes', 'bad','on', '0.0000000', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes')";
$queries[] = "INSERT INTO `" . PSM_DB_PREFIX . "users_servers` (`user_id`,`server_id`) VALUES (1, 1), (1, 2);";
$queries[] = "INSERT INTO `" . PSM_DB_PREFIX . "config` (`key`, `value`) VALUE
('language', 'en_US'),
@ -147,6 +147,7 @@ class Installer
('proxy_user', ''),
('proxy_password', ''),
('email_status', '1'),
('email_add_url', '0'),
('email_from_email', 'monitor@example.org'),
('email_from_name', 'Server Monitor'),
('email_smtp', ''),
@ -160,9 +161,11 @@ class Installer
('sms_gateway_username', 'username'),
('sms_gateway_password', 'password'),
('sms_from', '1234567890'),
('webhook_status', '0'),
('pushover_status', '0'),
('pushover_api_token', ''),
('telegram_status', '0'),
('telegram_add_url', '0'),
('telegram_api_token', ''),
('jabber_status', '1'),
('jabber_host', ''),
@ -176,8 +179,11 @@ class Installer
('log_email', '1'),
('log_sms', '1'),
('log_pushover', '1'),
('log_webhook', '1'),
('log_telegram', '1'),
('log_jabber', '1'),
('discord_status', '0'),
('log_jdiscord', '1'),
('log_retention_period', '365'),
('version', '" . PSM_VERSION . "'),
('version_update_check', '" . PSM_VERSION . "'),
@ -185,7 +191,7 @@ class Installer
('show_update', '1'),
('last_update_check', '0'),
('cron_running', '0'),
('cron_running_time', '0'),
('cron_running_time', '0'),
('cron_off_running', '0'),
('cron_off_running_time', '0');";
$this->execSQL($queries);
@ -212,9 +218,12 @@ class Installer
`level` tinyint(2) unsigned NOT NULL DEFAULT '20',
`name` varchar(255) NOT NULL,
`mobile` varchar(15) NOT NULL,
`discord` varchar(255) NOT NULL,
`pushover_key` varchar(255) NOT NULL,
`pushover_device` varchar(255) NOT NULL,
`telegram_id` varchar(255) NOT NULL,
`webhook_url` varchar(255) NOT NULL,
`webhook_json` varchar(255) NOT NULL DEFAULT '{\"text\":\"servermon: #message\"}',
`telegram_id` varchar(255) NOT NULL ,
`jabber` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
PRIMARY KEY (`user_id`),
@ -235,7 +244,7 @@ class Installer
PSM_DB_PREFIX . 'log' => "CREATE TABLE `" . PSM_DB_PREFIX . "log` (
`log_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`server_id` int(11) unsigned NOT NULL,
`type` enum('status','email','sms','pushover','telegram', 'jabber') NOT NULL,
`type` enum('status','email','sms','discord','pushover','webhook','telegram', 'jabber') NOT NULL,
`message` TEXT NOT NULL,
`datetime` timestamp NOT NULL default CURRENT_TIMESTAMP,
PRIMARY KEY (`log_id`)
@ -269,7 +278,9 @@ class Installer
`active` enum('yes','no') NOT NULL default 'yes',
`email` enum('yes','no') NOT NULL default 'yes',
`sms` enum('yes','no') NOT NULL default 'no',
`discord` enum('yes','no') NOT NULL default 'yes',
`pushover` enum('yes','no') NOT NULL default 'yes',
`webhook` enum('yes','no') NOT NULL default 'yes',
`telegram` enum('yes','no') NOT NULL default 'yes',
`jabber` enum('yes','no') NOT NULL default 'yes',
`warning_threshold` mediumint(1) unsigned NOT NULL DEFAULT '1',
@ -357,6 +368,9 @@ class Installer
if (version_compare($version_from, '3.5.0', '<')) {
$this->upgrade350();
}
if (version_compare($version_from, '3.6.0', '<')) {
$this->upgrade360();
}
psm_update_conf('version', $version_to);
}
@ -553,7 +567,7 @@ class Installer
$this->execSQL($queries);
// Create log_users table
// Create log_users table
$this->execSQL("CREATE TABLE `" . PSM_DB_PREFIX . "log_users` (
`log_id` int(11) UNSIGNED NOT NULL ,
`user_id` int(11) UNSIGNED NOT NULL ,
@ -659,7 +673,7 @@ class Installer
$this->execSQL($queries);
$this->log('Combined notifications enabled. Check out the config page for more info.');
}
/**
* Patch for v3.4.2 release
* Version_compare was forgotten in v3.4.1 and query failed.
@ -697,9 +711,9 @@ class Installer
$this->log('SMTP password is now encrypted.');
}
$queries[] = 'ALTER TABLE `' . PSM_DB_PREFIX . 'users` ADD `jabber` VARCHAR( 255 )
$queries[] = 'ALTER TABLE `' . PSM_DB_PREFIX . 'users` ADD `jabber` VARCHAR( 255 )
NOT NULL AFTER `telegram_id`;';
$queries[] = "ALTER TABLE `" . PSM_DB_PREFIX . "servers` ADD `jabber` ENUM( 'yes','no' )
$queries[] = "ALTER TABLE `" . PSM_DB_PREFIX . "servers` ADD `jabber` ENUM( 'yes','no' )
NOT NULL DEFAULT 'yes' AFTER `telegram`;";
$queries[] = "ALTER TABLE `" . PSM_DB_PREFIX .
"log` CHANGE `type` `type` ENUM( 'status', 'email', 'sms', 'pushover', 'telegram', 'jabber' )
@ -712,7 +726,40 @@ class Installer
('jabber_username', ''),
('jabber_domain', ''),
('jabber_password', '');";
$this->execSQL($queries);
}
/**
* Patch for v3.6.0 release
* Added support for Discord and webhooks
*/
protected function upgrade360()
{
$queries = array();
$queries[] = "ALTER TABLE `" . PSM_DB_PREFIX . "users`
ADD `webhook_url` VARCHAR( 255 ) NOT NULL AFTER `telegram_id`;";
$queries[] = "ALTER TABLE `" . PSM_DB_PREFIX . "users`
ADD `webhook_json` VARCHAR( 255 ) NOT NULL AFTER `telegram_id`;";
$queries[] = "ALTER TABLE `" . PSM_DB_PREFIX . "log`
CHANGE `type` `type` ENUM('status','email','sms','discord','webhook','pushover','telegram','jabber')
CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;";
$queries[] = "ALTER TABLE `" . PSM_DB_PREFIX . "servers`
ADD `webhook` ENUM( 'yes','no' ) NOT NULL DEFAULT 'yes' AFTER `telegram`;";
$queries[] = "INSERT INTO `" . PSM_DB_PREFIX . "config` (`key`, `value`) VALUE
('discord_status', '0'),
('log_discord', '1'),
('webhook_status', '0'),
('log_webhook', '1')";
$queries[] = "ALTER TABLE `" . PSM_DB_PREFIX . "users`
ADD `discord` VARCHAR( 255 ) NOT NULL AFTER `mobile`;";
$queries[] = "ALTER TABLE `" . PSM_DB_PREFIX . "servers`
ADD `discord` ENUM( 'yes','no' ) NOT NULL DEFAULT 'yes' AFTER `sms`;";
$queries[] = "INSERT INTO `" . PSM_DB_PREFIX . "users` (
`user_name`, `level`, `name`, `email`)
VALUES ('__PUBLIC__', 30, 'Public page', 'publicpage@psm.psm')";
$this->execSQL($queries);
$this->log('Public page is now available. Added user \'__PUBLIC__\'. See documentation for more info.');
}
}

View File

@ -29,7 +29,10 @@
namespace psm\Util\Server;
use DateTime;
use psm\Service\Database;
use Twig\Error\Error;
use Twig_Environment;
/**
* History util, create HTML for server graphs
@ -39,17 +42,17 @@ class HistoryGraph
/**
* Database service
* @var \psm\Service\Database $db;
* @var Database $db;
*/
protected $db;
/**
* Twig environment
* @var \Twig_Environment $twig
* @var Twig_Environment $twig
*/
protected $twig;
public function __construct(Database $db, \Twig_Environment $twig)
public function __construct(Database $db, Twig_Environment $twig)
{
$this->db = $db;
$this->twig = $twig;
@ -57,7 +60,9 @@ class HistoryGraph
/**
* Prepare the HTML for the graph
* @return string
* @param string $server_id ID of server to fetch data for
* @return string Created HTML
* @throws Error On twig error
*/
public function createHTML($server_id)
{
@ -65,9 +70,9 @@ class HistoryGraph
$archive = new ArchiveManager($this->db);
$archive->archive($server_id);
$now = new \DateTime();
$last_week = new \DateTime('-1 week 0:0:0');
$last_year = new \DateTime('-1 year -1 week 0:0:0');
$now = new DateTime();
$last_week = new DateTime('-1 week 0:0:0');
$last_year = new DateTime('-1 year -1 week 0:0:0');
$graphs = array(
0 => $this->generateGraphUptime($server_id, $last_week, $now),
@ -101,8 +106,8 @@ class HistoryGraph
/**
* Generate data for uptime graph
* @param int $server_id
* @param \DateTime $start_time Lowest DateTime of the graph
* @param \DateTime $end_time Highest DateTime of the graph
* @param DateTime $start_time Lowest DateTime of the graph
* @param DateTime $end_time Highest DateTime of the graph
* @return array
*/
public function generateGraphUptime($server_id, $start_time, $end_time)
@ -112,9 +117,9 @@ class HistoryGraph
'latency' => array(),
);
$hour = new \DateTime('-1 hour');
$day = new \DateTime('-1 day');
$week = new \DateTime('-1 week');
$hour = new DateTime('-1 hour');
$day = new DateTime('-1 day');
$week = new DateTime('-1 week');
$records = $this->getRecords('uptime', $server_id, $start_time, $end_time);
@ -148,8 +153,8 @@ class HistoryGraph
/**
* Generate data for history graph
* @param int $server_id
* @param \DateTime $start_time Lowest DateTime of the graph
* @param \DateTime $end_time Highest DateTime of the graph
* @param DateTime $start_time Lowest DateTime of the graph
* @param DateTime $end_time Highest DateTime of the graph
* @return array
*/
public function generateGraphHistory($server_id, $start_time, $end_time)
@ -160,9 +165,9 @@ class HistoryGraph
'latency_max' => array(),
);
$week = new \DateTime('-2 week 0:0:0');
$month = new \DateTime('-1 month -1 week 0:0:0');
$year = new \DateTime('-1 year -1 week 0:0:0');
$week = new DateTime('-2 week 0:0:0');
$month = new DateTime('-1 month -1 week 0:0:0');
$year = new DateTime('-1 year -1 week 0:0:0');
$records = $this->getRecords('history', $server_id, $year, $end_time);
@ -197,8 +202,8 @@ class HistoryGraph
* Get all uptime/history records for a server
* @param string $type
* @param int $server_id
* @param \DateTime $start_time Lowest DateTime of the graph
* @param \DateTime $end_time Highest DateTime of the graph
* @param DateTime $start_time Lowest DateTime of the graph
* @param DateTime $end_time Highest DateTime of the graph
* @return array
*/
protected function getRecords($type, $server_id, $start_time, $end_time)
@ -207,17 +212,19 @@ class HistoryGraph
return array();
}
$records = $this->db->execute(
"SELECT *
/** @noinspection SqlNoDataSourceInspection */
/** @noinspection SqlResolve */
/** @noinspection PhpUndefinedConstantInspection */
return $this->db->execute(
"SELECT *, UNIX_TIMESTAMP(CONVERT_TZ(`date`, '+00:00', @@session.time_zone)) AS date_ts
FROM `" . PSM_DB_PREFIX . "servers_$type`
WHERE `server_id` = :server_id AND `date` BETWEEN :start_time AND :end_time ORDER BY `date` ASC",
WHERE `server_id` = :server_id AND `date` BETWEEN :start_time AND :end_time ORDER BY `date`",
array(
'server_id' => $server_id,
'start_time' => $start_time->format('Y-m-d H:i:s'),
'end_time' => $end_time->format('Y-m-d H:i:s'),
)
);
return $records;
}
/**
@ -225,12 +232,9 @@ class HistoryGraph
* @param array $records All uptime records to parse, MUST BE SORTED BY DATE IN ASCENDING ORDER
* @param array $lines Array with keys as line ids to prepare (key must be available in uptime records)
* @param string $latency_avg_key which key from uptime records to use for calculating averages
* @param \DateTime $start_time Lowest DateTime of the graph
* @param \DateTime $end_time Highest DateTime of the graph
* @param DateTime $start_time Lowest DateTime of the graph
* @param DateTime $end_time Highest DateTime of the graph
* @param boolean $add_uptime Add uptime calculation?
* @param array $prev Previous result
* @param int $downtime Total downtime
* @param int $prev_downtime Timestamp from last offline record. 0 when last record is uptime
* @return array
*/
protected function generateGraphLines(
@ -241,79 +245,90 @@ class HistoryGraph
$end_time,
$add_uptime = false
) {
$now = new \DateTime();
$now = new DateTime();
$data = array();
// PLEASE NOTE: all times are in microseconds! because of javascript.
$latency_avg = 0;
/** @var array $prev Previous record */
$prev = reset($records);
// Timestamp from last offline record. 0 when last record is up.
$prev_downtime = 0;
// Total downtime
$downtime = 0;
// The keys of the lines iterated
$line_keys = array_keys($lines);
// Determine whether to process data for the short history graph
$is_short_graph = count($line_keys) === 1 && $line_keys[0] === 'latency';
// get highest latency record for offline height
$n = count($records);
$highest_latency = 0.0000;
for ($i = 0; $i < $n; $i++) {
if (!array_key_exists('latency', $records[$i])) {
continue;
$highest_latency = 0.0;
if ($is_short_graph) {
foreach ($records as $record) {
$latency = (float) $record['latency'];
if ($latency > $highest_latency) {
$highest_latency = $latency;
}
}
// Update if latency is higher
$highest_latency = $highest_latency < floatval($records[$i]['latency']) ?
floatval($records[$i]['latency']) : $highest_latency;
// to ms
$highest_latency = round($highest_latency * 1000);
}
// to ms
$highest_latency = round($highest_latency * 1000);
// Create the list of points and server down zones
foreach ($records as $record) {
$time = strtotime($record['date']);
// use the first line to calculate average latency
$latency_avg += (float) $record[$latency_avg_key];
foreach ($lines as $key => $value) {
// add the value for each of the different lines
if (isset($record[$key])) {
if (isset($record['status'])) {
// down
if ($record['status'] == 0) {
$lines['online'][] = $prev['status']
// Previous datapoint was online
? '{ x: ' . ($time * 1000) . ', y: ' . $prev['latency'] * 1000 . '}'
// Previous datapoint was offline
: '{ x: ' . ($time * 1000) . ', y: null}';
// new outage start
$lines['offline'][] = '{ x: ' . ($time * 1000) . ', y:' . $highest_latency . '}';
if ($is_short_graph) {
$time = (int) $record['date_ts'];
// Timestamp in milliseconds
$time_ms = $time * 1000;
if (!$record['status']) {
// down
$lines['online'][] = $prev['status']
// Previous datapoint was online
? ['x' => $time_ms, 'y' => round($prev['latency'] * 1000, 3)]
// Previous datapoint was offline
: ['x' => $time_ms, 'y' => null];
// new outage start
$lines['offline'][] = ['x' => $time_ms, 'y' => $highest_latency];
$prev_downtime != 0 ?: $prev_downtime = $time;
} else {
// up
// outage ends
$lines['offline'][] = $prev['status']
// Previous datapoint was online
? '{ x: ' . ($time * 1000) . ', y:null}'
// Previous datapoint was offline
: '{ x: ' . ($time * 1000) . ', y:' . $highest_latency . '}';
$lines['online'][] = '{ x: ' . ($time * 1000) . ', y: ' .
round((float) $record[$key] * 1000, 2) . '}';
$prev_downtime == 0 ?: $downtime += ($time - $prev_downtime);
$prev_downtime = 0;
}
} else {
$lines[$key][] = '{ x: \'' . $record['date'] . '\', y: ' . $record[$key] * 1000 . '}';
if ($prev_downtime === 0) {
$prev_downtime = $time;
}
$prev = $record;
} else {
// up
// outage ends
$lines['offline'][] = $prev['status']
// Previous datapoint was online
? ['x' => $time_ms, 'y' => null]
// Previous datapoint was offline
: ['x' => $time_ms, 'y' => $highest_latency];
$lines['online'][] = ['x' => $time_ms, 'y' => round($record['latency'] * 1000, 3)];
if ($prev_downtime !== 0) {
$downtime += ($time - $prev_downtime);
}
$prev_downtime = 0;
}
} else {
foreach ($line_keys as $key) {
// add the value for each of the different lines
$lines[$key][] = ['x' => $record['date'], 'y' => $record[$key] * 1000];
}
}
$prev = $record;
}
// Was down before.
// Record the first and last date as a string in the down array
$prev_downtime == 0 ?: $downtime += ($now->getTimestamp() - $prev_downtime);
if ($add_uptime) {
$prev['status'] ?: $lines['offline'][] =
'{ x: ' . ($now->getTimestamp() * 1000) . ', y:' . $highest_latency . '}';
if (!$prev['status']) {
$lines['offline'][] = ['x' => $now->getTimestamp() * 1000, 'y' => $highest_latency];
}
$data['uptime'] = 100 - ($downtime / ($end_time->getTimestamp() - $start_time->getTimestamp()));
}
@ -322,11 +337,12 @@ class HistoryGraph
if (empty($line_value)) {
continue;
}
$lines_merged[$line_key]['value'] = implode(', ', $line_value);
$lines_merged[$line_key]['value'] = json_encode($line_value);
$lines_merged[$line_key]['name'] = psm_get_lang('servers', $line_key);
}
$data['latency_avg'] = count($records) > 0 ? ($latency_avg / count($records)) : 0;
$n_records = count($records);
$data['latency_avg'] = $n_records > 0 ? ($latency_avg / $n_records) : 0;
$data['lines'] = sizeof($lines_merged) ? $lines_merged : '';
$data['end_timestamp'] = number_format($end_time->getTimestamp(), 0, '', '') * 1000;
$data['start_timestamp'] = number_format($start_time->getTimestamp(), 0, '', '') * 1000;

View File

@ -69,7 +69,7 @@ class UpdateManager implements ContainerAwareInterface
}
$sql = "SELECT `s`.`server_id`,`s`.`ip`,`s`.`port`,`s`.`label`,`s`.`type`,`s`.`pattern`,`s`.`header_name`,
`s`.`header_value`,`s`.`status`,`s`.`active`,`s`.`email`,`s`.`sms`,`s`.`pushover`,`s`.`telegram`,
`s`.`header_value`,`s`.`status`,`s`.`active`,`s`.`email`,`s`.`sms`,`s`.`pushover`,`s`.`webhook`,`s`.`telegram`,
`s`.`jabber`
FROM `" . PSM_DB_PREFIX . "servers` AS `s`
{$sql_join}

View File

@ -57,12 +57,24 @@ class StatusNotifier
*/
protected $send_sms = false;
/**
* Send Discord notification?
* @var boolean $send_discord
*/
protected $send_discord = false;
/**
* Send Pushover notification?
* @var boolean $send_pushover
*/
protected $send_pushover = false;
/**
* Send webhook notification?
* @var boolean $send_webhook
*/
protected $send_webhook = false;
/**
* Send telegram?
* @var boolean $send_telegram
@ -128,6 +140,8 @@ class StatusNotifier
$this->send_emails = (bool)psm_get_conf('email_status');
$this->send_sms = (bool)psm_get_conf('sms_status');
$this->send_discord = (bool)psm_get_conf('discord_status');
$this->send_webhook = (bool)psm_get_conf('webhook_status');
$this->send_pushover = (bool)psm_get_conf('pushover_status');
$this->send_telegram = (bool)psm_get_conf('telegram_status');
$this->send_jabber = (bool)psm_get_conf('jabber_status');
@ -149,6 +163,8 @@ class StatusNotifier
if (
!$this->send_emails &&
!$this->send_sms &&
!$this->send_discord &&
!$this->send_webhook &&
!$this->send_pushover &&
!$this->send_telegram &&
!$this->send_jabber &&
@ -175,6 +191,8 @@ class StatusNotifier
'error',
'email',
'sms',
'discord',
'webhook',
'pushover',
'telegram',
'jabber',
@ -246,6 +264,18 @@ class StatusNotifier
$this->notifyByTxtMsg($users);
}
// check if discord is enabled for this server
if ($this->send_discord && $this->server['discord'] == 'yes') {
// yay lets wake those nerds up!
$this->combine ? $this->setCombi('discord') : $this->notifyByDiscord($users);
}
// check if webhook is enabled for this server
if ($this->send_webhook && $this->server['webhook'] == 'yes') {
// yay lets wake those nerds up!
$this->combine ? $this->setCombi('webhook') : $this->notifyByWebhook($users);
}
// check if pushover is enabled for this server
if ($this->send_pushover && $this->server['pushover'] == 'yes') {
// yay lets wake those nerds up!
@ -257,7 +287,7 @@ class StatusNotifier
$this->combine ? $this->setCombi('telegram') : $this->notifyByTelegram($users);
}
if ($this->send_jabber && $this->server['jaber'] == 'yes') {
if ($this->send_jabber && $this->server['jabber'] == 'yes') {
$this->combine ? $this->setCombi('jabber') : $this->notifyByJabber($users);
}
@ -286,7 +316,7 @@ class StatusNotifier
}
return;
}
$this->combiNotification['notifications'][$method][$status][$this->server_id] =
psm_parse_msg($this->status_new, $method . '_message', $this->server, true);
}
@ -396,7 +426,8 @@ class StatusNotifier
$body = key_exists('message', $combi) ?
$combi['message'] :
psm_parse_msg($this->status_new, 'email_body', $this->server);
psm_parse_msg($this->status_new, 'email_body', $this->server);
if ((bool)psm_get_conf('email_add_url')) $body .= PHP_EOL.PHP_EOL.'<a href="'.PSM_BASE_URL.'">'.PSM_BASE_URL.'</a>';
$mail->Body = $body;
$mail->AltBody = str_replace('<br/>', "\n", $body);
@ -417,6 +448,86 @@ class StatusNotifier
}
}
/**
* This functions performs the discord notifications
*
* @param \PDOStatement $users
* @param array $combi contains message and subject (optional)
* @return void
*/
protected function notifyByDiscord($users, $combi = array())
{
$message_log = key_exists('message', $combi) ?
$combi['message'] :
psm_parse_msg($this->status_new, 'discord_message', $this->server);
// Remove users that have no Discord webhook
foreach ($users as $k => $user) {
if (trim($user['discord']) == '') {
unset($users[$k]);
}
}
// Validation
if (empty($users)) {
return;
}
// fix message for Discord viewing
$message = str_replace(array('<b>', '</b>'), array('**', '**'), $message_log);
$message = str_replace(array('<ul>', '</ul>'), array('', ''), $message);
$message = str_replace(array('<br>', '</li>'), array("\n", "\n"), $message);
$message = str_replace('<li>', " * ", $message);
$json = json_decode(
'{"content":""}',
true
);
$json['content'] = $message;
// Log
if (psm_get_conf('log_discord')) {
$log_id = psm_add_log($this->server_id, 'discord', $message_log);
}
foreach ($users as $user) {
// Log
if (!empty($log_id)) {
psm_add_log_user($log_id, $user['user_id']);
}
// set discord webhook and send
try {
$msg = "payload_json=" . urlencode(json_encode($json));
$curl = curl_init(trim($user['discord']));
if(isset($curl)) {
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
curl_setopt($curl, CURLOPT_POSTFIELDS, $msg);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($curl);
$httpcode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
$err = curl_errno($curl);
if ($err != 0 || $httpcode != 204) {
// $result = ($result == '') ? 'Wrong input, please check if all values are correct!' : $result;
$error = "HTTP_code: " . $httpcode . ".\ncURL error (" . $err . "): " .
curl_strerror($err) . ". \nResult: " . $result;
$log_id = psm_add_log($this->server_id, 'discord', $error);
}
curl_close($curl);
}
} catch (Exception $e) {
$log_id = psm_add_log($this->server_id, 'discord', $e->getMessage());
}
}
}
/**
* This functions performs the pushover notifications
*
@ -482,7 +593,55 @@ class StatusNotifier
$pushover->send();
}
}
/**
* This functions performs the webhook notifications
*
* @param \PDOStatement $users
* @param array $combi contains message and subject (optional)
* @return void
*/
protected function notifyByWebhook($users, $combi = array())
{
foreach ($users as $k => $user) {
if (trim($user['webhook_url']) == '') {
unset($users[$k]);
}
}
$webhook = psm_build_webhook();
$message = key_exists('message', $combi) ?
$combi['message'] :
psm_parse_msg($this->status_new, 'webhook_message', $this->server);
$message = str_replace('<br/>', "\n", $message);
$message = str_replace('<br>', "\n", $message);
$title = key_exists('subject', $combi) ?
$combi['subject'] :
psm_parse_msg($this->status_new, 'webhook_title', $this->server);
// Log
if (psm_get_conf('log_webhook')) {
$log_id = psm_add_log($this->server_id, 'webhook', $message);
}
// send notifications to all users
foreach ($users as $user) {
// Log
if (!empty($log_id)) {
psm_add_log_user($log_id, $user['user_id']);
}
$webhook->setUrl($user['webhook_url']);
$webhook->setJson($user['webhook_json']);
$webhook->sendWebhook([
'#message' => $message,
'#server_ip' => $this->server['ip'],
'#server_label' => $this->server['label'],
'#server_error' => $this->server['error'],
'#server_last_offline_duration' => $this->status_new ? $this->server['last_offline_duration'] : '',
'#status' => $this->status_new ? 'online' : 'offline'
]);
}
}
/**
* This functions performs the text message notifications
*
@ -544,14 +703,15 @@ class StatusNotifier
$message = key_exists('message', $combi) ?
$combi['message'] :
psm_parse_msg($this->status_new, 'telegram_message', $this->server);
if ((bool)psm_get_conf('telegram_add_url')) $message .= '<br>'.PSM_BASE_URL;
$telegram = psm_build_telegram();
$telegram->setMessage($message);
// Log
if (psm_get_conf('log_telegram')) {
$log_id = psm_add_log($this->server_id, 'telegram', $message);
}
foreach ($users as $user) {
// Log
if (!empty($log_id)) {
@ -619,7 +779,7 @@ class StatusNotifier
{
// find all the users with this server listed
$users = $this->db->query('
SELECT `u`.`user_id`, `u`.`name`,`u`.`email`, `u`.`mobile`, `u`.`pushover_key`,
SELECT `u`.`user_id`, `u`.`name`,`u`.`email`, `u`.`mobile`, `u`.`pushover_key`, `u`.`discord`, `u`.`webhook_url`,`u`.`webhook_json`,
`u`.`pushover_device`, `u`.`telegram_id`,
`u`.`jabber`
FROM `' . PSM_DB_PREFIX . 'users` AS `u`

View File

@ -89,7 +89,7 @@ class StatusUpdater
$this->error = '';
$this->header = '';
$this->curl_info = '';
$this->rtime = '';
$this->rtime = 0;
// get server info from db
$this->server = $this->db->selectRow(PSM_DB_PREFIX . 'servers', array(
@ -331,19 +331,19 @@ class StatusUpdater
list ($key, $value) = explode(': ', $line);
// Header found (case-insensitive)
if (strcasecmp($key, $this->server['header_name']) == 0) {
// The value doesn't match what we needed
if (!preg_match("/{$this->server['header_value']}/i", $value)) {
$result = false;
} else {
// The value matches what we need, everything is fine
if (preg_match("/{$this->server['header_value']}/i", $value)) {
$header_flag = true;
break; // No need to go further
break; // The correct header is found, we leave the loop
}
}
}
}
if (!$header_flag) {
// Header was not present
// Header was not present, set error message and $result variable
$this->error = 'HEADER ERROR : Header "' . $this->server['header_name'] .
'" not found or does not match "/' . $this->server['header_value'] . '/i".';
$result = false;
}
}
@ -447,7 +447,7 @@ class StatusUpdater
socket_send($socket, $package, strLen($package), 0);
// socket_read returns a string or false
$status = socket_read($socket, 255) !== false ? true : false;
if ($status) {
$this->header = "Success.";
} else {

View File

@ -39,7 +39,7 @@ class UserValidator
* Available editable user levels
* @var array $user_levels
*/
protected $user_levels = array(PSM_USER_ADMIN, PSM_USER_USER);
protected $user_levels = array(PSM_USER_ADMIN, PSM_USER_USER, PSM_USER_ANONYMOUS);
/**
* User service

View File

@ -89,7 +89,8 @@
<script type="text/javascript" src="src/templates/default/static/plugin/bootstrap-select/dist/js/bootstrap-select.min.js"></script>
<script type="text/javascript" src="src/templates/default/static/plugin/bootstrap-select/dist/js/i18n/defaults-{{ language }}.min.js"></script>
<script defer src="src/templates/default/static/plugin/font-awesome/js/solid.min.js"></script>
<script defer src="src/templates/default/static/plugin/font-awesome/js/fontawesome.min.js" data-auto-replace-svg="nest"></script>
<script defer src="src/templates/default/static/plugin/font-awesome/js/fontawesome.min.js" data-auto-replace-svg="nest"></script>
<script defer src="src/templates/default/static/plugin/font-awesome/js/brands.min.js" data-auto-replace-svg="nest"></script>
<script type="text/javascript" src="src/templates/default/static/js/scripts.js"></script>
</body>

View File

@ -7,6 +7,11 @@
role="tab" aria-controls="config-general" aria-selected="{% if general_active %}true{% else %}false{% endif %}">{{
label_general }}</a>
</li>
<li class="nav-item">
<a class="nav-link {{ auth_active }}" id="config-auth-tab" data-toggle="tab" href="#config-auth" role="tab"
aria-controls="config-auth" aria-selected="{% if auth_active %}true{% else %}false{% endif %}">{{
label_tab_auth }}</a>
</li>
<li class="nav-item">
<a class="nav-link {{ email_active }}" id="config-email-tab" data-toggle="tab" href="#config-email" role="tab"
aria-controls="config-email" aria-selected="{% if email_active %}true{% else %}false{% endif %}">{{
@ -30,7 +35,17 @@
<li class="nav-item">
<a class="nav-link {{ jabber_active }}" id="config-jabber-tab" data-toggle="tab" href="#config-jabber"
role="tab" aria-controls="config-jabber" aria-selected="{% if jabber_active %}true{% else %}false{% endif %}">{{
label_tab_jabber }}</a>
label_tab_jabber }}</a>
</li>
<li class="nav-item">
<a class="nav-link {{ discord_active }}" id="config-discord-tab" data-toggle="tab" href="#config-discord" role="tab"
aria-controls="config-discord" aria-selected="{% if discord_active %}true{% else %}false{% endif %}">{{
label_tab_discord }}</a>
</li>
<li class="nav-item">
<a class="nav-link {{ webhook_active }}" id="config-webhook-tab" data-toggle="tab" href="#config-webhook" role="tab"
aria-controls="config-webhook" aria-selected="{% if webhook_active %}true{% else %}false{% endif %}">{{
label_tab_webhook }}</a>
</li>
</ul>
<!-- Tab panes -->
@ -83,6 +98,43 @@
{{ macro.button_save("general_submit", label_save) }}
</fieldset>
</div>
<div class="tab-pane {{ auth_active }}" id="config-auth" role="tabpanel" aria-labelledby="config-auth-tab">
<!-- Auth settings -->
<fieldset>
<legend>{{ label_settings_dirauth }}</legend>
<!-- enable ldap -->
{{ macro.input_checkbox("dirauth_status", "dirauth_status[]", label_dirauth_status, dirauth_status_checked) }}
<!-- Directory host -->
{{ macro.input_field("text", "authdir_host_locn", null, "authdir_host_locn", label_authdir_host_locn, authdir_host_locn, label_authdir_host_locn, "100") }}
<!-- smtp security -->
{{ macro.input_select("authdir_type", "authdir_type", label_authdir_type, authdir_type, authdir_type_selected, "authdir_type_help", label_authdir_type_description) }}
<!-- Directory port -->
{{ macro.input_field("text", "authdir_host_port", null, "authdir_host_port", label_authdir_host_port, authdir_host_port, label_authdir_host_port, "10") }}
<!-- Active Directory domain -->
{{ macro.input_field("text", "authdir_userdomain", null, "authdir_userdomain", label_authdir_userdomain, authdir_userdomain, label_authdir_userdomain, "100", "authdir_userdomain_help", label_authdir_userdomain_description) }}
<!-- LDAP protecol version -->
{{ macro.input_field("text", "authdir_ldapver", null, "authdir_ldapver", label_authdir_ldapver, authdir_ldapver, label_authdir_ldapver, "100", "authdir_ldapver_help", label_authdir_ldapver_description) }}
<!-- Follow referrals -->
{{ macro.input_checkbox("authdir_ldapfollowref", "authdir_ldapfollowref[]", label_authdir_ldapfollowref, authdir_ldapfollowref_checked, "authdir_ldapfollowref_help", label_authdir_ldapfollowref_description) }}
<!-- Base DN* -->
{{ macro.input_field("text", "authdir_basedn", null, "authdir_basedn", label_authdir_basedn, authdir_basedn, "dc=domain,dc=tld", "100", "authdir_basedn_help", label_authdir_basedn_description) }}
<!-- Username attribute -->
{{ macro.input_field("text", "authdir_usernameattrib", null, "authdir_usernameattrib", label_authdir_usernameattrib, authdir_usernameattrib, label_authdir_usernameattrib, "100", "authdir_usernameattrib_help", label_authdir_usernameattrib_description) }}
<!-- Group name attribute -->
{{ macro.input_field("text", "authdir_groupnameattrib", null, "authdir_groupnameattrib", label_authdir_groupnameattrib, authdir_groupnameattrib, label_authdir_groupnameattrib, "100", "authdir_groupnameattrib_help", label_authdir_groupnameattrib_description) }}
<!-- Group member attribute -->
{{ macro.input_field("text", "authdir_groupmemattrib", null, "authdir_groupmemattrib", label_authdir_groupmemattrib, authdir_groupmemattrib, label_authdir_groupmemattrib, "100", "authdir_groupmemattrib_help", label_authdir_groupmemattrib_description) }}
<!-- User container RDN -->
{{ macro.input_field("text", "authdir_usercontainerrdn", null, "authdir_usercontainerrdn", label_authdir_usercontainerrdn, authdir_usercontainerrdn, "ou=Users", "100", "authdir_usercontainerrdn_help", label_authdir_usercontainerrdn_description) }}
<!-- Group container RDN -->
{{ macro.input_field("text", "authdir_groupcontainerrdn", null, "authdir_groupcontainerrdn", label_authdir_groupcontainerrdn, authdir_groupcontainerrdn, "ou=Groups", "100", "authdir_groupcontainerrdn_help", label_authdir_groupcontainerrdn_description) }}
<!-- Authorised directory group -->
{{ macro.input_field("text", "authdir_groupname", null, "authdir_groupname", label_authdir_groupname, authdir_groupname, label_authdir_groupname, "100", "authdir_groupname_help", label_authdir_groupname_description) }}
<!-- Default role -->
{{ macro.input_select("authdir_defaultrole", "authdir_defaultrole", label_authdir_defaultrole, authdir_defaultroles, authdir_defaultrole_selected, "authdir_defaultrole_help", label_authdir_defaultrole_description) }}
{{ macro.button_save("auth_submit", label_save) }}
</fieldset>
</div>
<div class="tab-pane {{ email_active }}" id="config-email" role="tabpanel" aria-labelledby="config-email-tab">
<fieldset>
<legend>{{ label_settings_email }}</legend>
@ -90,6 +142,8 @@
{{ macro.input_checkbox("email_status", "email_status[]", label_email_status, email_status_checked) }}
<!-- enable email log -->
{{ macro.input_checkbox("log_email", "log_email[]", label_log_email, log_email_checked) }}
<!-- enable adding url to email -->
{{ macro.input_checkbox("email_add_url", "email_add_url[]", label_email_add_url, email_add_url_checked) }}
<!-- email name -->
{{ macro.input_field("text", "email_from_name", null, "email_from_name", label_email_from_name, email_from_name, label_email_from_name, "255") }}
<!-- email address -->
@ -129,12 +183,24 @@
{{ macro.input_field("text", "sms_gateway_password", null, "sms_gateway_password", label_sms_gateway_password, sms_gateway_password, label_sms_gateway_password, "255") }}
<!-- sms sender number-->
{{ macro.input_field("text", "sms_from", null, "sms_from", label_sms_from, sms_from, "+31123456789", "255") }}
{{ macro.button_test("testSms", label_test) }}
{{ macro.input_hidden("test_sms", "0") }}
{{ macro.button_save("sms_submit", label_save) }}
</fieldset>
</div>
<div class="tab-pane {{ discord_active }}" id="config-discord" role="tabpanel" aria-labelledby="config-discord-tab">
<fieldset>
<legend>{{ label_settings_discord }}</legend>
<!-- enable discord -->
{{ macro.input_checkbox("discord_status", "discord_status[]", label_discord_status, discord_status_checked) }}
<!-- enable discord log -->
{{ macro.input_checkbox("log_discord", "log_discord[]", label_log_discord, log_discord_checked) }}
{{ macro.button_test("testDiscord", label_test) }}
{{ macro.input_hidden("test_discord", "0") }}
{{ macro.button_save("discord_submit", label_save) }}
</fieldset>
</div>
<div class="tab-pane {{ pushover_active }}" id="config-pushover" role="tabpanel" aria-labelledby="config-pushover-tab">
<fieldset>
<legend>{{ label_settings_pushover }}</legend>
@ -158,6 +224,8 @@
{{ macro.input_checkbox("telegram_status", "telegram_status[]", label_telegram_status, telegram_status_checked) }}
<!-- enable telegram log -->
{{ macro.input_checkbox("log_telegram", "log_telegram[]", label_log_telegram, log_telegram_checked) }}
<!-- enable adding url to telegram -->
{{ macro.input_checkbox("telegram_add_url", "telegram_add_url[]", label_telegram_add_url, telegram_add_url_checked) }}
<!-- telegram key -->
{{ macro.input_field("text", "telegram_api_token", null, "telegram_api_token", label_telegram_api_token, telegram_api_token, label_telegram_api_token, "255", "telegram_api_token_help", label_telegram_api_token_description) }}
{{ macro.button_test("testTelegram", label_test) }}
@ -183,6 +251,24 @@
{{ macro.button_save("jabber_submit", label_save) }}
</fieldset>
</div>
<div class="tab-pane {{ webhook_active }}" id="config-webhook" role="tabpanel" aria-labelledby="config-webhook-tab">
<fieldset>
<legend>{{ label_settings_webhook }}</legend>
<p>{{ label_webhook_description|raw }}</p>
<!-- enable webhooks -->
{{ macro.input_checkbox("webhook_status", "webhook_status", label_webhook_status, webhook_status_checked) }}
<!-- enable webhook log -->
{{ macro.input_checkbox("log_webhook", "log_webhook", label_log_webhook, log_webhook_checked) }}
<!-- webhook url -->
<!-- {{ macro.input_field("text", "webhook_url", null, "webhook_url", label_webhook_url, webhook_url, label_webhook_url, "255", "webhook_url_help", label_webhook_url_description) }} -->
<!-- webhook json -->
<!-- {{ macro.input_field("text", "webhook_json", null, "webhook_json", label_webhook_json, webhook_json, label_webhook_json, "255", "webhook_json_help", label_webhook_json_description) }} -->
{{ macro.button_test("testWebhook", label_test) }}
{{ macro.input_hidden("test_webhook", "0") }}
{{ macro.button_save("webhook_submit", label_save) }}
</fieldset>
</div>
</div>
{{ macro.input_csrf() }}
</form>

View File

@ -32,7 +32,7 @@
data: {
datasets: [
{
data: [{{ graph.lines.offline.value }}],
data: {{ graph.lines.offline.value|raw }},
label: '{{ graph.lines.offline.name }}',
backgroundColor: '#dc3545',
borderColor: '#dc3545',
@ -43,7 +43,7 @@
spanGaps: false,
},
{
data: [{{ graph.lines.online.value }}],
data: {{ graph.lines.online.value|raw }},
label: '{{graph.lines.online.name }}',
fill: false,
spanGaps: false,
@ -120,7 +120,7 @@
datasets: [
{% for key,line in graph.lines %}
{
data: [{{ line.value|raw }}],
data: {{ line.value|raw }},
label: '{{ line.name }}',
backgroundColor: colors['{{key}}'],
borderColor: colors['{{key}}'],

View File

@ -63,17 +63,23 @@
</span>
{% endif %}
{% 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>
</span>
<i class="fab fa-telegram" title="{{ label_telegram }}"></i>
{% endif %}
{% if server.jabber|lower == 'yes'%}
<span class="fa-layers">
<i class="fas fa-circle" title="{{ label_jabber }}"></i>
<span class="fa-layers-text fa-inverse" style="font-weight:400; font-size:75%">J</span>
</span>
{% endif %}
<i class="fas fa-circle" title="{{ label_jabber }}"></i>
<span class="fa-layers-text fa-inverse" style="font-weight:400; font-size:75%">J</span>
</span>
{% endif %}
{% if server.discord|lower == 'yes' and config.discord|lower %}
<i class="fab fa-discord" title="{{ label_discord }}"></i>
{% endif %}
{% if server.webhook|lower == 'yes' and config.webhook|lower %}
<span class="fa-layers">
<i class="fas fa-circle" title="{{ label_webhook }}"></i>
<span class="fa-layers-text fa-inverse" style="font-weight:600; font-size:55%">W</span>
</span>
{% endif %}
</td>
{% if user_level == 10 %}
<td>

View File

@ -143,7 +143,11 @@
<!-- Telegram -->
{{ macro.input_select_monitoring("telegram", "telegram", label_send_telegram, edit_telegram_selected, label_yes, label_no, warning_telegram, label_warning_telegram) }}
<!-- Jabber -->
{{ macro.input_select_monitoring("jabber", "jabber", label_send_jabber, edit_jabber_selected, label_yes, label_no, warning_jabber, label_warning_jabber) }}
{{ macro.input_select_monitoring("jabber", "jabber", label_send_jabber, edit_jabber_selected, label_yes, label_no, warning_jabber, label_warning_jabber) }}
<!-- Discord -->
{{ macro.input_select_monitoring("discord", "discord", label_send_discord, edit_discord_selected, label_yes, label_no, warning_discord, label_warning_discord) }}
<!-- Webhook -->
{{ macro.input_select_monitoring("webhook", "webhook", label_send_webhook, edit_webhook_selected, label_yes, label_no, warning_webhook, label_warning_webhook) }}
</div>
</fieldset>
<fieldset>

View File

@ -309,6 +309,19 @@
<noscript>&#8263</noscript>
{% endif %}
</li>
<li class="list-group-item">
{{ label_discord }}:
{% if discord|lower == 'yes' %}
<i class="fas fa-bell float-right"></i>
<noscript>&#10003</noscript>
{% elseif discord|lower == 'no' %}
<i class="fas fa-bell-slash float-right"></i>
<noscript>&#10005</noscript>
{% else %}
<i class="fas fa-question-circle float-right" title="Value from database should either be yes or no."></i>
<noscript>&#8263</noscript>
{% endif %}
</li>
<li class="list-group-item">
{{ label_pushover }}:
{% if pushover|lower == 'yes' %}
@ -347,7 +360,20 @@
<i class="fas fa-question-circle float-right" title="Value from database should either be yes or no."></i>
<noscript>&#8263</noscript>
{% endif %}
</li>
</li>
<li class="list-group-item">
{{ label_webhook }}:
{% if webhook|lower == 'yes' %}
<i class="fas fa-bell float-right"></i>
<noscript>&#10003</noscript>
{% elseif webhook|lower == 'no' %}
<i class="fas fa-bell-slash float-right"></i>
<noscript>&#10005</noscript>
{% else %}
<i class="fas fa-question-circle float-right" title="Value from database should either be yes or no."></i>
<noscript>&#8263</noscript>
{% endif %}
</li>
</ul>
</div>
</div>

View File

@ -24,9 +24,9 @@
<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) }}
{{ macro.input_field("text", "pushover_key", null, "pushover_key", label_pushover_key, pushover_key, label_pushover_key, "255", "pushover_key_help", label_pushover_key_description) }}
<!-- pushover device -->
{{ macro.input_field("text", "pushover_device", null, "pushover_device", label_pushover_device, pushover_device, label_pushover_device, "255", "pushover_device_help", pushover_device_description) }}
{{ macro.input_field("text", "pushover_device", null, "pushover_device", label_pushover_device, pushover_device, label_pushover_device, "255", "pushover_device_help", label_pushover_device_description) }}
</fieldset>
<!-- Telegram settings -->
<fieldset>
@ -34,17 +34,31 @@
<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>
{{ macro.input_field("text", "telegram_id", null, "telegram_id", label_telegram_chat_id, telegram_id, label_telegram_chat_id, "255", "telegram_id_help", label_telegram_id_description) }}
<button type="button" class="btn btn-primary show-modal" data-toggle="modal" data-modal-id="activateTelegram">{{ label_activate_telegram }}</button>
{{ macro.input_hidden("activate_telegram", "0") }}
</fieldset>
<!-- Jabber settings -->
<fieldset>
<legend>{{ label_jabber }}</legend>
<!-- jabber -->
{{ macro.input_field("text", "jabber", null, "jabber", label_jabber, jabber, label_jabber, "255", "jabber_help", jabber_description) }}
</fieldset>
{{ macro.input_field("text", "jabber", null, "jabber", label_jabber, jabber, label_jabber, "255", "jabber_help", label_jabber_description) }}
</fieldset>
<!-- Discord settings -->
<fieldset>
<legend>{{ label_discord }}</legend>
{{ macro.input_field("text", "discord", null, "discord", label_discord, discord, "https://discordapp.com/api/webhooks/xxxxx", "255", "discord_help", label_discord_description) }}
</fieldset>
<!-- Webhook settings -->
<fieldset>
<legend>{{ label_webhook }}</legend>
<p>{{ label_webhook_description|raw }}</p>
<!-- webhook url -->
{{ macro.input_field("text", "webhook_url", null, "webhook_url", label_webhook_url, webhook_url, "https://test.com/api/abcde", "255", "webhook_url_help", label_webhook_url_description) }}
<!-- webhook json -->
{{ macro.input_field("text", "webhook_json", null, "webhook_json", label_webhook_json, webhook_json, "{\"text\":\"servermon: #message\"}", "255", "webhook_json_help", label_webhook_json_description) }}
</fieldset>
{{ macro.button_save(null, label_save) }}
</form>
</form>

View File

@ -4,9 +4,9 @@
<legend>{{ titlemode }}</legend>
<div class="col">
<!-- Username -->
{{ macro.input_field("text", "user_name", null, "user_name", label_user_name, edit_value_user_name, null, "255", null, null, null, true, true) }}
{{ macro.input_field("text", "user_name", null, "user_name", label_user_name, edit_value_user_name, null, "255", null, null, null, null, true) }}
<!-- Name -->
{{ macro.input_field("text", "name", null, "name", label_name, edit_value_name, null, "255", null, null, null, true) }}
{{ macro.input_field("text", "name", null, "name", label_name, edit_value_name, null, "255", null, null, null, null, true) }}
<!-- Level -->
{{ macro.input_select("level", "level", label_level, levels, user_level) }}
<!-- Password -->
@ -17,6 +17,12 @@
{{ macro.input_field("email", "email", null, "email", label_email, edit_value_email, null, "255") }}
<!-- Mobile -->
{{ macro.input_field("tel", "mobile", null, "mobile", label_mobile, edit_value_mobile, null, "20") }}
<!-- Discord -->
{{ macro.input_field("text", "discord", null, "discord", label_discord, edit_value_discord, null, "255") }}
<!-- Webhook_url -->
{{ macro.input_field("text", "webhook_url", null, "webhook_url", label_webhook_url, edit_value_webhook_url, null, "255") }}
<!-- Webhook_json -->
{{ macro.input_field("text", "webhook_json", null, "webhook_json", label_webhook_json, edit_value_webhook_json, null, "255") }}
<!-- Pushover_key -->
{{ macro.input_field("text", "pushover_key", null, "pushover_key", label_pushover_key, edit_value_pushover_key, null, "255") }}
<!-- Pushover_device -->

View File

@ -51,6 +51,7 @@ $().ready(function () {
}
$('#label').focus();
});
$("#type").change(function () {
switch ($("select#type option:checked").val()) {
case "website":
@ -103,6 +104,21 @@ $("select#popular_ports").change(function () {
}
}).change();
$("#user_name").change(function ()
{
switch ($("#user_name").val()) {
case "__PUBLIC__":
$('#password').parent().slideUp();
$('#password_repeat').parent().slideUp();
$("select#level").val('30');
$("#name").val('Public page');
break;
default:
$('#password').parent().slideDown();
$('#password_repeat').parent().slideDown();
}
}).change();
function psm_xhr(mod, params, method, on_complete, options) {
method = (typeof method === 'undefined') ? 'GET' : method;

View File

@ -43,14 +43,15 @@ else
fi
# get latest version
version=$(curl -s https://api.github.com/repos/phpservermon/phpservermon/releases/latest | grep browser_download_url | cut -d '/' -f 8)
version=$(curl -s https://api.github.com/repos/phpservermon/phpservermon/releases/latest | grep tag_name | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -d '"' -f 2)
echo Downloading latest Version of PHPServerMonitor \($version\)
# get download URL
downloadfile=$(curl -s https://api.github.com/repos/phpservermon/phpservermon/releases/latest | grep "zipball" | cut -d '"' -f 4)
downloadfile=$(curl -s https://api.github.com/repos/phpservermon/phpservermon/releases/latest | grep "browser_download_url" | grep "zip\"" | cut -d ' ' -f 8 | cut -d '"' -f 2)
echo Using url $downloadfile
# download latest release
curl -so update.zip.keep $downloadfile
curl -sLo update.zip.keep $downloadfile
echo Save config.php
mv config.php config.php.keep