Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/lang/en_US.lang.php
#	src/psm/Txtmsg/Smsglobal.class.php
#	src/psm/Util/Updater/StatusNotifier.class.php
This commit is contained in:
Victor Macko 2016-07-06 22:37:50 +10:00
commit 8e2698f4ce
69 changed files with 3060 additions and 4702 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@
/config.php
/build
/docs/_build
/vendor/

17
CHANGELOG.rst Executable file → Normal file
View File

@ -1,6 +1,23 @@
Changelog
=========
not yet released
----------------
* #50: Validation on servers page.
* #54: Improved phone/tablet compatibility.
* #62: Replace javascript confirm dialogs with Bootstrap modal dialogs.
* #66: Unable to add users with MySQL in strict mode.
* #75: Test mode for email and SMS settings.
* #82: Added Danish translation.
* #83: Invalid redirect after switching languages and logging in.
* #86: Different design styles on status page (list, table).
* #103: Added Russian translation.
* #105: Fixing check for websites with unverified SSL certificates.
* Support for Danish SMS provider Smsit <http://www.smsit.dk/>
* Composer added for dependencies.
v3.0.1 (released April 12, 2014)
----------------

View File

@ -1,4 +1,5 @@
tag = $(shell git describe)
export_name = phpservermon-$(tag)
help:
@echo ' PHP Server Monitor - $(tag) '
@ -6,24 +7,29 @@ help:
export:
@echo 'Building release for tag $(tag) '
mkdir -p ./build ./build/phpservermon
rm -rf ./build/phpservermon/*
git archive $(tag) | tar -xf - -C ./build/phpservermon/
mkdir -p ./build ./build/$(export_name)
rm -rf ./build/$(export_name)/*
git archive $(tag) | tar -xf - -C ./build/$(export_name)/
find ./build/$(export_name) -name "*.php" -exec sed -i "" "s/@package_version@/$(tag)/" {} \;
@echo 'Testing on syntax errors (thats all the automated testing your are going to get for now..) '
find ./build/phpservermon -name "*.php" | xargs -I file php -l file
find ./build/phpservermon -name "*.php" -exec sed -i "" "s/@package_version@/$(tag)/" {} \;
find ./build/$(export_name) -name "*.php" | xargs -I file php -l file
@echo 'Downloading dependencies'
cd ./build/$(export_name); php composer.phar install; cd ../../;
rm -f ./build/$(export_name)/composer.phar
rm -f ./build/$(export_name)/composer.json
rm -f ./build/$(export_name)/composer.lock
@echo 'Building HTML documentation'
cd ./build/phpservermon/docs; make BUILDDIR=. html; cd ../../../;
cd ./build/$(export_name)/docs; make BUILDDIR=. html; cd ../../../;
@echo 'Cleaning up docs dir'
rm -f ./build/phpservermon/Makefile
rm -f ./build/phpservermon/docs/Makefile
rm -f ./build/phpservermon/docs/make.bat
rm -f ./build/phpservermon/docs/conf.py
rm -f ./build/$(export_name)/Makefile
rm -f ./build/$(export_name)/docs/Makefile
rm -f ./build/$(export_name)/docs/make.bat
rm -f ./build/$(export_name)/docs/conf.py
@echo 'Setting folder and file permissions'
find ./build/phpservermon -type f | xargs chmod 0644
find ./build/phpservermon -type d | xargs chmod 0755
find ./build/$(export_name) -type f | xargs chmod 0644
find ./build/$(export_name) -type d | xargs chmod 0755
@echo 'Creating archives'
cd ./build; zip -rq phpservermon-$(tag).zip ./phpservermon; cd ../;
cd ./build; tar -pczf phpservermon-$(tag).tar.gz ./phpservermon; cd ../;
rm -rf ./build/phpservermon
cd ./build; zip -rq $(export_name).zip ./$(export_name); cd ../;
cd ./build; tar -pczf $(export_name).tar.gz ./$(export_name); cd ../;
#rm -rf ./build/$(export_name)
@echo 'Building release finished '

View File

@ -1,7 +1,7 @@
PHP Server Monitor
==================
Version 3.0.1
Version 3.1.0-dev
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,
@ -44,6 +44,7 @@ The following SMS gateways are currently available:
* Clickatell - <https://www.clickatell.com>
* Mosms - <http://www.mosms.com>
* Textmarketer - <http://www.textmarketer.co.uk>
* SMSit - <http://smsit.dk>
Please note: for these gateways you will need an account with sufficient credits.
@ -70,6 +71,12 @@ Install
Please see docs/install.rst.
In a nutshell: unzip, upload, run install.php, enjoy.
If you have downloaded the source from GitHub (and not a pre-built package), the dependencies are not included.
To be able to run an installation from the repo, you need to run the following command to install the dependencies::
php composer.phar install
Documentation
-------------

10
composer.json Normal file
View File

@ -0,0 +1,10 @@
{
"name": "phpservermon/phpservermon",
"description": "PHP Server Monitor",
"homepage": "http://www.phpservermonitor.org",
"require": {
"php": ">=5.3.7",
"phpmailer/phpmailer": "5.2.6",
"symfony/http-foundation": "2.4.*"
}
}

133
composer.lock generated Normal file
View File

@ -0,0 +1,133 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
],
"hash": "63c9618391ed04b38b098c0139b50570",
"packages": [
{
"name": "phpmailer/phpmailer",
"version": "v5.2.6",
"source": {
"type": "git",
"url": "https://github.com/PHPMailer/PHPMailer.git",
"reference": "4d9434e394496a5bb7acd9e73046587184b413df"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/4d9434e394496a5bb7acd9e73046587184b413df",
"reference": "4d9434e394496a5bb7acd9e73046587184b413df",
"shasum": ""
},
"require": {
"php": ">=5.0.0"
},
"require-dev": {
"phpdocumentor/phpdocumentor": "*",
"phpunit/phpunit": "*"
},
"type": "library",
"autoload": {
"classmap": [
"class.phpmailer.php",
"class.pop3.php",
"class.smtp.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-2.1"
],
"authors": [
{
"name": "Jim Jagielski",
"email": "jimjag@gmail.com"
},
{
"name": "Marcus Bointon",
"email": "phpmailer@synchromedia.co.uk"
},
{
"name": "Andy Prevost",
"email": "codeworxtech@users.sourceforge.net"
},
{
"name": "Brent R. Matzelle"
}
],
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"time": "2013-04-11 16:45:39"
},
{
"name": "symfony/http-foundation",
"version": "v2.4.3",
"target-dir": "Symfony/Component/HttpFoundation",
"source": {
"type": "git",
"url": "https://github.com/symfony/HttpFoundation.git",
"reference": "11ad7352c7bfa12145a0df8e1c4c303c585ce169"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/11ad7352c7bfa12145a0df8e1c4c303c585ce169",
"reference": "11ad7352c7bfa12145a0df8e1c4c303c585ce169",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"symfony/expression-language": "~2.4"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.4-dev"
}
},
"autoload": {
"psr-0": {
"Symfony\\Component\\HttpFoundation\\": ""
},
"classmap": [
"Symfony/Component/HttpFoundation/Resources/stubs"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com",
"homepage": "http://fabien.potencier.org",
"role": "Lead Developer"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony HttpFoundation Component",
"homepage": "http://symfony.com",
"time": "2014-03-26 11:35:33"
}
],
"packages-dev": [
],
"aliases": [
],
"minimum-stability": "stable",
"stability-flags": [
],
"platform": {
"php": ">=5.3.7"
},
"platform-dev": [
]
}

BIN
composer.phar Normal file

Binary file not shown.

View File

@ -39,7 +39,7 @@ $time = time();
if(psm_get_conf('cron_running') == 1 && ($time - psm_get_conf('cron_running_time') < PSM_CRON_TIMEOUT)) {
die('Cron is already running. Exiting.');
}
if(!PSM_DEBUG) {
if(!defined('PSM_DEBUG') || !PSM_DEBUG) {
psm_update_conf('cron_running', 1);
}
psm_update_conf('cron_running_time', $time);

View File

@ -51,7 +51,7 @@ copyright = u'2008-2014, Pepijn Over'
# built documents.
#
# The short X.Y version.
version = '3.0.1'
version = '3.1.0-dev'
# The full version, including alpha/beta/rc tags.
release = version

View File

@ -9,7 +9,7 @@ Credits
The following people have contributed to the development of PHP Server Monitor:
* Pepijn Over <pep_at_neanderthal-technology.com>
* Pepijn Over <https://github.com/dopeh/>
* Creator and project maintainer
@ -42,6 +42,10 @@ The following people have contributed to the development of PHP Server Monitor:
* Website pattern / regular expression search
* nerdalertdk <https://github.com/nerdalertdk>
* Smsit SMS gateway
Translators
+++++++++++
@ -56,6 +60,10 @@ The following people have contributed to the translation of PHP Server Monitor:
* Plamen Vasilev <https://github.com/PVasileff>
* Danish
* nerdalertdk
* French
* David Ribeiro
@ -81,6 +89,11 @@ The following people have contributed to the translation of PHP Server Monitor:
* Klemens Häckel <http://clickdimension.wordpress.com/>
* Russian
* Roman Beylin <https://github.com/roman-beylin>
Vendors
+++++++

View File

@ -25,6 +25,37 @@ Regular users:
* Run the updater on their assigned servers.
Servers
+++++++
What is the difference between a service and a website?
-------------------------------------------------------
For websites, the monitor attempts to open a regular web page, just like you do in your browser.
It will attempt to retrieve its contents, and also check the HTTP status code (for example "404 not found" will cause an error).
You can then even add a check to make sure the content of the website includes a certain string or matches a certain regular expression.
Please note, it only retrieves the contents and does not execute any Javascript. Your search pattern will not work if it depends on Javascript being executed.
For services, the monitor only attempts to connect to the IP address and specified port to check whether the server is listening on that port.
For example, if you are running a webserver it will usually listen on port 80 for incoming connections.
So if the monitor is able to connect to the server on port 80, you know the webserver is running and accepting connections.
It does not, however, mean that your website is available to your users, because it might have PHP errors or database problems.
This can be monitored using the website type with a pattern search as described above.
Are requests made by the monitor included in my website statistics?
-------------------------------------------------------------------
There are two different ways to gather statistics.
One way is to include a piece of Javascript in your HTML, e.g. for Google Analytics and Piwik.
The other way is to parse the access logs created by your webserver software, which does not require any changes to your code, and is done by tools like Awstats.
When using tools such as Google Analytics, the monitor requests will not show up in your statistics, because the monitor does not execute any Javascript.
Tools that parse your raw access logs like Awstats, will include the requests made by the monitor.
To make sure these requests can be identified, the monitor uses a custom user agent, which you can usually filter out. The user agent of the monitor looks like::
Mozilla/5.0 (compatible; phpservermon/3.0.1; +http://www.phpservermonitor.org)
Configuration
+++++++++++++

View File

@ -64,6 +64,15 @@ One of the new features introduced in 3.0 is a user authentication system. Becau
For that reason the upgrade script will ask you to create a new account during the upgrade, which you can then use to change the password for the existing accounts.
If, for whatever reason this does not work, the upgrade script automatically changes the username of all existing users to their email addresses, which you could use for the forgot password screen.
Installing from GitHub
++++++++++++++++++++++
If you have downloaded the source from GitHub (and not a pre-built package), the dependencies are not included.
To be able to run an installation from the repo, you need to run the following command to install the dependencies::
php composer.phar install
Setting up a cronjob
++++++++++++++++++++
@ -78,10 +87,15 @@ If it is your own server or you have shell access and permission to open the cro
As you can see, this line will run the status.cron.php script every 15 minutes. Change the line to suit your needs.
If you do not have shell access, ask your web hosting provider to set it up for you.
Please note that some distros have user-specific crontabs (e.g. Debian). If that is the case, you need to omit the user part::
*/15 * * * * /usr/bin/php /var/www/html/phpservermon/cron/status.cron.php
The update script has been designed to prevent itself from running multiple times. It has a maximum timeout of 10 minutes.
After that the script is assumed dead and the cronjob will run again.
If you want to change the 10 minutes timeout, find the constant "PSM_CRON_TIMEOUT" in src/includes/psmconfig.inc.php.
Troubleshooting
+++++++++++++++

View File

@ -53,5 +53,12 @@ The following SMS gateways are currently available:
* Clickatell - https://www.clickatell.com
* Mosms - http://www.mosms.com
* Textmarketer - http://www.textmarketer.co.uk
* SMSit - http://smsit.dk
Please note: for these gateways you will need an account with sufficient credits.
Download
++++++++
The latest version can be downloaded from http://www.phpservermonitor.org/.

BIN
favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -28,7 +28,6 @@
// Include paths
define('PSM_PATH_SRC', dirname(__FILE__) . DIRECTORY_SEPARATOR);
define('PSM_PATH_VENDOR', PSM_PATH_SRC . '..' . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR);
define('PSM_PATH_INC', PSM_PATH_SRC . 'includes' . DIRECTORY_SEPARATOR);
define('PSM_PATH_TPL', PSM_PATH_SRC . 'templates' . DIRECTORY_SEPARATOR);
define('PSM_PATH_LANG', PSM_PATH_SRC . 'lang' . DIRECTORY_SEPARATOR);
@ -56,29 +55,28 @@ if(defined('PSM_DEBUG') && PSM_DEBUG) {
ini_set('display_errors', 0);
}
$vendor_autoload = PSM_PATH_SRC . '..' . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
if(!file_exists($vendor_autoload)) {
die('No dependencies found in vendor dir. Did you install the dependencies? Please run "php composer.phar install".');
}
require_once $vendor_autoload;
// set autoloader, make sure to set $prepend = true so that our autoloader is called first
function __autoload($class) {
spl_autoload_register(function($class) {
// remove leading \
$class = ltrim($class, '\\');
$path_parts = explode('\\', $class);
$filename = array_pop($path_parts);
$path = implode(DIRECTORY_SEPARATOR, $path_parts) .
$path = PSM_PATH_SRC . implode(DIRECTORY_SEPARATOR, $path_parts) .
DIRECTORY_SEPARATOR .
$filename . '.class.php'
;
// search in these dirs:
$basedirs = array(
PSM_PATH_SRC,
PSM_PATH_VENDOR
);
foreach($basedirs as $dir) {
if(file_exists($dir . $path)) {
require_once $dir . $path;
return;
}
if(file_exists($path)) {
require_once $path;
return;
}
}
});
// auto-find all include files
$includes = glob(PSM_PATH_INC . '*.inc.php');

95
src/includes/functions.inc.php Normal file → Executable file
View File

@ -163,13 +163,10 @@ function psm_load_conf() {
function psm_update_conf($key, $value) {
global $db;
$result = $db->save(
PSM_DB_PREFIX.'config',
array('value' => $value),
array('key' => $key)
);
// save returns the # rows updated, if 0, key doenst exist yet
if($result === 0) {
// check if key exists
$exists = psm_get_conf($key, false);
if($exists === false) {
// add new config record
$db->save(
PSM_DB_PREFIX . 'config',
array(
@ -177,6 +174,12 @@ function psm_update_conf($key, $value) {
'value' => $value,
)
);
} else {
$db->save(
PSM_DB_PREFIX.'config',
array('value' => $value),
array('key' => $key)
);
}
$GLOBALS['sm_config'][$key] = $value;
}
@ -270,6 +273,8 @@ function psm_curl_get($href, $header = false, $body = true, $timeout = 10, $add_
curl_setopt($ch, CURLOPT_NOBODY, (!$body));
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_ENCODING, '');
@ -335,12 +340,9 @@ function psm_date($time) {
* Check if an update is available for PHP Server Monitor.
*
* Will only check for new version if user turned updates on in config.
* @global object $db
* @return boolean
*/
function psm_update_available() {
global $db;
if(!psm_get_conf('show_update')) {
// user does not want updates, fair enough.
return false;
@ -370,15 +372,15 @@ function psm_update_available() {
}
/**
* Prepare a new Mailer util.
* 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 \psm\Util\Mailer
* @return \PHPMailer
*/
function psm_build_mail($from_name = null, $from_email = null) {
$phpmailer = new \psm\Util\Mailer();
$phpmailer = new \PHPMailer();
$phpmailer->Encoding = "base64";
$phpmailer->SMTPDebug = false;
@ -409,9 +411,56 @@ function psm_build_mail($from_name = null, $from_email = null) {
return $phpmailer;
}
/**
* Prepare a new SMS util.
*
* @return \psm\Txtmsg\TxtmsgInterface
*/
function psm_build_sms() {
$sms = null;
// open the right class
// not making this any more dynamic, because perhaps some gateways need custom settings (like Mollie)
switch(strtolower(psm_get_conf('sms_gateway'))) {
case 'mosms':
$sms = new \psm\Txtmsg\Mosms();
break;
case 'smsit':
$sms = new \psm\Txtmsg\Smsit();
break;
case 'inetworx':
$sms = new \psm\Txtmsg\Inetworx();
break;
case 'mollie':
$sms = new \psm\Txtmsg\Mollie();
$sms->setGateway(1);
break;
case 'spryng':
$sms = new \psm\Txtmsg\Spryng();
break;
case 'clickatell':
$sms = new \psm\Txtmsg\Clickatell();
break;
case 'textmarketer':
$sms = new \psm\Txtmsg\Textmarketer();
break;
case 'smsglobal':
$sms = new \psm\Txtmsg\Smsglobal();
break;
}
// copy login information from the config file
if($sms) {
$sms->setLogin(psm_get_conf('sms_gateway_username'), psm_get_conf('sms_gateway_password'));
$sms->setOriginator(psm_get_conf('sms_from'));
}
return $sms;
}
/**
* Generate a new link to the current monitor
* @param array $params key value pairs
* @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
@ -426,13 +475,17 @@ function psm_build_url($params = array(), $urlencode = true, $htmlentities = tru
if($params != null) {
$url .= '?';
$delim = ($htmlentities) ? '&amp;' : '&';
if(is_array($params)) {
$delim = ($htmlentities) ? '&amp;' : '&';
foreach($params as $k => $v) {
if($urlencode) {
$v = urlencode($v);
foreach($params as $k => $v) {
if($urlencode) {
$v = urlencode($v);
}
$url .= $delim . $k . '=' . $v;
}
$url .= $delim . $k . '=' . $v;
} else {
$url .= $params;
}
}
@ -491,7 +544,9 @@ function psm_is_cli() {
*/
function pre($arr = null) {
echo "<pre>";
if ($arr === null) debug_print_backtrace();
if ($arr === null) {
debug_print_backtrace();
}
print_r($arr);
echo "</pre>";
}

View File

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

View File

@ -18,7 +18,7 @@
* along with PHP Server Monitor. If not, see <http://www.gnu.org/licenses/>.
*
* @package phpservermon
* @author Plamen Vasilev <p.vasileff@gmail.com>
* @author Plamen Vasilev a.k.a Paco <p.vasileff@gmail.com>
* @copyright Copyright (c) 2008-2014 Pepijn Over <pep@neanderthal-technology.com>
* @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3
* @version Release: @package_version@
@ -29,35 +29,35 @@ $sm_lang = array(
'name' => 'Български - Bulgarian',
'locale' => array('bg_BG.UTF-8', 'bg_BG', 'bulgarian'),
'system' => array(
'title' => 'Server Monitor',
'title' => 'Мониторинг',
'install' => 'Инсталация',
'action' => 'Действие',
'save' => 'Запиши',
'edit' => 'Редактирай',
'delete' => 'Изтрии',
'deleted' => 'Записът е изтрит',
'delete' => 'Изтрий',
'date' => 'Дата',
'message' => 'Съобщебие',
'message' => 'Съобщение',
'yes' => 'Да',
'no' => 'Не',
'edit' => 'Редактиране на',
'insert' => 'Добавяне',
'add_new' => 'Добави нов',
'update_available' => 'Налична е нова версия ({version}). Може да я свалите от <a href="http://www.phpservermonitor.org" target="_blank">тук</a>.',
'update_available' => 'Налична е нова версия: ({version}). Може да я свалите от <a href="http://www.phpservermonitor.org" target="_blank">тук</a>.',
'back_to_top' => 'Нагоре',
'go_back' => 'Go back',
// date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php
'go_back' => 'Назад',
'ok' => 'Ок',
'cancel' => 'Отказ',
// date/time са във формат според параметъра strftime PHP функцията http://php.net/manual/function.strftime.php
'short_day_format' => '%B %e',
'long_day_format' => '%B %e, %Y',
'yesterday_format' => 'Yesterday at %k:%M',
'other_day_format' => '%A at %k:%M',
'never' => 'Never',
'hours_ago' => '%d hours ago',
'an_hour_ago' => 'about an hour ago',
'minutes_ago' => '%d minutes ago',
'a_minute_ago' => 'about a minute ago',
'seconds_ago' => '%d seconds ago',
'a_second_ago' => 'a second ago',
'yesterday_format' => 'Вчера в %k:%M',
'other_day_format' => '%A в %k:%M',
'never' => 'Никога',
'hours_ago' => 'преди %d часа',
'an_hour_ago' => 'преди час',
'minutes_ago' => 'преди %d минути',
'a_minute_ago' => 'преди минута',
'seconds_ago' => 'преди %d секунди',
'a_second_ago' => 'преди секунда',
),
'menu' => array(
'config' => 'Настройки',
@ -71,29 +71,32 @@ $sm_lang = array(
'users' => array(
'user' => 'Потребител',
'name' => 'Име',
'user_name' => 'Username',
'password' => 'Password',
'password_repeat' => 'Password repeat',
'password_leave_blank' => 'Leave blank to keep unchanged',
'level' => 'Level',
'level_10' => 'Administrator',
'level_20' => 'User',
'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.',
'user_name' => 'Потребител',
'password' => 'Парола',
'password_repeat' => 'Повторете паролата',
'password_leave_blank' => 'Оставете празно, за да не бъде променена паролата',
'level' => 'Ниво на достъп',
'level_10' => 'Администратор',
'level_20' => 'Потребител',
'level_description' => '<b>Администраторите</b> имат пълен достъп: могат да управляват сървърите, потребителите и да редактират глобалните настройки.<br/><b>Потребителите</b> могат само да виждат статуса на сървърите и да обнояват информацията за даден сървър, за който им е разрешен достъп.',
'mobile' => 'Мобилен телефон',
'email' => 'Имейл',
'delete_title' => 'Изтриване на потребител',
'delete_message' => 'Сигурни ли сте, че искате да изтриете потребител \'%1\'?',
'deleted' => 'Потребителят е изтрит успешно.',
'updated' => 'Информацията за потребителя е обновена.',
'inserted' => 'Потребителят е добавен.',
'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' => 'It may only contain alphabetic characters (a-z, A-Z), digits (0-9) 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.',
'error_user_level_invalid' => 'The given user level is invalid.',
'error_user_no_match' => 'The user could not be found in the database.',
'error_user_password_invalid' => 'The entered password is invalid.',
'error_user_password_no_match' => 'The entered passwords do not match.',
'profile' => 'Профил',
'profile_updated' => 'Профилът е обновен успешно',
'error_user_name_bad_length' => 'Потребителското име трябва да съдържа между 2 и 64 символа',
'error_user_name_invalid' => 'Може да съдържа само латински букви (a-z, A-Z), цифри (0-9) и долна черта (_).',
'error_user_name_exists' => 'Вече съществува акаунт с това потребителско име.',
'error_user_email_bad_length' => 'Имейл адреса трябва да съдържа между 5 и 255 символа.',
'error_user_email_invalid' => 'Въведения имейл адрес е грешен.',
'error_user_level_invalid' => 'Избраното ниво на достъп е грешно.',
'error_user_no_match' => 'Потребителят не може да бъде намерен.',
'error_user_password_invalid' => 'Въведената парола е грешка.',
'error_user_password_no_match' => 'Въведените пароли не съвпадат.',
),
'log' => array(
'title' => 'Записи в лога',
@ -101,42 +104,58 @@ $sm_lang = array(
'status' => 'Статус',
'email' => 'Имейл',
'sms' => 'SMS',
'no_logs' => 'Няма налични логове',
),
'servers' => array(
'server' => 'Сървър',
'status' => 'Статус',
'label' => 'Име',
'domain' => 'Хост',
'port' => 'Порт',
'type' => 'Тип',
'type_website' => 'Website',
'type_service' => 'Service',
'pattern' => 'Търсене на образец/схема',
'pattern_description' => 'If this pattern is not found on the website, the server will be marked offline. Regular expressions are allowed.',
'type_website' => 'Сайт',
'type_service' => 'Услуга',
'pattern' => 'Търсене на стринг/образец',
'pattern_description' => 'Ако този текст не е намерен в интернет страницата (когато имате добавен сайт), той ще бъде маркиран като Офлайн. Регулярните изрази са разрешени.',
'last_check' => 'Последна проверка',
'last_online' => 'Последно на линия',
'monitoring' => 'Мониторинг',
'no_monitoring' => 'Не се наблюдава',
'email' => 'Имейл',
'send_email' => 'Имейл',
'sms' => 'SMS',
'send_sms' => 'SMS',
'delete_title' => 'Изтриване на сървър',
'delete_message' => 'Сигурни ли сте, че искате да изтриете сървър \'%1\'?',
'deleted' => 'Сървъра е изтрит успешно.',
'updated' => 'Информацията за сървъра е обновена.',
'inserted' => 'Сървърът е добвен успешно.',
'latency' => 'Пинг',
'latency_max' => 'Latency (maximum)',
'latency_min' => 'Latency (minimum)',
'latency_avg' => 'Latency (average)',
'year' => 'Year',
'month' => 'Month',
'week' => 'Week',
'day' => 'Day',
'hour' => 'Hour',
'warning_threshold' => 'Warning threshold',
'warning_threshold_description' => 'Number of failed checks required before it is marked offline.',
'chart_last_week' => 'Last week',
'chart_history' => 'History',
// Charts date format according jqPlot date format http://www.jqplot.com/docs/files/plugins/jqplot-dateAxisRenderer-js.html
'inserted' => 'Сървърът е добавен успешно.',
'latency' => 'Латенция',
'latency_max' => 'Латенция (максимална)',
'latency_min' => 'Латенция (минимална)',
'latency_avg' => 'Латенция (средна)',
'uptime' => 'Ъптайм',
'year' => 'Година',
'month' => 'Месец',
'week' => 'Седмица',
'day' => 'Ден',
'hour' => 'Час',
'warning_threshold' => 'Предупредителен праг',
'warning_threshold_description' => 'Брой неуспешни проверки, преди сървъра или сайта да бъдат маркирани като Офлайн.',
'chart_last_week' => 'Последната седмица',
'chart_history' => 'История',
// Charts формат на датата според jqPlot http://www.jqplot.com/docs/files/plugins/jqplot-dateAxisRenderer-js.html
'chart_day_format' => '%d.%m.%Y',
'chart_long_date_format' => '%d.%m.%Y %H:%M:%S',
'chart_short_date_format' => '%d.%m %H:%M',
'chart_short_time_format' => '%H:%M',
'error_server_no_match' => 'Server not found.',
'error_server_label_bad_length' => 'The label must be between 1 and 255 characters.',
'error_server_ip_bad_length' => 'The domain / IP must be between 1 and 255 characters.',
'error_server_ip_bad_service' => 'The IP address is not valid.',
'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.',
),
'config' => array(
'general' => 'Основни настройки',
@ -154,6 +173,7 @@ $sm_lang = array(
'sms_status' => 'Да се изпращат ли SMS-и',
'sms_gateway' => 'Портал за изпращане на SMS-и',
'sms_gateway_mosms' => 'Mosms',
'sms_gateway_smsit' => 'Smsit',
'sms_gateway_mollie' => 'Mollie',
'sms_gateway_spryng' => 'Spryng',
'sms_gateway_inetworx' => 'Inetworx',
@ -167,10 +187,10 @@ $sm_lang = array(
'Ще получавате известие когато има промяна със връзката на даден някой от описаните сървър или сайт. От Онлайн -> Офлайн и от Офлайн -> Онлайн.<br/>'.
'<br/><b>Офлайн</b><br>'.
'Ще получите известие когато връзката до сървъра е изгубена за *ПЪРВИ ПЪТ*. Например, '.
'вашия cron скрипт проверява всеки 15 минути и връзката до сървъра е изгубена в 1 часа през ноща и не работи до 6 часа сутринта '.
'вашия cron скрипт проверява всеки 15 минути и връзката до сървъра е изгубена в 1 часа през нощта и не работи до 6 часа сутринта '.
'Вие ще получите едно известие в 1 часа за това<br/>'.
'<br><b>Винаги:</b><br> '.
'Ще получавате известие при всяка проверка на Вашия cron скрипт дори когато връзката до даден сървър или сайт е била'.
'Ще получавате известие при всяка проверка на Вашия крон скрипт дори когато връзката до даден сървър или сайт е била'.
'прекъсната в продължение на часове.',
'alert_type_status' => 'Промяна на статуса',
'alert_type_offline' => 'Офлайн',
@ -180,9 +200,10 @@ $sm_lang = array(
'log_email' => 'Да се пази ли лог на изпратените имейли от системата',
'log_sms' => 'Да се пази ли лог на изпратените SMS съобщения от системата',
'updated' => 'Настройките са обновени успешно.',
'nochanges' => 'Не бяха направени промени!',
'tab_email' => 'Имейл',
'tab_sms' => 'SMS',
'tab_log' => 'логовете',
'tab_log' => 'Логове',
'settings_email' => 'Имейл настройки',
'settings_sms' => 'SMS настройки',
'settings_notification' => 'Настройки на известията',
@ -191,40 +212,49 @@ $sm_lang = array(
'auto_refresh_servers' =>
'Автоматично опресняване на страницата.<br/>'.
'<span class="small">'.
'Времето е в секунди, ако е 0 страницата няма да се обноява.'.
'Времето е в секунди, ако е 0 страницата няма да се обновява.'.
'</span>',
'seconds' => 'seconds',
'seconds' => 'секунди',
'test' => 'Тест',
'test_email' => 'Ще бъде изпратенo тестово съобщение до имейл адреса, който сте задали в профила си.',
'test_sms' => 'Ще бъде изпратен тестово SMS съобщение до телефонния номер, който сте задали в профила си.',
'send' => 'Изпрати',
'test_message' => 'Тестово съобщение',
'email_sent' => 'Тестовия имейл е изпратен успешно.',
'email_error' => 'Възникна грешка при изпращането на тесовия имейл',
'sms_sent' => 'Тестовото SMS съобщение е изпратеното успешно.',
'sms_error' => 'Възникна грешка при изпращането на тестовия SMS',
),
// За нов ред в имейл съобщението, моля използвайте тага <br/>
'notifications' => array(
'off_sms' => 'Syrvyryt \'%LABEL%\' e OFFLINE: ip=%IP%, port=%PORT%. Greshka=%ERROR%',
'off_sms' => 'Сървър \'%LABEL%\' е Офлайн: ip=%IP%, port=%PORT%. Greshka=%ERROR%',
'off_email_subject' => 'Връзката до \'%LABEL%\' е ИЗГУБЕНА',
'off_email_body' => "Неуспешно свързване:<br/><br/>Сървър: %LABEL%<br/>IP адрес: %IP%<br/>Порт: %PORT%<br/>Грешка: %ERROR%<br/>Днес: %DATE%",
'on_sms' => 'Syrvyryt \'%LABEL%\' e ONLINE: ip=%IP%, port=%PORT%',
'on_sms' => 'Сървър \'%LABEL%\' е Онлайн: ip=%IP%, port=%PORT%',
'on_email_subject' => 'Връзката до \'%LABEL%\' е ВЪЗСТАНОВЕНА',
'on_email_body' => "Връзката до '%LABEL%' беше ВЪЗСТАНОВЕНА:<br/><br/>Сървър: %LABEL%<br/>IP адрес: %IP%<br/>Порт: %PORT%<br/>Днес: %DATE%",
),
'login' => array(
'welcome_usermenu' => 'Welcome, %user_name%',
'title_sign_in' => 'Please sign in',
'title_forgot' => 'Forgot your password?',
'title_reset' => 'Reset your password',
'submit' => 'Submit',
'remember_me' => 'Remember me',
'login' => 'Login',
'logout' => 'Logout',
'username' => 'Username',
'password' => 'Password',
'password_repeat' => 'Repeat password',
'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%',
'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.',
'error_reset_invalid_link' => 'The reset link you provided is invalid.',
'success_password_forgot' => 'An email has been sent to you with information how to reset your password.',
'success_password_reset' => 'Your password has been reset successfully. Please login.',
'welcome_usermenu' => 'Добре дошъл, %user_name%',
'title_sign_in' => 'Моля, влезте с профила си',
'title_forgot' => 'Забравили сте паролата си?',
'title_reset' => 'Възстановяване на паролата',
'submit' => 'Вход',
'remember_me' => 'Искам да остана логнат',
'login' => 'Вход',
'logout' => 'Изход',
'username' => 'Потребител',
'password' => 'Парола',
'password_repeat' => 'Повторете паролата',
'password_forgot' => 'Забравили сте паролата си?',
'password_reset' => 'Възстановяване на паролата',
'password_reset_email_subject' => 'Възстановяване на парола за PHP Сървър Мониторинг',
'password_reset_email_body' => 'За да възстановите паролата си е нужно да кликнете на линка по-долу. Валидността на линка е един час.<br/><br/>%link%',
'error_user_incorrect' => 'Потребителят не може да бъде намерен.',
'error_login_incorrect' => 'Информацията е грешна.',
'error_login_passwords_nomatch' => 'Паролите не съвпадат.',
'error_reset_invalid_link' => 'Линкът за възстановяване на паролата не е валиден.',
'success_password_forgot' => 'Изпратен е имейл с информация за възстановяване на паролата.',
'success_password_reset' => 'Вашата парола е променена успешно. Моля, влезте в системата.',
),
);

260
src/lang/da_DK.lang.php Normal file
View File

@ -0,0 +1,260 @@
<?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 nerdalertdk
* @copyright Copyright (c) 2008-2014 Pepijn Over <pep@neanderthal-technology.com>
* @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3
* @version Release: @package_version@
* @link http://www.phpservermonitor.org/
**/
$sm_lang = array(
'name' => 'Dansk - Danish',
'locale' => array('da_DK.UTF-8', 'da_DK', 'danish', 'danish-dk'),
'system' => array(
'title' => 'Server Monitor',
'install' => 'Installere',
'action' => 'Action',
'save' => 'Gem',
'edit' => 'Redigere',
'delete' => 'Slet',
'date' => 'Dato',
'message' => 'Besked',
'yes' => 'Ja',
'no' => 'Nej',
'insert' => 'Indsæt',
'add_new' => 'Tilføj ny',
'update_available' => 'En ny version ({version}) er tilgængelig på <a href="http://www.phpservermonitor.org" target="_blank">http://www.phpservermonitor.org</a>.',
'back_to_top' => 'Til toppen',
'go_back' => 'Tilbage',
'ok' => 'OK',
'cancel' => 'Annuller',
// date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php
'short_day_format' => '%B %e',
'long_day_format' => '%B %e, %Y',
'yesterday_format' => 'Igår %k:%M',
'other_day_format' => '%A %k:%M',
'never' => 'Aldrig',
'hours_ago' => '%d timer siden',
'an_hour_ago' => 'omkring en time siden',
'minutes_ago' => '%d minutter siden',
'a_minute_ago' => 'omkring et minut siden',
'seconds_ago' => '%d sekunder siden',
'a_second_ago' => 'et sekund siden',
),
'menu' => array(
'config' => 'Indstillinger',
'server' => 'Servere',
'server_log' => 'Log',
'server_status' => 'Status',
'server_update' => 'Opdatere',
'user' => 'Brugere',
'help' => 'Hjælp',
),
'users' => array(
'user' => 'Bruger',
'name' => 'Navn',
'user_name' => 'Brugernavn',
'password' => 'Adgangskode',
'password_repeat' => 'Adgangskode igen',
'password_leave_blank' => 'Udfyldes hvis du vil skifte kode',
'level' => 'Level',
'level_10' => 'Administrator',
'level_20' => 'Bruger',
'level_description' => '<b>Administratore</b> har fuld adgang: De kan styre servere, brugere og indstillingere.<br/><b>Brugere</b> kan kun se og køre opdatere for servere som er tildelt til dem.',
'mobile' => 'Mobil',
'email' => 'Email',
'delete_title' => 'Slet bruger',
'delete_message' => 'Er du sikker på du vil slette bruger \'%1\'?',
'deleted' => 'Bruger slettet.',
'updated' => 'Bruger opdateret.',
'inserted' => 'Bruger tilføjet.',
'profile' => 'Profil',
'profile_updated' => 'Din profil er opdateret.',
'error_user_name_bad_length' => 'Brugernavn skal være mellem 2 til 64 tegn.',
'error_user_name_invalid' => 'Brugernavn må kun indholde alfabetiske tegn (a-z, A-Z), tal (0-9) og (_).',
'error_user_name_exists' => 'Det valgte brugernavn findes allerede.',
'error_user_email_bad_length' => 'Email addresser skal være mellem 5 til 255 tegn.',
'error_user_email_invalid' => 'Den valgte email er ugyldig.',
'error_user_level_invalid' => 'Det angivet bruger niveau er ugyldig.',
'error_user_no_match' => 'Brugeren findes ikke.',
'error_user_password_invalid' => 'Den indtastede adgangskode er ugyldig.',
'error_user_password_no_match' => 'De to adgangskode er ikke ens.',
),
'log' => array(
'title' => 'Logposter',
'type' => 'Type',
'status' => 'Status',
'email' => 'Email',
'sms' => 'SMS',
'no_logs' => 'Intet i loggen',
),
'servers' => array(
'server' => 'Server',
'status' => 'Status',
'label' => 'Label',
'domain' => 'Domæne/IP',
'port' => 'Port',
'type' => 'Type',
'type_website' => 'Hjemmeside',
'type_service' => 'Tjeneste',
'pattern' => 'Søge streng/mønster',
'pattern_description' => 'Hvis dette mønster ikke findes på hjemmesiden, vil serveren blive markeret offline. Regulære udtryk er tilladt.',
'last_check' => 'Sidst kontrolleret',
'last_online' => 'Sidst online',
'monitoring' => 'Overvågning',
'no_monitoring' => 'Ingen overvågning',
'email' => 'Email',
'send_email' => 'Send Email',
'sms' => 'SMS',
'send_sms' => 'Send SMS',
'delete_title' => 'Slet server',
'delete_message' => 'Er du sikker på du vil slette server \'%1\'?',
'deleted' => 'Server slettet.',
'updated' => 'Server opdateret.',
'inserted' => 'Server tilføjet.',
'latency' => 'Latency',
'latency_max' => 'Latency (maksimum)',
'latency_min' => 'Latency (minimum)',
'latency_avg' => 'Latency (gennemsnitlig)',
'uptime' => 'Oppetid',
'year' => 'År',
'month' => 'Måned',
'week' => 'Uge',
'day' => 'Dag',
'hour' => 'Time',
'warning_threshold' => 'Advarsel grænse',
'warning_threshold_description' => 'Antal af fejl før status skifter til offline.',
'chart_last_week' => 'Sidste uge',
'chart_history' => 'Historie',
// Charts date format according jqPlot date format http://www.jqplot.com/docs/files/plugins/jqplot-dateAxisRenderer-js.html
'chart_day_format' => '%d-%m-%Y',
'chart_long_date_format' => '%d-%m-%Y %H:%M:%S',
'chart_short_date_format' => '%d/%m %H:%M',
'chart_short_time_format' => '%H:%M',
'error_server_no_match' => 'Server not found.',
'error_server_label_bad_length' => 'The label must be between 1 and 255 characters.',
'error_server_ip_bad_length' => 'The domain / IP must be between 1 and 255 characters.',
'error_server_ip_bad_service' => 'The IP address is not valid.',
'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.',
),
'config' => array(
'general' => 'Generelt',
'language' => 'Sprog',
'show_update' => 'Opdateringer',
'email_status' => 'Tillad at sende mail',
'email_from_email' => 'Email fra adresse',
'email_from_name' => 'Email fra navn',
'email_smtp' => 'Aktiver SMTP',
'email_smtp_host' => 'SMTP vært',
'email_smtp_port' => 'SMTP port',
'email_smtp_username' => 'SMTP brugernavn',
'email_smtp_password' => 'SMTP adgangskode',
'email_smtp_noauth' => 'Efterladt blank hvis det ikke er opkrævet',
'sms_status' => 'Tillad at sende SMS beskeder',
'sms_gateway' => 'SMS Gateway',
'sms_gateway_mosms' => 'Mosms',
'sms_gateway_mollie' => 'Mollie',
'sms_gateway_spryng' => 'Spryng',
'sms_gateway_inetworx' => 'Inetworx',
'sms_gateway_clickatell' => 'Clickatell',
'sms_gateway_textmarketer' => 'Textmarketer',
'sms_gateway_smsit' => 'Smsit',
'sms_gateway_username' => 'Gateway brugernavn/apikey',
'sms_gateway_password' => 'Gateway adgangskode',
'sms_from' => 'Afsenders navn.',
'alert_type' => 'Vælg hvornår du vil modtage besked.<br/>',
'alert_type_description' => '<b>Status ændring:</b> '.
'Du vil modtage en notifcation når en server har en ændring i status. Fra online -> offline eller offline -> online.<br/>'.
'<br /><b>Offline:</b> '.
'Du vil modtage en meddelelse, når en server går offline for * kun første gang *. for eksempel, '.
'Hvis dit cronjob køre hvert kvatere og din server går ned kl 01 og kommer først op kl 06 '.
' så vil du kun modtage en mail kl 01.<br/>'.
'<br><b>Altid:</b> '.
'Du vil modtage en besked, hver gang scriptet kører og et websted er nede, selvom site har været '.
'offline i flere timer.',
'alert_type_status' => 'Status ændret',
'alert_type_offline' => 'Offline',
'alert_type_always' => 'Altid',
'log_status' => 'Log status',
'log_status_description' => 'Hvis log status er sat til TRUE, vil monitoren logge hændelsen hver gang status ændre sig.',
'log_email' => 'Log mails sendt af systemet',
'log_sms' => 'Log SMS sendt af systemet',
'updated' => 'Indstillingerne er blevet opdateret.',
'nochanges' => 'The configuration didn\'t change.',
'tab_email' => 'Email',
'tab_sms' => 'SMS',
'tab_log' => 'Log',
'settings_email' => 'Email indstillinger',
'settings_sms' => 'SMS indstillinger',
'settings_notification' => 'Meddelelse indstillinger',
'settings_log' => 'Log indstillinger',
'auto_refresh' => 'Genopfriske automatisk',
'auto_refresh_servers' =>
'Genopfriske automatisk server sider.<br/>'.
'<span class="small">'.
'Tid i sekunder, Hvis 0 vil siden ikke genopfriske automatisk'.
'</span>',
'seconds' => 'sekunder',
'test' => 'Test',
'test_email' => 'En email vil blive sendt til den adresse, der er angivet i din brugerprofil.',
'test_sms' => 'En SMS vil blive sendt til det nummer, der er angivet i din brugerprofil.',
'send' => 'Send',
'test_message' => 'Test besked',
'email_sent' => 'Email sendt',
'email_error' => 'Fejl ved afsendelse af email',
'sms_sent' => 'Sms sendt',
'sms_error' => 'Fejl ved afsendelse af SMS',
),
// for newlines in the email messages use <br/>
'notifications' => array(
'off_sms' => 'Server \'%LABEL%\' is DOWN: ip=%IP%, port=%PORT%. Fejl=%ERROR%',
'off_email_subject' => 'VIGTIG: Server \'%LABEL%\' is DOWN',
'off_email_body' => "Det lykkedes ikke at oprette forbindelse til følgende server:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>Fejl: %ERROR%<br/>Date: %DATE%",
'on_sms' => 'Server \'%LABEL%\' is RUNNING: ip=%IP%, port=%PORT%',
'on_email_subject' => 'VIGTIG: Server \'%LABEL%\' is RUNNING',
'on_email_body' => "Server '%LABEL%' køre igen:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>Dato: %DATE%",
),
'login' => array(
'welcome_usermenu' => 'Velkommen, %user_name%',
'title_sign_in' => 'Log ind',
'title_forgot' => 'Glemt adgangskode?',
'title_reset' => 'Nulstil din adgangskode',
'submit' => 'Indsend',
'remember_me' => 'Husk kode',
'login' => 'Log ind',
'logout' => 'Log ud',
'username' => 'Brugernavn',
'password' => 'Adgangskode',
'password_repeat' => 'Skriv adgangskode igen',
'password_forgot' => 'Glemt adgangskode?',
'password_reset' => 'Nulstil adgangskode',
'password_reset_email_subject' => 'Nulstil din adgangskode for PHP Server Monitor',
'password_reset_email_body' => 'Brug venligst følgende link for at nulstille din adgangskode. Bemærk det udløber på 1 time.<br/><br/>%link%',
'error_user_incorrect' => 'Det angivet brugernavn kunne ikke findes.',
'error_login_incorrect' => 'Oplysningerne stemmer ikke overens.',
'error_login_passwords_nomatch' => 'De angivet adgangskoder matcher ikke.',
'error_reset_invalid_link' => 'Følgende link er ugyldigt.',
'success_password_forgot' => 'En e-mail er blevet sendt til dig med oplysninger om, hvordan du nulstiller din adgangskode.',
'success_password_reset' => 'Dit password er blevet nulstillet. venligst log ind.',
),
);

View File

@ -35,17 +35,17 @@ $sm_lang = array(
'save' => 'Speichern',
'edit' => 'Bearbeiten',
'delete' => 'L&ouml;schen',
'deleted' => 'Eintrag wurde gel&ouml;scht',
'date' => 'Datum',
'message' => 'Meldung',
'yes' => 'Ja',
'no' => 'Nein',
'edit' => 'Bearbeiten',
'insert' => 'Einf&uuml;gen',
'add_new' => 'Neuen Eintrag erstellen',
'update_available' => 'Ein neues Update ({version}) ist verf&uuml;gbar auf <a href="http://www.phpservermonitor.org" target="_blank">http://www.phpservermonitor.org</a>.',
'back_to_top' => 'Back to top',
'go_back' => 'Go back',
'ok' => 'OK',
'cancel' => 'Cancel',
// date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php
'short_day_format' => '%B %e',
'long_day_format' => '%B %e, %Y',
@ -81,6 +81,9 @@ $sm_lang = array(
'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' => 'Mobil',
'email' => 'Email',
'delete_title' => 'Delete User',
'delete_message' => 'Are you sure you want to delete user \'%1\'?',
'deleted' => 'User deleted.',
'updated' => 'Benutzer bearbeitet.',
'inserted' => 'Benutzer eingetragen.',
'profile' => 'Profile',
@ -101,9 +104,11 @@ $sm_lang = array(
'status' => 'Status',
'email' => 'Email',
'sms' => 'SMS',
'no_logs' => 'No logs',
),
'servers' => array(
'server' => 'Server',
'status' => 'Status',
'label' => 'Beschriftung',
'domain' => 'Domain/IP',
'port' => 'Port',
@ -115,14 +120,21 @@ $sm_lang = array(
'last_check' => 'Letzter Check',
'last_online' => 'Letztes mal Online',
'monitoring' => 'Monitoring',
'no_monitoring' => 'No monitoring',
'email' => 'Email',
'send_email' => 'Email',
'sms' => 'SMS',
'send_sms' => 'SMS',
'delete_title' => 'Delete Server',
'delete_message' => 'Are you sure you want to delete server \'%1\'?',
'deleted' => 'Server deleted.',
'updated' => 'Server aktualisiert.',
'inserted' => 'Server eingetragen.',
'latency' => 'Antwortzeit',
'latency_max' => 'Latency (maximum)',
'latency_min' => 'Latency (minimum)',
'latency_avg' => 'Latency (average)',
'uptime' => 'Uptime',
'year' => 'Year',
'month' => 'Month',
'week' => 'Week',
@ -137,6 +149,13 @@ $sm_lang = array(
'chart_long_date_format' => '%d.%m.%Y %H:%M:%S',
'chart_short_date_format' => '%d.%m %H:%M',
'chart_short_time_format' => '%H:%M',
'error_server_no_match' => 'Server not found.',
'error_server_label_bad_length' => 'The label must be between 1 and 255 characters.',
'error_server_ip_bad_length' => 'The domain / IP must be between 1 and 255 characters.',
'error_server_ip_bad_service' => 'The IP address is not valid.',
'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.',
),
'config' => array(
'general' => 'General',
@ -159,6 +178,7 @@ $sm_lang = array(
'sms_gateway_inetworx' => 'Inetworx',
'sms_gateway_clickatell' => 'Clickatell',
'sms_gateway_textmarketer' => 'Textmarketer',
'sms_gateway_smsit' => 'Smsit',
'sms_gateway_username' => 'Gateway Benutzername',
'sms_gateway_password' => 'Gateway Passwort',
'sms_from' => 'SMS Sendernummer',
@ -180,6 +200,7 @@ $sm_lang = array(
'log_email' => 'Email Log per Script senden?',
'log_sms' => 'SMS Log per Script senden?',
'updated' => 'Die Einstellungen wurden gespeichert.',
'nochanges' => 'The configuration didn\'t change.',
'tab_email' => 'Email',
'tab_sms' => 'SMS',
'tab_log' => 'Log',
@ -194,6 +215,15 @@ $sm_lang = array(
'Time in seconds, if 0 the page won\'t refresh.'.
'</span>',
'seconds' => 'seconds',
'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.',
'send' => 'Send',
'test_message' => 'Test message',
'email_sent' => 'Email sent',
'email_error' => 'Error in email sending',
'sms_sent' => 'Sms sent',
'sms_error' => 'Error in sms sending',
),
// for newlines in the email messages use <br/>
'notifications' => array(

View File

@ -35,17 +35,17 @@ $sm_lang = array(
'save' => 'Save',
'edit' => 'Edit',
'delete' => 'Delete',
'deleted' => 'Record has been deleted',
'date' => 'Date',
'message' => 'Message',
'yes' => 'Yes',
'no' => 'No',
'edit' => 'Edit',
'insert' => 'Insert',
'add_new' => 'Add new',
'update_available' => 'A new version ({version}) is available from <a href="http://www.phpservermonitor.org" target="_blank">http://www.phpservermonitor.org</a>.',
'back_to_top' => 'Back to top',
'go_back' => 'Go back',
'ok' => 'OK',
'cancel' => 'Cancel',
// date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php
'short_day_format' => '%B %e',
'long_day_format' => '%B %e, %Y',
@ -69,7 +69,7 @@ $sm_lang = array(
'help' => 'Help',
),
'users' => array(
'user' => 'user',
'user' => 'User',
'name' => 'Name',
'user_name' => 'Username',
'password' => 'Password',
@ -81,6 +81,9 @@ $sm_lang = array(
'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',
'delete_title' => 'Delete User',
'delete_message' => 'Are you sure you want to delete user \'%1\'?',
'deleted' => 'User deleted.',
'updated' => 'User updated.',
'inserted' => 'User added.',
'profile' => 'Profile',
@ -101,9 +104,11 @@ $sm_lang = array(
'status' => 'Status',
'email' => 'Email',
'sms' => 'SMS',
'no_logs' => 'No logs',
),
'servers' => array(
'server' => 'Server',
'status' => 'Status',
'label' => 'Label',
'domain' => 'Domain/IP',
'port' => 'Port',
@ -115,14 +120,21 @@ $sm_lang = array(
'last_check' => 'Last check',
'last_online' => 'Last online',
'monitoring' => 'Monitoring',
'no_monitoring' => 'No monitoring',
'email' => 'Email',
'send_email' => 'Send Email',
'sms' => 'SMS',
'send_sms' => 'Send SMS',
'delete_title' => 'Delete Server',
'delete_message' => 'Are you sure you want to delete server \'%1\'?',
'deleted' => 'Server deleted.',
'updated' => 'Server updated.',
'inserted' => 'Server added.',
'latency' => 'Latency',
'latency_max' => 'Latency (maximum)',
'latency_min' => 'Latency (minimum)',
'latency_avg' => 'Latency (average)',
'uptime' => 'Uptime',
'year' => 'Year',
'month' => 'Month',
'week' => 'Week',
@ -137,6 +149,13 @@ $sm_lang = array(
'chart_long_date_format' => '%Y-%m-%d %H:%M:%S',
'chart_short_date_format' => '%m/%d %H:%M',
'chart_short_time_format' => '%H:%M',
'error_server_no_match' => 'Server not found.',
'error_server_label_bad_length' => 'The label must be between 1 and 255 characters.',
'error_server_ip_bad_length' => 'The domain / IP must be between 1 and 255 characters.',
'error_server_ip_bad_service' => 'The IP address is not valid.',
'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.',
),
'config' => array(
'general' => 'General',
@ -158,21 +177,22 @@ $sm_lang = array(
'sms_gateway_spryng' => 'Spryng',
'sms_gateway_inetworx' => 'Inetworx',
'sms_gateway_clickatell' => 'Clickatell',
'sms_gateway_textmarketer' => 'Textmarketer',
'sms_gateway_textmarketer' => 'Textmarketer',
'sms_gateway_smsglobal' => 'SMSGlobal',
'sms_gateway_smsit' => 'Smsit',
'sms_gateway_username' => 'Gateway username',
'sms_gateway_password' => 'Gateway password',
'sms_from' => 'Sender\'s phone number',
'alert_type' => 'Select when you\'d like to be notified.<br/>',
'alert_type_description' => '<b>Status change:</b> '.
'You will receive a notifcation when a server has a change in status. So from online -> offline or offline -> online.<br/>'.
'<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 mins and your server goes down at 1 am and stays down till 6 am. '.
'You will get 1 notification at 1 am and thats 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 notifcation 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 mins and your server goes down at 1 am and stays down till 6 am. '.
'You will get 1 notification at 1 am and thats 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',
@ -181,6 +201,7 @@ $sm_lang = array(
'log_email' => 'Log emails sent by the script',
'log_sms' => 'Log text messages sent by the script',
'updated' => 'The configuration has been updated.',
'nochanges' => 'The configuration didn\'t change.',
'tab_email' => 'Email',
'tab_sms' => 'SMS',
'tab_log' => 'Log',
@ -195,6 +216,15 @@ $sm_lang = array(
'Time in seconds, if 0 the page won\'t refresh.'.
'</span>',
'seconds' => 'seconds',
'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.',
'send' => 'Send',
'test_message' => 'Test message',
'email_sent' => 'Email sent',
'email_error' => 'Error in email sending',
'sms_sent' => 'Sms sent',
'sms_error' => 'Error in sms sending',
),
// for newlines in the email messages use <br/>
'notifications' => array(

View File

@ -35,17 +35,17 @@ $sm_lang = array(
'save' => 'Guardar',
'edit' => 'Modificar',
'delete' => 'Eliminar',
'deleted' => 'Registro eliminado',
'date' => 'Fecha',
'message' => 'Mensaje',
'yes' => 'Si',
'no' => 'No',
'edit' => 'Modificar',
'insert' => 'Insertar',
'add_new' => 'Agregar nuevo',
'update_available' => 'Hay una nueva versión ({version}) disponible en <a href="http://www.phpservermonitor.org" target="_blank">http://www.phpservermonitor.org</a>.',
'back_to_top' => 'Back to top',
'go_back' => 'Go back',
'ok' => 'OK',
'cancel' => 'Cancel',
// date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php
'short_day_format' => '%B %e',
'long_day_format' => '%B %e, %Y',
@ -81,6 +81,9 @@ $sm_lang = array(
'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' => 'Mobil',
'email' => 'Email',
'delete_title' => 'Delete User',
'delete_message' => 'Are you sure you want to delete user \'%1\'?',
'deleted' => 'User deleted.',
'updated' => 'Usuario actualizado.',
'inserted' => 'Usuario ingresado.',
'profile' => 'Profile',
@ -101,9 +104,11 @@ $sm_lang = array(
'status' => 'Estado',
'email' => 'Email',
'sms' => 'SMS',
'no_logs' => 'No logs',
),
'servers' => array(
'server' => 'Servidores',
'status' => 'Status',
'label' => 'Titulo',
'domain' => 'Domain/IP',
'port' => 'Port',
@ -115,8 +120,14 @@ $sm_lang = array(
'last_check' => 'Ultima verificación',
'last_online' => 'Última vez en línea',
'monitoring' => 'Monitoreo',
'no_monitoring' => 'No monitoring',
'email' => 'Email',
'send_email' => 'Email',
'sms' => 'SMS',
'send_sms' => 'SMS',
'delete_title' => 'Delete Server',
'delete_message' => 'Are you sure you want to delete server \'%1\'?',
'deleted' => 'Server deleted.',
'updated' => 'Servidor arctualizado.',
'inserted' => 'Servidor ingresado.',
'latency' => 'Tiempo de respuesta',
@ -137,6 +148,13 @@ $sm_lang = array(
'chart_long_date_format' => '%Y-%m-%d %H:%M:%S',
'chart_short_date_format' => '%m/%d %H:%M',
'chart_short_time_format' => '%H:%M',
'error_server_no_match' => 'Server not found.',
'error_server_label_bad_length' => 'The label must be between 1 and 255 characters.',
'error_server_ip_bad_length' => 'The domain / IP must be between 1 and 255 characters.',
'error_server_ip_bad_service' => 'The IP address is not valid.',
'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.',
),
'config' => array(
'general' => 'General',
@ -159,6 +177,7 @@ $sm_lang = array(
'sms_gateway_inetworx' => 'Inetworx',
'sms_gateway_clickatell' => 'Clickatell',
'sms_gateway_textmarketer' => 'Textmarketer',
'sms_gateway_smsit' => 'Smsit',
'sms_gateway_username' => 'Gateway username',
'sms_gateway_password' => 'Gateway password',
'sms_from' => 'Número origen del SMS',
@ -179,6 +198,7 @@ $sm_lang = array(
'log_email' => 'Enviar Log via email?',
'log_sms' => 'Enviar Log via SMS ?',
'updated' => 'Configuración guardada.',
'nochanges' => 'The configuration didn\'t change.',
'tab_email' => 'Email',
'tab_sms' => 'SMS',
'tab_log' => 'Log',
@ -193,6 +213,15 @@ $sm_lang = array(
'Tiempo en segundos, indicar "0" para no actualizar.'.
'</span>',
'seconds' => 'seconds',
'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.',
'send' => 'Send',
'test_message' => 'Test message',
'email_sent' => 'Email sent',
'email_error' => 'Error in email sending',
'sms_sent' => 'Sms sent',
'sms_error' => 'Error in sms sending',
),
// for newlines in the email messages use <br/>
'notifications' => array(

View File

@ -35,17 +35,17 @@ $sm_lang = array(
'save' => 'Enregistrer',
'edit' => 'Editer',
'delete' => 'Supprimer',
'deleted' => 'L\'enregistrement a été supprimé',
'date' => 'Date',
'message' => 'Message',
'yes' => 'Oui',
'no' => 'Non',
'edit' => 'Editer',
'insert' => 'Nouveau',
'add_new' => 'Nouveau',
'update_available' => 'Une nouvelle version ({version}) est disponible à l\'adresse <a href="http://www.phpservermonitor.org" target="_blank">http://www.phpservermonitor.org</a>.',
'back_to_top' => 'Haut de page',
'go_back' => 'Retour',
'ok' => 'OK',
'cancel' => 'Annuler',
// date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php
'short_day_format' => 'Le %e %B',
'long_day_format' => 'Le %e %B %Y',
@ -79,8 +79,11 @@ $sm_lang = array(
'level_10' => 'Administrateur',
'level_20' => 'Utilisateur',
'level_description' => 'Les <b>Administrateurs</b> ont un accès total. Ils peuvent gérer les serveurs, les utilisateurs et éditer la configuration globale.<br/>Les <b>Utilisateurs</b> ne peuvent que voir et mettre à jour les serveurs qui leur ont été assignés.',
'mobile' => 'Numéro de téléphone',
'mobile' => 'Téléphone',
'email' => 'Email',
'delete_title' => 'Supprimer un utilisateur',
'delete_message' => 'Êtes-vous sûr de vouloir supprimer l\'utilisateur \'%1\' ?',
'deleted' => 'Utilisateur supprimé.',
'updated' => 'Utilisateur mis à jour.',
'inserted' => 'Utilisateur ajouté.',
'profile' => 'Profil',
@ -101,10 +104,12 @@ $sm_lang = array(
'status' => 'État',
'email' => 'email',
'sms' => 'SMS',
'no_logs' => 'Aucun événement',
),
'servers' => array(
'server' => 'Serveur',
'label' => 'Description',
'status' => 'État',
'label' => 'Nom',
'domain' => 'Domaine/IP',
'port' => 'Port',
'type' => 'Type',
@ -115,14 +120,21 @@ $sm_lang = array(
'last_check' => 'Dernière vérification',
'last_online' => 'Dernière fois OK',
'monitoring' => 'Serveillé',
'no_monitoring' => 'Non serveillé',
'email' => 'Email',
'send_email' => 'Envoyer un email',
'sms' => 'SMS',
'send_sms' => 'Envoyer un SMS',
'delete_title' => 'Supprimer un serveur',
'delete_message' => 'Êtes-vous sûr de vouloir supprimer le serveur \'%1\' ?',
'deleted' => 'Serveur supprimé.',
'updated' => 'Serveur mis à jour.',
'inserted' => 'Serveur ajouté.',
'latency' => 'Temps de réponse',
'latency_max' => 'Temps de réponse maximum',
'latency_min' => 'Temps de réponse minimum',
'latency_avg' => 'Temps de réponse moyen',
'uptime' => 'Uptime',
'year' => 'Année',
'month' => 'Mois',
'week' => 'Semaine',
@ -137,6 +149,13 @@ $sm_lang = array(
'chart_long_date_format' => '%d/%m/%Y %H:%M:%S',
'chart_short_date_format' => '%d/%m %H:%M',
'chart_short_time_format' => '%H:%M',
'error_server_no_match' => 'Serveur non trouvé.',
'error_server_label_bad_length' => 'Le nom doit avoir entre 1 et 255 caractères.',
'error_server_ip_bad_length' => 'Domaine/IP doit avoir entre 1 et 255 caractères.',
'error_server_ip_bad_service' => 'L\'adresse IP n\'est pas valide.',
'error_server_ip_bad_website' => 'L\'URL du site web n\'est pas valide.',
'error_server_type_invalid' => 'Le type de service sélectionné n\'est pas valide.',
'error_server_warning_threshold_invalid' => 'Le seuil d\'alerte doit être un nombre entier supérieur à 0.',
),
'config' => array(
'general' => 'Général',
@ -159,6 +178,7 @@ $sm_lang = array(
'sms_gateway_inetworx' => 'Inetworx',
'sms_gateway_clickatell' => 'Clickatell',
'sms_gateway_textmarketer' => 'Textmarketer',
'sms_gateway_smsit' => 'Smsit',
'sms_gateway_username' => 'Nom utilisateur de la passerelle',
'sms_gateway_password' => 'Mot de passe de la passerelle',
'sms_from' => 'SMS de l\'expéditeur',
@ -179,6 +199,7 @@ $sm_lang = array(
'log_email' => 'Enregistrer tout les emails envoyés',
'log_sms' => 'Enregistrer tout les SMS envoyés',
'updated' => 'La configuration a été mise à jour.',
'nochanges' => 'La configuration n\'a pas été modifiée.',
'tab_email' => 'Email',
'tab_sms' => 'SMS',
'tab_log' => 'Événements',
@ -193,6 +214,15 @@ $sm_lang = array(
'Temps en secondes. Si 0, la page n\'est pas rafraîchie.'.
'</span>',
'seconds' => 'secondes',
'test' => 'Tester',
'test_email' => 'Un email va vous être envoyé à l\'adresse définie dans votre profil utilisateur.',
'test_sms' => 'Un SMS va vous être envoyé au numéro défini dans votre profil utilisateur.',
'send' => 'Envoyer',
'test_message' => 'Message de test',
'email_sent' => 'Email envoyé',
'email_error' => 'Erreur lors de l\'envoie de l\'email',
'sms_sent' => 'Sms envoyé',
'sms_error' => 'Erreur lors de l\'envoie du sms',
),
// for newlines in the email messages use <br/>
'notifications' => array(

View File

@ -35,17 +35,17 @@ $sm_lang = array(
'save' => 'Salva',
'edit' => 'Modifica',
'delete' => 'Elimina',
'deleted' => 'L\'oggetto è stato eliminato',
'date' => 'Data',
'message' => 'Messaggio',
'yes' => 'Sì',
'no' => 'No',
'edit' => 'Modifica',
'insert' => 'Inserisci',
'add_new' => 'Aggiungi Nuovo?',
'update_available' => 'Un nuovo aggiornamento ({version}) è disponibile su <a href="http://www.phpservermonitor.org" target="_blank">http://www.phpservermonitor.org</a>.',
'back_to_top' => 'Back to top',
'go_back' => 'Go back',
'ok' => 'OK',
'cancel' => 'Cancel',
// date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php
'short_day_format' => '%B %e',
'long_day_format' => '%B %e, %Y',
@ -69,7 +69,7 @@ $sm_lang = array(
'help' => 'Aiuto',
),
'users' => array(
'user' => 'utente',
'user' => 'Utente',
'name' => 'Nome',
'user_name' => 'Username',
'password' => 'Password',
@ -81,6 +81,9 @@ $sm_lang = array(
'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' => 'Cellulare',
'email' => 'Email',
'delete_title' => 'Delete User',
'delete_message' => 'Are you sure you want to delete user \'%1\'?',
'deleted' => 'User deleted.',
'updated' => 'Utente aggiornato.',
'inserted' => 'Utente aggiunto.',
'profile' => 'Profile',
@ -101,9 +104,11 @@ $sm_lang = array(
'status' => 'Stato',
'email' => 'Email',
'sms' => 'SMS',
'no_logs' => 'No logs',
),
'servers' => array(
'server' => 'Server',
'status' => 'Status',
'label' => 'Nome',
'domain' => 'Dominio/IP',
'port' => 'Porta',
@ -115,8 +120,14 @@ $sm_lang = array(
'last_check' => 'Ultimo Controllo',
'last_online' => 'Ultima volta Online',
'monitoring' => 'Sotto Controllo',
'no_monitoring' => 'No monitoring',
'email' => 'Email',
'send_email' => 'Invia Email',
'sms' => 'SMS',
'send_sms' => 'Invia SMS',
'delete_title' => 'Delete Server',
'delete_message' => 'Are you sure you want to delete server \'%1\'?',
'deleted' => 'Server deleted.',
'updated' => 'Server aggiornato.',
'inserted' => 'Server aggiunto.',
'latency' => 'Tempo di risposta',
@ -137,6 +148,13 @@ $sm_lang = array(
'chart_long_date_format' => '%Y-%m-%d %H:%M:%S',
'chart_short_date_format' => '%m/%d %H:%M',
'chart_short_time_format' => '%H:%M',
'error_server_no_match' => 'Server not found.',
'error_server_label_bad_length' => 'The label must be between 1 and 255 characters.',
'error_server_ip_bad_length' => 'The domain / IP must be between 1 and 255 characters.',
'error_server_ip_bad_service' => 'The IP address is not valid.',
'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.',
),
'config' => array(
'general' => 'Generale',
@ -159,6 +177,7 @@ $sm_lang = array(
'sms_gateway_inetworx' => 'Inetworx',
'sms_gateway_clickatell' => 'Clickatell',
'sms_gateway_textmarketer' => 'Textmarketer',
'sms_gateway_smsit' => 'Smsit',
'sms_gateway_username' => 'Nome Utente Gateway',
'sms_gateway_password' => 'Password Gateway',
'sms_from' => 'Numero di telefono del mittente',
@ -179,6 +198,7 @@ $sm_lang = array(
'log_email' => 'Registra email inviate dallo script.',
'log_sms' => 'Registra SMS inviati dallo script.',
'updated' => 'La configurazione è stato aggiornata.',
'nochanges' => 'The configuration didn\'t change.',
'tab_email' => 'Email',
'tab_sms' => 'SMS',
'tab_log' => 'Log',
@ -193,6 +213,15 @@ $sm_lang = array(
'Tempo in secondi, se impostato a 0 la pagina non si aggiornerà.'.
'</span>',
'seconds' => 'seconds',
'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.',
'send' => 'Send',
'test_message' => 'Test message',
'email_sent' => 'Email sent',
'email_error' => 'Error in email sending',
'sms_sent' => 'Sms sent',
'sms_error' => 'Error in sms sending',
),
// for newlines in the email messages use <br/>
'notifications' => array(

View File

@ -35,17 +35,17 @@ $sm_lang = array(
'save' => '저장',
'edit' => '수정',
'delete' => '삭제',
'deleted' => '삭제되었습니다.',
'date' => '날짜',
'message' => '메세지',
'yes' => '예',
'no' => '아니오',
'edit' => '수정',
'insert' => '삽입',
'add_new' => '새계정 추가',
'update_available' => '새로운 업데이트가 있습니다 ({version}). 다음사이트를 방문 해 주십시오. <a href="http://www.phpservermonitor.org" target="_blank">http://www.phpservermonitor.org</a>.',
'back_to_top' => 'Back to top',
'go_back' => 'Go back',
'ok' => 'OK',
'cancel' => 'Cancel',
// date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php
'short_day_format' => '%B %e',
'long_day_format' => '%B %e, %Y',
@ -81,6 +81,9 @@ $sm_lang = array(
'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' => '휴대폰',
'email' => 'Email',
'delete_title' => 'Delete User',
'delete_message' => 'Are you sure you want to delete user \'%1\'?',
'deleted' => 'User deleted.',
'updated' => '수정되었습니다.',
'inserted' => '추가되었습니다.',
'profile' => 'Profile',
@ -101,9 +104,11 @@ $sm_lang = array(
'status' => '상태',
'email' => 'email',
'sms' => 'sms',
'no_logs' => 'No logs',
),
'servers' => array(
'server' => '서버',
'status' => 'Status',
'label' => 'Label',
'domain' => 'Domain/IP',
'port' => 'Port',
@ -115,14 +120,21 @@ $sm_lang = array(
'last_check' => '최근체크',
'last_online' => '최근접속',
'monitoring' => '확인중',
'no_monitoring' => 'No monitoring',
'email' => '메일 전송',
'send_email' => '메일 전송',
'sms' => 'SMS 전송',
'send_sms' => 'SMS 전송',
'delete_title' => 'Delete Server',
'delete_message' => 'Are you sure you want to delete server \'%1\'?',
'deleted' => 'Server deleted.',
'updated' => '서버가 수정되었습니다.',
'inserted' => '서버가 추가되었습니다.',
'latency' => '응답',
'latency_max' => 'Latency (maximum)',
'latency_min' => 'Latency (minimum)',
'latency_avg' => 'Latency (average)',
'uptime' => 'Uptime',
'year' => 'Year',
'month' => 'Month',
'week' => 'Week',
@ -137,6 +149,13 @@ $sm_lang = array(
'chart_long_date_format' => '%Y-%m-%d %H:%M:%S',
'chart_short_date_format' => '%m/%d %H:%M',
'chart_short_time_format' => '%H:%M',
'error_server_no_match' => 'Server not found.',
'error_server_label_bad_length' => 'The label must be between 1 and 255 characters.',
'error_server_ip_bad_length' => 'The domain / IP must be between 1 and 255 characters.',
'error_server_ip_bad_service' => 'The IP address is not valid.',
'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.',
),
'config' => array(
'general' => '일반',
@ -158,6 +177,7 @@ $sm_lang = array(
'sms_gateway_spryng' => 'Spryng',
'sms_gateway_inetworx' => 'Inetworx',
'sms_gateway_clickatell' => 'Clickatell',
'sms_gateway_smsit' => 'Smsit',
'sms_gateway_textmarketer' => 'Textmarketer',
'sms_gateway_username' => 'Gateway username',
'sms_gateway_password' => 'Gateway password',
@ -178,6 +198,7 @@ $sm_lang = array(
'log_email' => '이메일로 로그를 전송하시겠습니까?',
'log_sms' => 'SMS로 로그를 전송하시겠습니까?',
'updated' => '설정이 수정되었습니다.',
'nochanges' => 'The configuration didn\'t change.',
'tab_email' => 'Email',
'tab_sms' => 'SMS',
'tab_log' => '로그',
@ -192,6 +213,15 @@ $sm_lang = array(
'시간은 초(sec)로 설정을 하고, 0은 새로고침을 하지 않습니다.'.
'</span>',
'seconds' => 'seconds',
'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.',
'send' => 'Send',
'test_message' => 'Test message',
'email_sent' => 'Email sent',
'email_error' => 'Error in email sending',
'sms_sent' => 'Sms sent',
'sms_error' => 'Error in sms sending',
),
// for newlines in the email messages use <br/>
'notifications' => array(

View File

@ -35,17 +35,17 @@ $sm_lang = array(
'save' => 'Opslaan',
'edit' => 'Wijzig',
'delete' => 'Verwijder',
'deleted' => 'Record is verwijderd',
'date' => 'Datum',
'message' => 'Bericht',
'yes' => 'Ja',
'no' => 'Nee',
'edit' => 'Wijzig',
'insert' => 'Voeg toe',
'add_new' => 'Voeg toe',
'update_available' => 'Een nieuwe update ({version}) is beschikbaar op <a href="http://www.phpservermonitor.org" target="_blank">http://www.phpservermonitor.org</a>.',
'back_to_top' => 'Terug naar boven',
'go_back' => 'Terug',
'ok' => 'OK',
'cancel' => 'Cancel',
// date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php
'short_day_format' => '%B %e',
'long_day_format' => '%B %e, %Y',
@ -69,7 +69,7 @@ $sm_lang = array(
'help' => 'Help',
),
'users' => array(
'user' => 'gebruiker',
'user' => 'Gebruiker',
'name' => 'Naam',
'user_name' => 'Gebruikersnaam',
'password' => 'Wachtwoord',
@ -81,6 +81,9 @@ $sm_lang = array(
'level_description' => '<b>Beheerders</b> hebben volledige toegang: ze kunnen servers en gebruiker beheren en de globale configuratie aanpassen.<br/><b>Gebruikers</b> kunnen alleen de servers bekijken en op fouten testen die aan hun zijn toegewezen.',
'mobile' => 'Mobiel',
'email' => 'Email',
'delete_title' => 'Delete User',
'delete_message' => 'Are you sure you want to delete user \'%1\'?',
'deleted' => 'User deleted.',
'updated' => 'Gebruiker gewijzigd.',
'inserted' => 'Gebruiker toegevoegd.',
'profile' => 'Profiel',
@ -101,9 +104,11 @@ $sm_lang = array(
'status' => 'Status',
'email' => 'Email',
'sms' => 'SMS',
'no_logs' => 'No logs',
),
'servers' => array(
'server' => 'Server',
'status' => 'Status',
'label' => 'Label',
'domain' => 'Domein/IP',
'port' => 'Poort',
@ -115,14 +120,21 @@ $sm_lang = array(
'last_check' => 'Laatst gecontroleerd',
'last_online' => 'Laatst online',
'monitoring' => 'Monitoring',
'no_monitoring' => 'No monitoring',
'email' => 'Email',
'send_email' => 'Stuur email',
'sms' => 'SMS',
'send_sms' => 'Stuur SMS',
'delete_title' => 'Delete Server',
'delete_message' => 'Are you sure you want to delete server \'%1\'?',
'deleted' => 'Server deleted.',
'updated' => 'Server gewijzigd.',
'inserted' => 'Server toegevoegd.',
'latency' => 'Response tijd',
'latency_max' => 'Latency (maximum)',
'latency_min' => 'Latency (minimum)',
'latency_avg' => 'Latency (gemiddeld)',
'uptime' => 'Uptime',
'year' => 'Jaar',
'month' => 'Maand',
'week' => 'Week',
@ -137,6 +149,13 @@ $sm_lang = array(
'chart_long_date_format' => '%d-%m-%Y %H:%M:%S',
'chart_short_date_format' => '%d-%m %H:%M',
'chart_short_time_format' => '%H:%M',
'error_server_no_match' => 'Server niet gevonden.',
'error_server_label_bad_length' => 'Het label moet tussen de 1 en 255 karakters lang zijn.',
'error_server_ip_bad_length' => 'Het domein / IP moet tussen de 1 en 255 karakters lang zijn.',
'error_server_ip_bad_service' => 'Het IP adres is ongeldig.',
'error_server_ip_bad_website' => 'De website URL is ongeldig.',
'error_server_type_invalid' => 'Het geselecteerde server type is ongeldig.',
'error_server_warning_threshold_invalid' => 'De warning threshold moet een numerieke waarde zijn groter dan 0.',
),
'config' => array(
'general' => 'Algemeen',
@ -159,6 +178,7 @@ $sm_lang = array(
'sms_gateway_inetworx' => 'Inetworx',
'sms_gateway_clickatell' => 'Clickatell',
'sms_gateway_textmarketer' => 'Textmarketer',
'sms_gateway_smsit' => 'Smsit',
'sms_gateway_username' => 'Gateway gebruikersnaam',
'sms_gateway_password' => 'Gateway wachtwoord',
'sms_from' => 'Telefoonnummer afzender',
@ -179,6 +199,7 @@ $sm_lang = array(
'log_email' => 'Log emails verstuurd bij het script?',
'log_sms' => 'Log sms berichten verstuurd bij het script?',
'updated' => 'De configuratie is gewijzigd.',
'nochanges' => 'The configuration didn\'t change.',
'tab_email' => 'Email',
'tab_sms' => 'SMS',
'tab_log' => 'Log',
@ -192,7 +213,16 @@ $sm_lang = array(
'<span class="small">'.
'Tijd in seconden, als de tijd 0 is wordt de pagina niet ververst.'.
'</span>',
'seconds' => 'seconds',
'seconds' => 'seconden',
'test' => 'Test',
'test_email' => 'Er zal een email verstuurd worden naar het email adres in je profiel.',
'test_sms' => 'Er zal een SMS verstuurd worden naar het telefoonnummer in je profiel.',
'send' => 'Verstuur',
'test_message' => 'Test bericht',
'email_sent' => 'Email verzonden',
'email_error' => 'Er is een fout opgetreden tijdens het verzenden',
'sms_sent' => 'SMS verzonden',
'sms_error' => 'Er is een fout opgetreden tijdens het verzenden',
),
// for newlines in the email messages use <br/>
'notifications' => array(

View File

@ -35,17 +35,17 @@ $sm_lang = array(
'save' => 'Salvar',
'edit' => 'Editar',
'delete' => 'Excluir',
'deleted' => 'Registro excluído',
'date' => 'Data',
'message' => 'Mensagem',
'yes' => 'Sim',
'no' => 'Não',
'edit' => 'Editar',
'insert' => 'Inserir',
'add_new' => 'Adicionar novo',
'update_available' => 'Uma atualização ({version}) disponível em <a href="http://www.phpservermonitor.org" target="_blank">http://www.phpservermonitor.org</a>.',
'back_to_top' => 'Voltar ao topo',
'go_back' => 'Voltar',
'ok' => 'OK',
'cancel' => 'Cancel',
// date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php
'short_day_format' => '%e %m',
'long_day_format' => '%e/%m/%Y',
@ -69,7 +69,7 @@ $sm_lang = array(
'help' => 'Ajuda',
),
'users' => array(
'user' => 'usuário',
'user' => 'Usuário',
'name' => 'Nome',
'user_name' => 'Username',
'password' => 'Senha',
@ -81,6 +81,9 @@ $sm_lang = array(
'level_description' => '<b>Administradores</b> Tem total acesso: podem gerenciar servidores, usuários e configurações globais.<br/><b>Usuários</b> só podem executar atualizações para servidores que lhe foram atribuídos.',
'mobile' => 'Celular',
'email' => 'Email',
'delete_title' => 'Delete User',
'delete_message' => 'Are you sure you want to delete user \'%1\'?',
'deleted' => 'User deleted.',
'updated' => 'Usuário atualizado.',
'inserted' => 'Usuário adicionado.',
'profile' => 'Perfil',
@ -101,9 +104,11 @@ $sm_lang = array(
'status' => 'Status',
'email' => 'Email',
'sms' => 'SMS',
'no_logs' => 'No logs',
),
'servers' => array(
'server' => 'Servidor',
'status' => 'Status',
'label' => 'Etiqueta',
'domain' => 'Domínio/IP',
'port' => 'Porta',
@ -115,14 +120,21 @@ $sm_lang = array(
'last_check' => 'Última verificação',
'last_online' => 'Última vez online',
'monitoring' => 'Monitoramento',
'no_monitoring' => 'No monitoring',
'email' => 'Email',
'send_email' => 'Enviar Email',
'sms' => 'SMS',
'send_sms' => 'Enviar SMS',
'delete_title' => 'Delete Server',
'delete_message' => 'Are you sure you want to delete server \'%1\'?',
'deleted' => 'Server deleted.',
'updated' => 'Servidor atualizado.',
'inserted' => 'Servidor adicionar.',
'latency' => 'Tempo de resposta',
'latency_max' => 'Latência (máxima)',
'latency_min' => 'Latência (minima)',
'latency_avg' => 'Latência (média)',
'uptime' => 'Uptime',
'year' => 'Ano',
'month' => 'Mês',
'week' => 'Semana',
@ -137,6 +149,13 @@ $sm_lang = array(
'chart_long_date_format' => '%d/%m/%Y %H:%M:%S',
'chart_short_date_format' => '%d/%m %H:%M',
'chart_short_time_format' => '%H:%M',
'error_server_no_match' => 'Server not found.',
'error_server_label_bad_length' => 'The label must be between 1 and 255 characters.',
'error_server_ip_bad_length' => 'The domain / IP must be between 1 and 255 characters.',
'error_server_ip_bad_service' => 'The IP address is not valid.',
'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.',
),
'config' => array(
'general' => 'Geral',
@ -159,6 +178,7 @@ $sm_lang = array(
'sms_gateway_inetworx' => 'Inetworx',
'sms_gateway_clickatell' => 'Clickatell',
'sms_gateway_textmarketer' => 'Textmarketer',
'sms_gateway_smsit' => 'Smsit',
'sms_gateway_username' => 'Usuário do Gateway',
'sms_gateway_password' => 'Senha do Gateway',
'sms_from' => 'Número de telefone de envio',
@ -180,6 +200,7 @@ $sm_lang = array(
'log_email' => 'Registrar no Log os envios de email feitos pelo script?',
'log_sms' => 'Registrar no Log os envios de mensagens de texto feitos pelo script?',
'updated' => 'A configuração foi atualizada.',
'nochanges' => 'The configuration didn\'t change.',
'tab_email' => 'Email',
'tab_sms' => 'Texto',
'tab_log' => 'Logs',
@ -194,6 +215,15 @@ $sm_lang = array(
'Tempo em segundos, Se 0 a página não será atualizada.'.
'</span>',
'seconds' => 'segundos',
'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.',
'send' => 'Send',
'test_message' => 'Test message',
'email_sent' => 'Email sent',
'email_error' => 'Error in email sending',
'sms_sent' => 'Sms sent',
'sms_error' => 'Error in sms sending',
),
// for newlines in the email messages use <br/>
'notifications' => array(

260
src/lang/ru_RU.lang.php Normal file
View File

@ -0,0 +1,260 @@
<?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 Roman Beylin <roman.beylin@yandex.ru>
* @copyright Copyright (c) 2008-2014 Pepijn Over <pep@neanderthal-technology.com>
* @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3
* @version Release: @package_version@
* @link http://www.phpservermonitor.org/
**/
$sm_lang = array(
'name' => 'Russian - Русский',
'locale' => array('ru_RU.UTF-8', 'ru_RU', 'russian', 'russian'),
'system' => array(
'title' => 'Сервер Мониторинг',
'install' => 'Установка',
'action' => 'Действие',
'save' => 'Сохранить',
'edit' => 'Редактировать',
'delete' => 'Удалить',
'date' => 'Дата',
'message' => 'Сообщение',
'yes' => 'Да',
'no' => 'Нет',
'insert' => 'Добавить',
'add_new' => 'Добавить новый',
'update_available' => 'Новая версия ({version}) доступна по адресу <a href="http://www.phpservermonitor.org" target="_blank">http://www.phpservermonitor.org</a>.',
'back_to_top' => 'Вернуться к началу',
'go_back' => 'Вернуться',
'ok' => 'OK',
'cancel' => 'Отмена',
// date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php
'short_day_format' => '%e %B',
'long_day_format' => '%e %B %Y',
'yesterday_format' => 'Вчера at %k:%M',
'other_day_format' => '%A at %k:%M',
'never' => 'Никогда',
'hours_ago' => '%d часов назад',
'an_hour_ago' => 'час назад',
'minutes_ago' => '%d минут назад',
'a_minute_ago' => 'минуту назад',
'seconds_ago' => '%d секунд назад',
'a_second_ago' => 'секунду назад',
),
'menu' => array(
'config' => 'Параметры',
'server' => 'Серверы',
'server_log' => 'Лог',
'server_status' => 'Статус',
'server_update' => 'Обновить',
'user' => 'Пользователи',
'help' => 'Помощь',
),
'users' => array(
'user' => 'Пользователь',
'name' => 'Имя пользователя',
'user_name' => 'Логин',
'password' => 'Пароль',
'password_repeat' => 'Повтор пароля',
'password_leave_blank' => 'Оставить пустом, если не изменять',
'level' => 'Уровень',
'level_10' => 'Администратор',
'level_20' => 'Пользователь',
'level_description' => '<b>Администраторы</b> имеют полный доступ: они могут управлять серверами, пользователями и изменять общую конфигурацию.<br/><b>Пользователи</b> могут только просматривать и запускать проверку для серверов которые были к ним прикрепплены.',
'mobile' => 'Телефон',
'email' => 'Email',
'delete_title' => 'Удалить пользователя',
'delete_message' => 'Вы точно хотите удалить пользователя \'%1\'?',
'deleted' => 'Пользователь удален.',
'updated' => 'Пользователь обновлен.',
'inserted' => 'Пользователь добавлен.',
'profile' => 'Профиль',
'profile_updated' => 'Ваш профиль был обновлен.',
'error_user_name_bad_length' => 'Логин должен содержать от 2 до 64 знаков.',
'error_user_name_invalid' => 'Имя пользователя может содержать только латинские символы (a-z, A-Z), цифры (0-9) и подчеркивание (_).',
'error_user_name_exists' => 'Данный логин уже существует.',
'error_user_email_bad_length' => 'Email адрес может содержать от 5 до 255 знаков.',
'error_user_email_invalid' => 'Email адрес указан не корректно.',
'error_user_level_invalid' => 'Данный уровень пользователя не является корректным.',
'error_user_no_match' => 'Данного пользователя нет в базе данных.',
'error_user_password_invalid' => 'Пароль указан не верно.',
'error_user_password_no_match' => 'Повтор пароля не совпадает.',
),
'log' => array(
'title' => 'Запись',
'type' => 'Тип',
'status' => 'Статус',
'email' => 'Email',
'sms' => 'SMS',
'no_logs' => 'Записей нет',
),
'servers' => array(
'server' => 'Сервер',
'status' => 'Статус',
'label' => 'Лейбл',
'domain' => 'Домен/IP',
'port' => 'Порт',
'type' => 'Тип',
'type_website' => 'Веб-сайт',
'type_service' => 'Сервис',
'pattern' => 'Искать текст/шаблон',
'pattern_description' => 'Если текст по шаблону не найден на сайте, сервер будет помечен как Оффлайн. Регулярные выражения допустимы.',
'last_check' => 'Последняя проверка',
'last_online' => 'Был онлайн',
'monitoring' => 'Мониторинг',
'no_monitoring' => 'Нет мониторинга',
'email' => 'Email',
'send_email' => 'Отправить Email',
'sms' => 'SMS',
'send_sms' => 'Отправить SMS',
'delete_title' => 'Удалить сервер',
'delete_message' => 'Вы точно хотите удалить сервер \'%1\'?',
'deleted' => 'Сервер удален.',
'updated' => 'Сервер обновлен.',
'inserted' => 'Север добавлен.',
'latency' => 'Задержка',
'latency_max' => 'Задержка (максимальная)',
'latency_min' => 'Задержка (минимальная)',
'latency_avg' => 'Задержка (средняя)',
'uptime' => 'Аптайм',
'year' => 'Год',
'month' => 'Месяц',
'week' => 'Неделя',
'day' => 'День',
'hour' => 'Час',
'warning_threshold' => 'Порог предупреждения',
'warning_threshold_description' => 'Количество неудачных проверок, требуемых перед тем как сервер будет помечен как Оффлайн.',
'chart_last_week' => 'Прошлая неделя',
'chart_history' => 'История',
// Charts date format according jqPlot date format http://www.jqplot.com/docs/files/plugins/jqplot-dateAxisRenderer-js.html
'chart_day_format' => '%d-%m-%Y',
'chart_long_date_format' => '%d-%m-%Y %H:%M:%S',
'chart_short_date_format' => '%d/%m %H:%M',
'chart_short_time_format' => '%H:%M',
'error_server_no_match' => 'Сервер не найден.',
'error_server_label_bad_length' => 'Лейбл должен содержать от 1 до 255 знака.',
'error_server_ip_bad_length' => 'Домен/IP должен содержать от 1 до 255 знаков',
'error_server_ip_bad_service' => 'IP-адрес не корректен.',
'error_server_ip_bad_website' => 'Ссылка веб-страницы не корректна.',
'error_server_type_invalid' => 'Выбраный тип сервера не корректен.',
'error_server_warning_threshold_invalid' => 'Значение порога предупреждения должен имеет значение больше 0',
),
'config' => array(
'general' => 'Основные',
'language' => 'Язык',
'show_update' => 'Обновления',
'email_status' => 'Разрешить отправку Email',
'email_from_email' => 'Отправлять от адреса',
'email_from_name' => 'Отправлять от имени',
'email_smtp' => 'Включить SMTP',
'email_smtp_host' => 'SMTP сервер',
'email_smtp_port' => 'SMTP порт',
'email_smtp_username' => 'SMTP пользователь',
'email_smtp_password' => 'SMTP пароль',
'email_smtp_noauth' => 'Оставить пустым, если не аутентификации',
'sms_status' => 'Разрешить отправку SMS',
'sms_gateway' => 'Шлюз для отправки SMS',
'sms_gateway_mosms' => 'Mosms',
'sms_gateway_mollie' => 'Mollie',
'sms_gateway_spryng' => 'Spryng',
'sms_gateway_inetworx' => 'Inetworx',
'sms_gateway_clickatell' => 'Clickatell',
'sms_gateway_textmarketer' => 'Textmarketer',
'sms_gateway_smsit' => 'Smsit',
'sms_gateway_username' => 'Пользователь',
'sms_gateway_password' => 'Пароль',
'sms_from' => 'Номер отправителя',
'alert_type' => 'Выбирите, какие вы хотите получать уведомления<br/>',
'alert_type_description' => '<b>Изменение статуса :</b> '.
'Вы получите уведомление об изменение статуса. Для онлайн -> оффлайн или офлайн -> онлайн.<br/>'.
'<br /><b>Оффлайн:</b> '.
'Вы получите уведомление только когда сервер перейдет в статус оффлайн. Например, '.
'Задание Cron выставлено на каждые 15 минут. Сервер перейдет в статус оффлайн в 1:00 и не измениться до 6:00. '.
'Вы получите 1 уведомление только в 1:00<br/>'.
'<br><b>Всегда:</b> '.
'Вы будете получать уведомление при каждом запуске скрипта проверки, как только сервер перейдет в статус оффлайн, даже если'.
'сервер находится в этом статусе несколько часов',
'alert_type_status' => 'Изменение статуса',
'alert_type_offline' => 'Оффлайн',
'alert_type_always' => 'Всегда',
'log_status' => 'Лог статусов',
'log_status_description' => 'Если лог установлен в TRUE, монитор будет логировать все события режим которых выбран в типе уведомлений.',
'log_email' => 'Уведомления отправленые по Email',
'log_sms' => 'Уведомления отправленые по Email',
'updated' => 'Параметры были успешно применены.',
'nochanges' => 'Параметры не изменились.',
'tab_email' => 'Email',
'tab_sms' => 'SMS',
'tab_log' => 'Лог',
'settings_email' => 'Настройка Email',
'settings_sms' => 'Настройка SMS',
'settings_notification' => 'Настройка уведомлений',
'settings_log' => 'Настройка логирования',
'auto_refresh' => 'Авто-обновление',
'auto_refresh_servers' =>
'Авто-обновление страницы статуса серверов.<br/>'.
'<span class="small">'.
'Вермя в секундах, если 0 страница не будет обновляться.'.
'</span>',
'seconds' => 'секунд',
'test' => 'Тест',
'test_email' => 'Сообщение будет отправлено на адрес указаный в профиле пользователя.',
'test_sms' => 'Сообщение будет отправлено на номер телефона указаный в профиле пользователя.',
'send' => 'Отправить',
'test_message' => 'Тестовое сообщение',
'email_sent' => 'Email отправлен',
'email_error' => 'Ошибка при отправке email',
'sms_sent' => 'Sms отправлено',
'sms_error' => 'Ошибка при отправке sms',
),
// for newlines in the email messages use <br/>
'notifications' => array(
'off_sms' => 'Сервер \'%LABEL%\' сейчас НЕДОСТУПЕН: ip=%IP%, port=%PORT%. Ошибка=%ERROR%',
'off_email_subject' => 'ВАЖНО: сервер \'%LABEL%\' сейчас НЕДОСТУПЕН',
'off_email_body' => "Невозможно подключиться к следующему серверу:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Порт: %PORT%<br/>Ошибка: %ERROR%<br/>Дата: %DATE%",
'on_sms' => 'Сервер \'%LABEL%\' сейчас ДОСТУПЕН: ip=%IP%, port=%PORT%',
'on_email_subject' => 'ВАЖНО: Сервер \'%LABEL%\' сейчас ДОСТУПЕН',
'on_email_body' => "Сервер '%LABEL%' снова доступен:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>Date: %DATE%",
),
'login' => array(
'welcome_usermenu' => 'Здравствуйте, %user_name%',
'title_sign_in' => 'Пожалуйста авторизуйтесь',
'title_forgot' => 'Забыл пароль?',
'title_reset' => 'Сбросить пароль',
'submit' => 'Подтвердить',
'remember_me' => 'Запомнить меня',
'login' => 'Войти',
'logout' => 'Выйти',
'username' => 'Имя пользователя',
'password' => 'Пароль',
'password_repeat' => 'Повторить пароль',
'password_forgot' => 'Забыл пароль?',
'password_reset' => 'Сбросить пароль',
'password_reset_email_subject' => 'Сбросить пароль для PHP Server Monitor',
'password_reset_email_body' => 'Пожалуйста, используйте следующую ссылку для сброса пароля. Ссылка истечет через 1 час.<br/><br/>%link%',
'error_user_incorrect' => 'Пользователь с указаными данными не найден.',
'error_login_incorrect' => 'Информация указана неверно.',
'error_login_passwords_nomatch' => 'Пароль указан неверно.',
'error_reset_invalid_link' => 'Ссылка для сброса пароля недействительна.',
'success_password_forgot' => 'Вам был отправлен email, с описанием сброса пароля.',
'success_password_reset' => 'Ваш пароль был сброшен. Пожалуйста авторизуйтесь.',
),
);

View File

@ -35,17 +35,17 @@ $sm_lang = array(
'save' => '保存',
'edit' => '编辑',
'delete' => '删除',
'deleted' => '纪录已删除',
'date' => '日期',
'message' => '消息',
'yes' => '是',
'no' => '否o',
'edit' => '编辑',
'insert' => '插入',
'add_new' => '添加',
'update_available' => '发现新版本({version}) <a href="http://www.phpservermonitor.org" target="_blank">http://www.phpservermonitor.org</a>.',
'back_to_top' => '返回顶部',
'go_back' => '后退',
'ok' => 'OK',
'cancel' => 'Cancel',
// date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php
'short_day_format' => '%B %e',
'long_day_format' => '%B %e, %Y',
@ -81,6 +81,9 @@ $sm_lang = array(
'level_description' => '<b>超级管理员</b> 拥有所有权限: 管理服务器, 用户 以及修改设置.<br/><b>普通用户</b> 只能查看及更新自己名下所属的服务器.',
'mobile' => '手机',
'email' => '邮件',
'delete_title' => 'Delete User',
'delete_message' => 'Are you sure you want to delete user \'%1\'?',
'deleted' => 'User deleted.',
'updated' => '用户已更新.',
'inserted' => '用户已添加.',
'profile' => '个人资料',
@ -101,9 +104,11 @@ $sm_lang = array(
'status' => '状态',
'email' => '邮件',
'sms' => '短信',
'no_logs' => 'No logs',
),
'servers' => array(
'server' => '服务器',
'status' => '状态',
'label' => '标签',
'domain' => '域名/IP',
'port' => '端口',
@ -115,14 +120,21 @@ $sm_lang = array(
'last_check' => '最后检查',
'last_online' => '最后在线',
'monitoring' => '监控中',
'no_monitoring' => 'No monitoring',
'email' => '邮件',
'send_email' => '发送邮件',
'sms' => '短信',
'send_sms' => '发送短信',
'delete_title' => 'Delete Server',
'delete_message' => 'Are you sure you want to delete server \'%1\'?',
'deleted' => 'Server deleted.',
'updated' => '服务器已更新.',
'inserted' => '服务器已添加.',
'latency' => '延迟',
'latency_max' => '延迟(最大)',
'latency_min' => '延迟(最小)',
'latency_avg' => '延迟(平均)',
'uptime' => 'Uptime',
'year' => '年',
'month' => '月',
'week' => '周',
@ -137,6 +149,13 @@ $sm_lang = array(
'chart_long_date_format' => '%Y-%m-%d %H:%M:%S',
'chart_short_date_format' => '%m/%d %H:%M',
'chart_short_time_format' => '%H:%M',
'error_server_no_match' => 'Server not found.',
'error_server_label_bad_length' => 'The label must be between 1 and 255 characters.',
'error_server_ip_bad_length' => 'The domain / IP must be between 1 and 255 characters.',
'error_server_ip_bad_service' => 'The IP address is not valid.',
'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.',
),
'config' => array(
'general' => '通用',
@ -159,6 +178,7 @@ $sm_lang = array(
'sms_gateway_inetworx' => 'Inetworx',
'sms_gateway_clickatell' => 'Clickatell',
'sms_gateway_textmarketer' => 'Textmarketer',
'sms_gateway_smsit' => 'Smsit',
'sms_gateway_username' => 'SMS网关用户名',
'sms_gateway_password' => 'SMS网关密码',
'sms_from' => '发信人电话号',
@ -179,6 +199,7 @@ $sm_lang = array(
'log_email' => '记录脚本所发邮件?',
'log_sms' => '记录脚本所发短信SMS?',
'updated' => '设置已更新.',
'nochanges' => 'The configuration didn\'t change.',
'tab_email' => '邮件发送设置',
'tab_sms' => '短信发送设置',
'tab_log' => '日志设置',
@ -193,6 +214,15 @@ $sm_lang = array(
'单位为秒, 设置为0则不自动刷新.'.
'</span>',
'seconds' => 'seconds',
'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.',
'send' => 'Send',
'test_message' => 'Test message',
'email_sent' => 'Email sent',
'email_error' => 'Error in email sending',
'sms_sent' => 'Sms sent',
'sms_error' => 'Error in sms sending',
),
// for newlines in the email messages use <br/>
'notifications' => array(

View File

@ -28,6 +28,7 @@
namespace psm\Module;
use psm\Service\Database;
use psm\Service\Template;
use Symfony\Component\HttpFoundation\Response;
abstract class AbstractController implements ControllerInterface {
@ -79,6 +80,18 @@ abstract class AbstractController implements ControllerInterface {
*/
protected $sidebar;
/**
* array of Modal to add
* @var \psm\Util\Module\ModalInterface[] $modal
*/
protected $modal = array();
/**
* html code of header accessories
* @var string $header_accessories
*/
protected $header_accessories;
/**
* Database object
* @var \psm\Service\Database $db
@ -118,22 +131,43 @@ abstract class AbstractController implements ControllerInterface {
*/
protected $user_level_required_actions = array();
/*
* Required using black background layout
* @var boolean $black_background
*/
protected $black_background = false;
/**
* XHR mode?
* @var boolean $xhr
* @see isXHR()
*/
protected $xhr = false;
function __construct(Database $db, Template $tpl) {
$this->db = $db;
$this->tpl = $tpl;
}
/**
* Initialize the module
* Initialize the controller.
*
* @return \Symfony\Component\HttpFoundation\Response
*/
public function initialize() {
$action = psm_GET('action', psm_POST('action', $this->action_default));
$this->xhr = (bool) psm_GET('xhr', psm_POST('xhr', false));
if(!in_array($action, $this->actions) || !$this->initializeAction($action)) {
$this->initializeAction($this->action_default);
if(!in_array($action, $this->actions) || !($result = $this->initializeAction($action))) {
$result = $this->initializeAction($this->action_default);
}
$this->createHTML();
if($result instanceof Response) {
return $result;
}
// no response returned from execute, create regular HTML
return $this->createHTML();
}
/**
@ -141,7 +175,7 @@ abstract class AbstractController implements ControllerInterface {
*
* For it to run, the "execute$action" method must exist.
* @param string $action
* @return boolean whether action has been initialized successfully
* @return mixed FALSE when action couldnt be initialized, response otherwise
*/
protected function initializeAction($action) {
if(isset($this->user_level_required_actions[$action])) {
@ -155,57 +189,88 @@ abstract class AbstractController implements ControllerInterface {
$method = 'execute' . ucfirst($action);
if(method_exists($this, $method)) {
$this->action = $action;
$this->$method();
return true;
$result = $this->$method();
// if result from execute is null, no return value given so return true to indicate a successful execute
return ($result === null) ? true : $result;
}
return false;
}
/**
* Create the HTML code for the module.
*
* First the createHTMLLabels() will be called to add all labels to the template,
* Then the tpl_id set in $this->getTemplateId() will be added to the main template automatically
* Then the tpl_id set in $this->getTemplateId() will be added to the main template automatically.
* If XHR is on, no main template will be added.
*
* @return \Symfony\Component\HttpFoundation\Response
*/
protected function createHTML() {
$tpl_data = array();
if(!empty($this->messages)) {
$this->tpl->addTemplateDataRepeat('main', 'messages', $this->messages);
}
// add menu to page?
if($this->add_menu) {
$tpl_data['html_menu'] = $this->createHTMLMenu();
}
// add sidebar to page?
if($this->sidebar !== null) {
$tpl_data['html_sidebar'] = $this->sidebar->createHTML();
$tpl_data['content_span'] = '10';
} else {
$tpl_data['content_span'] = '12';
}
// add footer to page?
if($this->add_footer) {
$this->tpl->newTemplate('main_footer', 'main.tpl.html');
$tpl_data['html_footer'] = $this->tpl->getTemplate('main_footer');
$tpl_data['version'] = 'v' . PSM_VERSION;
}
$tpl_id_content = $this->getTemplateId();
if($tpl_id_content) {
$tpl_data['content'] = $this->tpl->getTemplate($tpl_id_content);
$html = '';
if($this->xhr) {
// in XHR mode, we will not add the main template
if($tpl_id_content) {
$this->createHTMLLabels();
$html = $this->tpl->display($tpl_id_content);
}
} else {
// regular request, add main frame
$tpl_data = array();
if(!empty($this->messages)) {
$this->tpl->addTemplateDataRepeat('main', 'messages', $this->messages);
}
// add menu to page?
if($this->add_menu) {
$tpl_data['html_menu'] = $this->createHTMLMenu();
}
// add header accessories to page ?
if($this->header_accessories) {
$tpl_data['header_accessories'] = $this->header_accessories;
}
// add modal dialog to page ?
if(sizeof($this->modal)) {
$html_modal = '';
foreach($this->modal as $modal) {
$html_modal .= $modal->createHTML();
}
$tpl_data['html_modal'] = $html_modal;
}
// add sidebar to page?
if($this->sidebar !== null) {
$tpl_data['html_sidebar'] = $this->sidebar->createHTML();
}
// add footer to page?
if($this->add_footer) {
$this->tpl->newTemplate('main_footer', 'main.tpl.html');
$tpl_data['html_footer'] = $this->tpl->getTemplate('main_footer');
$tpl_data['version'] = 'v' . PSM_VERSION;
}
if($tpl_id_content) {
$tpl_data['content'] = $this->tpl->getTemplate($tpl_id_content);
}
if(psm_update_available()) {
$tpl_data['update_available'] = str_replace('{version}', 'v'.psm_get_conf('version_update_check'), psm_get_lang('system', 'update_available'));
}
if($this->black_background) {
$tpl_data['body_class'] = 'black_background';
}
// add the module's custom template to the main template to get some content
$this->setTemplateId('main');
$this->tpl->addTemplatedata($this->getTemplateId(), $tpl_data);
$this->createHTMLLabels();
$html = $this->tpl->display($this->getTemplateId());
}
if(psm_update_available()) {
$tpl_data['update_available'] = str_replace('{version}', 'v'.psm_get_conf('version_update_check'), psm_get_lang('system', 'update_available'));
}
$response = new Response($html);
// add the module's custom template to the main template to get some content
$this->setTemplateId('main');
$this->tpl->addTemplatedata($this->getTemplateId(), $tpl_data);
$this->createHTMLLabels();
// display main template
echo $this->tpl->display($this->getTemplateId());
return $response;
}
/**
@ -268,8 +333,6 @@ abstract class AbstractController implements ControllerInterface {
* @see createHTML()
*/
protected function createHTMLLabels() {
global $type;
$this->tpl->addTemplateData(
'main',
array(
@ -443,4 +506,30 @@ abstract class AbstractController implements ControllerInterface {
$this->sidebar = $sidebar;
return $this;
}
/**
* Add a modal dialog to the page
* @param \psm\Util\Module\ModalInterface $modal
* @return \psm\Module\ControllerInterface
*/
public function addModal(\psm\Util\Module\ModalInterface $modal) {
$this->modal[$modal->getModalID()] = $modal;
return $this;
}
/**
* Set the html code of the header accessories
* @param string $html
*/
public function setHeaderAccessories($html) {
$this->header_accessories = $html;
}
/**
* Check if XHR is on
* @return boolean
*/
public function isXHR() {
return $this->xhr;
}
}

View File

@ -62,6 +62,8 @@ class ConfigController extends AbstractController {
'sms_from',
);
private $default_tab = 'general';
function __construct(Database $db, Template $tpl) {
parent::__construct($db, $tpl);
@ -117,6 +119,20 @@ class ConfigController extends AbstractController {
$tpl_data[$input_key] = (isset($config[$input_key])) ? $config[$input_key] : '';
}
$tpl_data[$this->default_tab . '_active'] = 'active';
$modal = new \psm\Util\Module\Modal($this->tpl, 'testEmail', \psm\Util\Module\Modal::MODAL_TYPE_OKCANCEL);
$this->addModal($modal);
$modal->setTitle(psm_get_lang('servers', 'send_email'));
$modal->setMessage(psm_get_lang('config', 'test_email'));
$modal->setOKButtonLabel(psm_get_lang('config', 'send'));
$modal = new \psm\Util\Module\Modal($this->tpl, 'testSMS', \psm\Util\Module\Modal::MODAL_TYPE_OKCANCEL);
$this->addModal($modal);
$modal->setTitle(psm_get_lang('servers', 'send_sms'));
$modal->setMessage(psm_get_lang('config', 'test_sms'));
$modal->setOKButtonLabel(psm_get_lang('config', 'send'));
$this->tpl->addTemplateData($this->getTemplateId(), $tpl_data);
}
@ -143,9 +159,11 @@ class ConfigController extends AbstractController {
}
// save all values to the database
$changed = false;
foreach($clean as $key => $value) {
// check if key already exists, otherwise add it
if(psm_get_conf($key) === null) {
$old_value = psm_get_conf($key);
if($old_value === null) {
// not yet set, add it
$this->db->save(
PSM_DB_PREFIX . 'config',
@ -154,22 +172,67 @@ class ConfigController extends AbstractController {
'value' => $value,
)
);
} else {
$changed = true;
} else if($value != $old_value) {
// update
$this->db->save(
PSM_DB_PREFIX . 'config',
array('value' => $value),
array('key' => $key)
);
$changed = true;
}
}
$this->addMessage(psm_get_lang('config', 'updated'), 'success');
if($changed) {
$this->addMessage(psm_get_lang('config', 'updated'), 'success');
} else {
$this->addMessage(psm_get_lang('config', 'nochanges'));
}
if(!empty($_POST['test_email'])) {
// build mail object
$mail = psm_build_mail();
$message = psm_get_lang('config', 'test_message');
$mail->Subject = $message;
$mail->Priority = 1;
$mail->Body = $message;
$mail->AltBody = str_replace('<br/>', "\n", $message);
$user = $this->user->getUser();
$mail->AddAddress($user->email, $user->name);
if($mail->Send()) {
$this->addMessage(psm_get_lang('config', 'email_sent'), 'success');
} else {
$this->addMessage(psm_get_lang('config', 'email_error') . ': ' . $mail->ErrorInfo, 'error');
}
} elseif(!empty($_POST['test_sms'])) {
// build sms object
$sms = psm_build_sms();
if($sms) {
$user = $this->user->getUser();
$sms->addRecipients($user->mobile);
if($sms->sendSMS(psm_get_lang('config', 'test_message'))) {
$this->addMessage(psm_get_lang('config', 'sms_sent'), 'success');
} else {
$this->addMessage(psm_get_lang('config', 'sms_error'), 'error');
}
}
}
if($clean['language'] != psm_get_conf('language')) {
header('Location: ' . $_SERVER['REQUEST_URI']);
header('Location: ' . psm_build_url(array('mod' => 'config'), true, false));
die();
}
if(isset($_POST['general_submit'])) {
$this->default_tab = 'general';
} 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['logging_submit'])) {
$this->default_tab = 'logging';
}
}
$this->initializeAction('index');
}
@ -208,6 +271,8 @@ class ConfigController extends AbstractController {
'label_sms_gateway_clickatell' => psm_get_lang('config', 'sms_gateway_clickatell'),
'label_sms_gateway_smsglobal' => psm_get_lang('config', 'sms_gateway_smsglobal'),
'label_sms_gateway_textmarketer' => psm_get_lang('config', 'sms_gateway_textmarketer'),
'label_sms_gateway_smsit' => psm_get_lang('config', 'sms_gateway_smsit'),
'label_sms_gateway_smsglobal' => psm_get_lang('config', 'sms_gateway_smsglobal'),
'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'),
@ -224,6 +289,7 @@ class ConfigController extends AbstractController {
'label_auto_refresh_servers' => psm_get_lang('config', 'auto_refresh_servers'),
'label_seconds' => psm_get_lang('config', 'seconds'),
'label_save' => psm_get_lang('system', 'save'),
'label_test' => psm_get_lang('config', 'test'),
)
);

View File

@ -211,6 +211,8 @@ class InstallController extends AbstractController {
if(!defined('PSM_DB_PREFIX') || !$this->db->status()) {
return $this->executeConfig();
}
$add_user = false;
// check if user submitted username + password in previous step
// this would only be the case for new installs, and install from
// before 3.0
@ -220,6 +222,7 @@ class InstallController extends AbstractController {
'password' => psm_POST('password'),
'password_repeat' => psm_POST('password_repeat'),
'email' => psm_POST('email', ''),
'mobile' => '',
'level' => PSM_USER_ADMIN,
);

View File

@ -27,8 +27,6 @@
**/
namespace psm\Module;
use psm\Service\Database;
use psm\Service\Template;
interface ModuleInterface {

View File

@ -63,19 +63,32 @@ class LogController extends AbstractServerController {
$log_count = count($records);
for ($x = 0; $x < $log_count; $x++) {
$records[$x]['class'] = ($x & 1) ? 'odd' : 'even';
$records[$x]['users'] = '';
$records[$x]['server'] = $records[$x]['label'] . ' (' . $records[$x]['label_adv'] . ')';
$records[$x]['datetime_format'] = psm_date($records[$x]['datetime']);
$record = &$records[$x];
$record['class'] = ($x & 1) ? 'odd' : 'even';
$record['users'] = '';
$record['server'] = $record['label'];
$record['type_icon'] = ($record['server_type'] == 'website') ? 'icon-globe' : 'icon-cog';
$record['type_title'] = psm_get_lang('servers', 'type_' . $record['server_type']);
$ip = '(' . $record['ip'];
if(!empty($record['port']) && (($record['server_type'] != 'website') || ($record['port'] != 80))) {
$ip .= ':' . $record['port'];
}
$ip .= ')';
$record['ip'] = $ip;
$record['datetime_format'] = psm_date($record['datetime']);
// fix up user list
if($records[$x]['user_id'] == '') continue;
$users = explode(',', $records[$x]['user_id']);
foreach($users as $user_id) {
if((int) $user_id == 0 || !isset($users_labels[$user_id])) continue;
$records[$x]['users'] .= '<br/>'.$users_labels[$user_id];
if(!empty($record['user_id'])) {
$names = array();
$users = explode(',', $record['user_id']);
foreach($users as $user_id) {
if(isset($users_labels[$user_id])) {
$names[] = $users_labels[$user_id];
}
}
sort($names);
$record['users'] = implode('<br/>', $names);
$record['user_list'] = implode('&nbsp;&bull; ', $names);
}
}
@ -86,6 +99,8 @@ class LogController extends AbstractServerController {
'server_log_entries',
array(
'logtitle' => $key,
'?has_users' => ($key == 'status') ? false : true,
'?no_logs' => ($log_count == 0) ? true : false,
)
);
$this->tpl->addTemplateData(
@ -115,11 +130,9 @@ class LogController extends AbstractServerController {
$entries = $this->db->query(
'SELECT '.
'`servers`.`label`, '.
'CONCAT_WS('.
'\':\','.
'`servers`.`ip`, '.
'`servers`.`port`'.
') AS `label_adv`, '.
'`servers`.`ip`, '.
'`servers`.`port`, '.
'`servers`.`type` AS server_type, '.
'`log`.`type`, '.
'`log`.`message`, '.
'`log`.`datetime`, '.
@ -149,6 +162,7 @@ class LogController extends AbstractServerController {
'label_message' => psm_get_lang('system', 'message'),
'label_date' => psm_get_lang('system', 'date'),
'label_users' => ucfirst(psm_get_lang('menu', 'user')),
'label_no_logs' => psm_get_lang('log', 'no_logs'),
)
);

View File

@ -65,6 +65,12 @@ class ServerController extends AbstractServerController {
// check if user is admin, in that case we add the buttons
if($this->user->getUserLevel() == PSM_USER_ADMIN) {
$modal = new \psm\Util\Module\Modal($this->tpl, 'delete', \psm\Util\Module\Modal::MODAL_TYPE_DANGER);
$this->addModal($modal);
$modal->setTitle(psm_get_lang('servers', 'delete_title'));
$modal->setMessage(psm_get_lang('servers', 'delete_message'));
$modal->setOKButtonLabel(psm_get_lang('system', 'delete'));
$sidebar->addButton(
'add_new',
psm_get_lang('system', 'add_new'),
@ -99,9 +105,30 @@ class ServerController extends AbstractServerController {
$servers[$x]['class'] = ($x & 1) ? 'odd' : 'even';
if($servers[$x]['type'] == 'website') {
$servers[$x]['type_icon'] = 'icon-globe';
// add link to label
$servers[$x]['ip'] = '<a href="'.$servers[$x]['ip'].'" target="_blank">'.$servers[$x]['ip'].'</a>';
$ip = $servers[$x]['ip'];
if(!empty($servers[$x]['port']) && ($servers[$x]['port'] != 80)) {
$ip .= ' : ' . $servers[$x]['port'];
}
$servers[$x]['ip'] = '<a href="'.$servers[$x]['ip'].'" target="_blank">'.$ip.'</a>';
$servers[$x]['ip_short'] = $ip;
} else {
$servers[$x]['type_icon'] = 'icon-cog';
$servers[$x]['ip_short'] = $servers[$x]['ip'] . ' : ' . $servers[$x]['port'];
}
if(($servers[$x]['active'] == 'yes')) {
$servers[$x]['active_icon'] = 'icon-eye-open';
$servers[$x]['active_title'] = psm_get_lang('servers', 'monitoring');
$servers[$x]['email_icon'] = ($servers[$x]['email'] == 'yes') ? 'icon-envelope' : '';
$servers[$x]['sms_icon'] = ($servers[$x]['sms'] == 'yes') ? 'icon-mobile' : '';
} else {
$servers[$x]['active_icon'] = 'icon-eye-close';
$servers[$x]['active_title'] = psm_get_lang('servers', 'no_monitoring');
$servers[$x]['email_icon'] = '';
$servers[$x]['sms_icon'] = '';
}
$servers[$x] = $this->formatServer($servers[$x]);
}
// add servers to template
@ -116,6 +143,7 @@ class ServerController extends AbstractServerController {
$back_to = isset($_GET['back_to']) ? $_GET['back_to'] : '';
$tpl_data = array(
'edit_server_id' => $this->server_id,
// form url:
'url_save' => psm_build_url(array(
'mod' => 'server',
@ -136,34 +164,39 @@ class ServerController extends AbstractServerController {
case 0:
// insert mode
$tpl_data['titlemode'] = psm_get_lang('system', 'insert');
$tpl_data['edit_server_id'] = '0';
$tpl_data['edit_value_warning_threshold'] = '1';
$edit_server = $_POST;
break;
default:
// edit mode
// get server entry
$edit_server = $this->getServers($this->server_id);
if (empty($edit_server)) {
$this->addMessage('Invalid server', 'error');
if(empty($edit_server)) {
$this->addMessage(psm_get_lang('servers', 'error_server_no_match'), 'error');
return $this->initializeAction('index');
}
$tpl_data['titlemode'] = psm_get_lang('system', 'edit') . ' ' . $edit_server['label'];
$tpl_data = array_merge($tpl_data, array(
'titlemode' => psm_get_lang('system', 'edit') . ' ' . $edit_server['label'],
'edit_server_id' => $edit_server['server_id'],
'edit_value_label' => $edit_server['label'],
'edit_value_ip' => $edit_server['ip'],
'edit_value_port' => $edit_server['port'],
'edit_value_pattern' => $edit_server['pattern'],
'edit_value_warning_threshold' => $edit_server['warning_threshold'],
'edit_type_selected_' . $edit_server['type'] => 'selected="selected"',
'edit_active_selected_' . $edit_server['active'] => 'selected="selected"',
'edit_email_selected_' . $edit_server['email'] => 'selected="selected"',
'edit_sms_selected_' . $edit_server['sms'] => 'selected="selected"',
));
break;
}
// attempt to prefill previously posted fields
foreach($edit_server as $key => $value) {
$edit_server[$key] = psm_POST($key, $value);
}
$tpl_data = array_merge($tpl_data, array(
'edit_value_label' => $edit_server['label'],
'edit_value_ip' => $edit_server['ip'],
'edit_value_port' => $edit_server['port'],
'edit_value_pattern' => $edit_server['pattern'],
'edit_value_warning_threshold' => $edit_server['warning_threshold'],
'edit_type_selected_' . $edit_server['type'] => 'selected="selected"',
'edit_active_selected_' . $edit_server['active'] => 'selected="selected"',
'edit_email_selected_' . $edit_server['email'] => 'selected="selected"',
'edit_sms_selected_' . $edit_server['sms'] => 'selected="selected"',
));
$this->tpl->addTemplateData(
$this->getTemplateId(),
@ -175,35 +208,57 @@ class ServerController extends AbstractServerController {
* Executes the saving of one of the servers
*/
protected function executeSave() {
// check for add/edit mode
if(isset($_POST['label']) && isset($_POST['ip']) && isset($_POST['port'])) {
$clean = array(
'label' => strip_tags($_POST['label']),
'ip' => strip_tags($_POST['ip']),
'port' => intval($_POST['port']),
'type' => in_array($_POST['type'], array('website', 'service')) ? $_POST['type'] : 'website',
'pattern' => $_POST['pattern'],
'warning_threshold' => intval($_POST['warning_threshold']),
'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',
);
if(empty($_POST)) {
// dont process anything if no data has been posted
return $this->executeIndex();
}
// check for edit or add
$clean = array(
'label' => trim(strip_tags(psm_POST('label', ''))),
'ip' => trim(strip_tags(psm_POST('ip', ''))),
'port' => intval(psm_POST('port', 0)),
'type' => psm_POST('type', ''),
'pattern' => psm_POST('pattern', ''),
'warning_threshold' => intval(psm_POST('warning_threshold', 0)),
'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',
);
// make sure websites start with http://
if($clean['type'] == 'website' && substr($clean['ip'], 0, 4) != 'http') {
$clean['ip'] = 'http://' . $clean['ip'];
}
// validate the lot
$server_validator = new \psm\Util\Server\ServerValidator($this->db);
try {
if($this->server_id > 0) {
// edit
$this->db->save(
PSM_DB_PREFIX.'servers',
$clean,
array('server_id' => $this->server_id)
);
$this->addMessage(psm_get_lang('servers', 'updated'), 'success');
} else {
// add
$clean['status'] = 'on';
$this->server_id = $this->db->save(PSM_DB_PREFIX.'servers', $clean);
$this->addMessage(psm_get_lang('servers', 'inserted'), 'success');
$server_validator->serverId($this->server_id);
}
$server_validator->label($clean['label']);
$server_validator->type($clean['type']);
$server_validator->ip($clean['ip'], $clean['type']);
$server_validator->warningThreshold($clean['warning_threshold']);
} catch(\InvalidArgumentException $ex) {
$this->addMessage(psm_get_lang('servers', 'error_' . $ex->getMessage()), 'error');
return $this->executeEdit();
}
// check for edit or add
if($this->server_id > 0) {
// edit
$this->db->save(
PSM_DB_PREFIX.'servers',
$clean,
array('server_id' => $this->server_id)
);
$this->addMessage(psm_get_lang('servers', 'updated'), 'success');
} else {
// add
$clean['status'] = 'on';
$this->server_id = $this->db->save(PSM_DB_PREFIX.'servers', $clean);
$this->addMessage(psm_get_lang('servers', 'inserted'), 'success');
}
$back_to = isset($_GET['back_to']) ? $_GET['back_to'] : 'index';
@ -229,7 +284,7 @@ class ServerController extends AbstractServerController {
$this->db->delete(PSM_DB_PREFIX.'servers_uptime', array('server_id' => $id));
$this->db->delete(PSM_DB_PREFIX.'servers_history', array('server_id' => $id));
}
$this->addMessage(psm_get_lang('system', 'deleted'), 'success');
$this->addMessage(psm_get_lang('servers', 'deleted'), 'success');
}
$this->initializeAction('index');
}
@ -261,6 +316,14 @@ class ServerController extends AbstractServerController {
$this->tpl->newTemplate($tpl_id_actions, 'server/view.tpl.html');
$tpl_data['html_actions'] = $this->tpl->getTemplate($tpl_id_actions);
$tpl_data['url_edit'] = psm_build_url(array('mod' => 'server', 'action' => 'edit', 'id' => $this->server_id, 'back_to' => 'view'));
$tpl_data['url_delete'] = psm_build_url(array('mod' => 'server', 'action' => 'delete', 'id' => $this->server_id));
$tpl_data['server_name'] = $server['label'];
$modal = new \psm\Util\Module\Modal($this->tpl, 'delete', \psm\Util\Module\Modal::MODAL_TYPE_DANGER);
$this->addModal($modal);
$modal->setTitle(psm_get_lang('servers', 'delete_title'));
$modal->setMessage(psm_get_lang('servers', 'delete_message'));
$modal->setOKButtonLabel(psm_get_lang('system', 'delete'));
}
// add all available servers to the menu
@ -297,7 +360,7 @@ class ServerController extends AbstractServerController {
array(
'subtitle' => psm_get_lang('menu', 'server'),
'label_label' => psm_get_lang('servers', 'label'),
'label_status' => psm_get_lang('menu', 'server_status'),
'label_status' => psm_get_lang('servers', 'status'),
'label_domain' => psm_get_lang('servers', 'domain'),
'label_port' => psm_get_lang('servers', 'port'),
'label_type' => psm_get_lang('servers', 'type'),
@ -310,7 +373,9 @@ class ServerController extends AbstractServerController {
'label_rtime' => psm_get_lang('servers', 'latency'),
'label_last_online' => psm_get_lang('servers', 'last_online'),
'label_monitoring' => psm_get_lang('servers', 'monitoring'),
'label_email' => psm_get_lang('servers', 'email'),
'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_warning_threshold' => psm_get_lang('servers', 'warning_threshold'),
'label_warning_threshold_description' => psm_get_lang('servers', 'warning_threshold_description'),

View File

@ -38,7 +38,7 @@ class StatusController extends AbstractServerController {
function __construct(Database $db, Template $tpl) {
parent::__construct($db, $tpl);
$this->setActions(array('index'), 'index');
$this->setActions(array('index', 'saveLayout'), 'index');
}
/**
@ -46,9 +46,25 @@ class StatusController extends AbstractServerController {
* @todo move the background colurs to the config
*/
protected function executeIndex() {
// set background color to black
$this->black_background = true;
// add header accessories
$layout = $this->user->getUserPref('status_layout', 0);
$layout_data = array(
'block_layout_active' => ($layout == 0) ? 'active' : '',
'list_layout_active' => ($layout != 0) ? 'active' : '',
);
$this->tpl->newTemplate('status_layout_selector', 'server/status.tpl.html');
$this->tpl->addTemplateData('status_layout_selector', $layout_data);
$html_accessories = $this->tpl->getTemplate('status_layout_selector');
$this->setHeaderAccessories($html_accessories);
$this->setTemplateId('server_status', 'server/status.tpl.html');
$this->addFooter(false);
$this->tpl->addTemplateData($this->getTemplateId(), $layout_data);
// get the active servers from database
$servers = $this->getServers();
@ -76,6 +92,8 @@ class StatusController extends AbstractServerController {
// add servers to template
$this->tpl->addTemplateDataRepeat($this->getTemplateId(), 'servers_offline', $offline);
$this->tpl->addTemplateDataRepeat($this->getTemplateId(), 'servers_online', $online);
$this->tpl->addTemplateDataRepeat($this->getTemplateId(), 'servers_offline2', $offline);
$this->tpl->addTemplateDataRepeat($this->getTemplateId(), 'servers_online2', $online);
// check if we need to add the auto refresh
$auto_refresh = psm_get_conf('auto_refresh_servers');
@ -87,6 +105,19 @@ class StatusController extends AbstractServerController {
}
}
protected function executeSaveLayout() {
if($this->isXHR()) {
$layout = psm_POST('layout', 0);
$this->user->setUserPref('status_layout', $layout);
$response = new \Symfony\Component\HttpFoundation\JsonResponse();
$response->setData(array(
'layout' => $layout,
));
return $response;
}
}
protected function createHTMLLabels() {
$this->tpl->addTemplateData(
$this->getTemplateId(),

View File

@ -58,7 +58,7 @@ class LoginController extends AbstractController {
if($result) {
// success login, redirect
header('Location: ' . $_SERVER['REQUEST_URI']);
header('Location: ' . psm_build_url($_SERVER['QUERY_STRING']));
die();
} else {
$this->addMessage(psm_get_lang('login', 'error_login_incorrect'), 'error');

View File

@ -79,6 +79,12 @@ class UserController extends AbstractController {
'plus icon-white', 'success'
);
$modal = new \psm\Util\Module\Modal($this->tpl, 'delete', \psm\Util\Module\Modal::MODAL_TYPE_DANGER);
$this->addModal($modal);
$modal->setTitle(psm_get_lang('users', 'delete_title'));
$modal->setMessage(psm_get_lang('users', 'delete_message'));
$modal->setOKButtonLabel(psm_get_lang('system', 'delete'));
// build label array for the next loop
$servers_labels = array();
foreach ($this->servers as $server) {
@ -221,15 +227,16 @@ class UserController extends AbstractController {
if(!empty($clean['password'])) {
$password = $clean['password'];
}
unset($clean['password']);
unset($clean['password_repeat']);
if($user_id > 0) {
// edit user
unset($clean['password']); // password update is executed separately
$this->db->save(PSM_DB_PREFIX.'users', $clean, array('user_id' => $user_id));
$this->addMessage(psm_get_lang('users', 'updated'), 'success');
} else {
// add user
$clean['password'] = ''; // password update is executed separately
$user_id = $this->db->save(PSM_DB_PREFIX.'users', $clean);
$this->addMessage(psm_get_lang('users', 'inserted'), 'success');
}
@ -268,7 +275,7 @@ class UserController extends AbstractController {
$this->db->delete(PSM_DB_PREFIX . 'users', array('user_id' => $id,));
$this->db->delete(PSM_DB_PREFIX.'users_servers', array('user_id' => $id));
$this->addMessage(psm_get_lang('system', 'deleted'), 'success');
$this->addMessage(psm_get_lang('users', 'deleted'), 'success');
} catch(\InvalidArgumentException $e) {
$this->addMessage(psm_get_lang('users', 'error_' . $e->getMessage()), 'error');
}
@ -283,6 +290,7 @@ class UserController extends AbstractController {
array(
'subtitle' => psm_get_lang('menu', 'user'),
'label_users' => psm_get_lang('menu', 'users'),
'label_user' => psm_get_lang('users', 'user'),
'label_name' => psm_get_lang('users', 'name'),
'label_user_name' => psm_get_lang('users', 'user_name'),
'label_password' => psm_get_lang('users', 'password'),
@ -297,9 +305,11 @@ class UserController extends AbstractController {
'label_action' => psm_get_lang('system', 'action'),
'label_save' => psm_get_lang('system', 'save'),
'label_go_back' => psm_get_lang('system', 'go_back'),
'label_edit' => psm_get_lang('system', 'edit') . ' ' . psm_get_lang('users', 'user'),
'label_delete' => psm_get_lang('system', 'delete') . ' ' . psm_get_lang('users', 'user'),
'label_edit' => psm_get_lang('system', 'edit'),
'label_delete' => psm_get_lang('system', 'delete'),
'label_add_new' => psm_get_lang('system', 'add_new'),
'icon_level_10' => 'icon-admin',
'icon_level_20' => 'icon-user',
)
);

View File

@ -27,6 +27,7 @@
**/
namespace psm;
use Symfony\Component\HttpFoundation\Response;
/**
* The router class opens the controller and initializes the module.
@ -97,8 +98,16 @@ class Router {
* If no mod is given it will attempt to load the default module.
* @param string $mod if empty, the mod getvar will be used, or fallback to default
* @throws \InvalidArgumentException
* @throws \LogicException
*/
public function run($mod = null) {
if(!psm_is_cli() && isset($_GET["logout"])) {
$this->services['user']->doLogout();
// logged out, redirect to login
header('Location: ' . psm_build_url());
die();
}
if($mod === null) {
$mod = psm_GET('mod', $this->default_module);
}
@ -127,7 +136,12 @@ class Router {
$controller->setUser($this->services['user']);
// let the module prepare it's HTML code
$controller->initialize();
$response = $controller->initialize();
if(!($response instanceof Response)) {
throw new \LogicException('Controller did not return a Response object.');
}
$response->send();
}
/**

View File

@ -118,6 +118,13 @@ class Template {
}
$source = $this->addTemplateData($source, $subdata, true);
} else {
if(substr($key, 0, 1) == '?') {
$key = substr($key, 1);
// replace if statements
$if_replacement = empty($value) ? '' : '$1';
$source = preg_replace('{<!--\?'.$key.'-->(.*?)<!--\?\?'.$key.'-->}is', $if_replacement, $source);
}
$source = str_replace('{'.$key.'}', $value, $source);
}
}
@ -202,10 +209,24 @@ class Template {
$tmp_string = str_replace('{'.$k.'}', $repeat_html, $tmp_string);
} else {
foreach($v as $vk => $vv) {
if(substr($vk, 0, 1) == '?') {
$vk = substr($vk, 1);
// replace if statements
$if_replacement = empty($vv) ? '' : '$1';
$tmp_string = preg_replace('{<!--\?'.$k.'_'.$vk.'-->(.*?)<!--\?\?'.$k.'_'.$vk.'-->}is', $if_replacement, $tmp_string);
}
$tmp_string = str_replace('{'.$k.'_'.$vk.'}', $vv, $tmp_string);
}
}
} else {
if(substr($k, 0, 1) == '?') {
$k = substr($k, 1);
// replace if statements
$if_replacement = empty($v) ? '' : '$1';
$tmp_string = preg_replace('{<!--\?'.$k.'-->(.*?)<!--\?\?'.$k.'-->}is', $if_replacement, $tmp_string);
}
$tmp_string = str_replace('{'.$k.'}', $v, $tmp_string);
}
}
@ -225,6 +246,9 @@ class Template {
// check if there are any unused tpl_repeat templates, and if there are remove them
$result = preg_replace('{<!--%(.+?)-->(.*?)<!--%%\\1-->}is', '', $this->templates[$id]);
// check if there are any unused if, and if there are remove them
$result = preg_replace('{<!--\?(.+?)-->(.*?)<!--\?\?\\1-->}is', '', $result);
// check for tpl variables that have not been replaced. ie: {name}. ignore literal stuff, though. ie: {{name}} is {name} and should not be removed
preg_match_all('~{?{(\w+?)}}?~', $result, $matches);

View File

@ -28,10 +28,14 @@
**/
namespace psm\Service;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
/**
* This is a heavily modified version of the php-login-advanced project by Panique.
*
* It uses the Session classes from the Symfony HttpFoundation component.
*
* @author Panique
* @author Pepijn Over
* @link http://www.php-login.net
@ -52,44 +56,55 @@ class User {
*/
protected $user_data = array();
/**
* Session object
* @var \Symfony\Component\HttpFoundation\Session\Session $session
*/
protected $session;
/**
* Current user id
* @var int $user_id
*/
protected $user_id;
/**
/**
*Current user preferences
* @var array $user_preferences
*/
protected $user_preferences;
/**
* The user's login status
* @var boolean $user_is_logged_in
*/
protected $user_is_logged_in = false;
/**
* the function "__construct()" automatically starts whenever an object of this class is created,
* you know, when you do "$login = new Login();"
* Open a new user service
*
* @param \psm\Service\Database $db
* @param \Symfony\Component\HttpFoundation\Session\SessionInterface $session if NULL, one will be created
*/
public function __construct(Database $db) {
public function __construct(Database $db, SessionInterface $session = null) {
$this->db_connection = $db->pdo();
if(php_sapi_name() != 'cli' && (!defined('PSM_INSTALL') || !PSM_INSTALL)) {
if(!$this->isSessionStarted()) {
session_start();
if(!psm_is_cli()) {
if($session == null) {
$session = new Session();
$session->start();
}
// check the possible login actions:
// 1. login via session data (happens each time user opens a page on your php project AFTER he has successfully logged in via the login form)
// 2. login via cookie
// 3. logout (happen when user clicks logout button)
$this->session = $session;
// if user has an active session on the server
if(!$this->loginWithSessionData()) {
$this->loginWithCookieData();
}
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 he has successfully logged in via the login form)
// 2. login via cookie
if(isset($_GET["logout"])) {
$this->doLogout();
// logged out, redirect to login
header('Location: ' . psm_build_url());
die();
// if user has an active session on the server
if(!$this->loginWithSessionData()) {
$this->loginWithCookieData();
}
}
}
}
@ -133,13 +148,15 @@ class User {
}
/**
* Logs in with S_SESSION data.
* Logs in with SESSION data.
*
* @return boolean
*/
private function loginWithSessionData() {
if(empty($_SESSION) || !isset($_SESSION['user_id'])) {
protected function loginWithSessionData() {
if(!$this->session->has('user_id')) {
return false;
}
$user = $this->getUser($_SESSION['user_id']);
$user = $this->getUser($this->session->get('user_id'));
if(!empty($user)) {
$this->setUserLoggedIn($user->user_id);
@ -161,7 +178,7 @@ class User {
// extract data from the cookie
list ($user_id, $token, $hash) = explode(':', $_COOKIE['rememberme']);
// check cookie hash validity
if ($hash == hash('sha256', $user_id . ':' . $token . PSM_LOGIN_COOKIE_SECRET_KEY) && !empty($token)) {
if($hash == hash('sha256', $user_id . ':' . $token . PSM_LOGIN_COOKIE_SECRET_KEY) && !empty($token)) {
// cookie looks good, try to select corresponding user
// get real token from database (and all other data)
$user = $this->getUser($user_id);
@ -200,14 +217,14 @@ class User {
if(!isset($user->user_id)) {
password_verify($user_password, 'dummy_call_against_timing');
return false;
} else if (! password_verify($user_password, $user->password)) {
} else if(!password_verify($user_password, $user->password)) {
return false;
}
$this->setUserLoggedIn($user->user_id, true);
// if user has check the "remember me" checkbox, then generate token and write cookie
if ($user_rememberme) {
if($user_rememberme) {
$this->newRememberMeCookie();
}
@ -215,9 +232,9 @@ class User {
// DELETE this if-block if you like, it only exists to recalculate users's hashes when you provide a cost factor,
// by default the script will use a cost factor of 10 and never change it.
// check if the have defined a cost factor in config/hashing.php
if (defined('PSM_LOGIN_HASH_COST_FACTOR')) {
if(defined('PSM_LOGIN_HASH_COST_FACTOR')) {
// check if the hash needs to be rehashed
if (password_needs_rehash($user->password, PASSWORD_DEFAULT, array('cost' => PSM_LOGIN_HASH_COST_FACTOR))) {
if(password_needs_rehash($user->password, PASSWORD_DEFAULT, array('cost' => PSM_LOGIN_HASH_COST_FACTOR))) {
$this->changePassword($user->user_id, $user_password);
}
}
@ -231,10 +248,10 @@ class User {
*/
protected function setUserLoggedIn($user_id, $regenerate = false) {
if($regenerate) {
session_regenerate_id();
$this->session->migrate();
}
$_SESSION['user_id'] = $user_id;
$_SESSION['user_logged_in'] = 1;
$this->session->set('user_id', $user_id);
$this->session->set('user_logged_in', 1);
// declare user id, set the login status to true
$this->user_id = $user_id;
@ -244,7 +261,7 @@ class User {
/**
* Create all data needed for remember me cookie connection on client and server side
*/
private function newRememberMeCookie() {
protected function newRememberMeCookie() {
// generate 64 char random string and store it in current user data
$random_token_string = hash('sha256', mt_rand());
$sth = $this->db_connection->prepare('UPDATE '.PSM_DB_PREFIX.'users SET rememberme_token = :user_rememberme_token WHERE user_id = :user_id');
@ -262,11 +279,11 @@ class User {
/**
* Delete all data needed for remember me cookie connection on client and server side
*/
private function deleteRememberMeCookie() {
protected function deleteRememberMeCookie() {
// Reset rememberme token
if(isset($_SESSION['user_id'])) {
if($this->session->has('user_id')) {
$sth = $this->db_connection->prepare('UPDATE '.PSM_DB_PREFIX.'users SET rememberme_token = NULL WHERE user_id = :user_id');
$sth->execute(array(':user_id' => $_SESSION['user_id']));
$sth->execute(array(':user_id' => $this->session->get('user_id')));
}
// set the rememberme-cookie to ten years ago (3600sec * 365 days * 10).
@ -281,10 +298,8 @@ class User {
public function doLogout() {
$this->deleteRememberMeCookie();
$_SESSION = array();
session_destroy();
session_start();
session_regenerate_id();
$this->session->clear();
$this->session->invalidate();
$this->user_is_logged_in = false;
}
@ -427,17 +442,65 @@ class User {
}
/**
* Check if the session has already started
* @return boolean
* read current user preferences from the database
* @return boolean return false is user not connected
*/
public function isSessionStarted() {
if(php_sapi_name() !== 'cli') {
if(version_compare(phpversion(), '5.4.0', '>=')) {
return session_status() === PHP_SESSION_ACTIVE ? true : false;
} else {
return session_id() === '' ? false : true;
protected function loadPreferences() {
if($this->user_preferences === null) {
if(!$this->getUser()) {
return false;
}
$this->user_preferences = array();
foreach($this->db_connection->query('SELECT `key`,`value` FROM `' . PSM_DB_PREFIX . 'users_preferences` WHERE `user_id` = ' . $this->user_id) as $row) {
$this->user_preferences[$row['key']] = $row['value'];
}
}
return false;
return true;
}
/**
* Get a user preference value
* @param string $key
* @param mixed $default
* @return mixed
*/
public function getUserPref($key, $default = '') {
if(!$this->loadPreferences() || !isset($this->user_preferences[$key])) {
return $default;
}
$value = $this->user_preferences[$key];
settype($value, gettype($default));
return $value;
}
/**
* Set a user preference value
* @param string $key
* @param mixed $value
*/
public function setUserPref($key, $value) {
if($this->loadPreferences()) {
if(isset($this->user_preferences[$key])) {
if($this->user_preferences[$key] == $value) {
return; // no change
}
$sql = 'UPDATE `' . PSM_DB_PREFIX . 'users_preferences` SET `key` = ?, `value` = ? WHERE `user_id` = ?';
} else{
$sql = 'INSERT INTO `' . PSM_DB_PREFIX . 'users_preferences` SET `key` = ?, `value` = ?, `user_id` = ?';
}
$sth = $this->db_connection->prepare($sql);
$sth->execute(array($key, $value, $this->user_id));
$this->user_preferences[$key] = $value;
}
}
/**
* Get session object
* @return \Symfony\Component\HttpFoundation\Session\SessionInterface
*/
public function getSession() {
return $this->session;
}
}

View File

@ -78,4 +78,4 @@ class Smsglobal extends Core {
return $isOk;
}
}
}

View File

@ -0,0 +1,71 @@
<?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 nerdalertdk
* @copyright Copyright (c) 2008-2014 Pepijn Over <pep@neanderthal-technology.com>
* @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3
* @version Release: @package_version@
* @link http://www.phpservermonitor.org/
* @since phpservermon 3.1
**/
namespace psm\Txtmsg;
class Smsit extends Core {
// =========================================================================
// [ Fields ]
// =========================================================================
public $gateway = 1;
public $resultcode = null;
public $resultmessage = null;
public $success = false;
public $successcount = 0;
public function sendSMS($message) {
// http://www.smsit.dk/api/sendSms.php?apiKey=[KEY]x&senderId=[SENDER]&mobile=[PHONENUMBER]&message=[MESSAGE]
// Use USERNAME as API KEY, password not needed
$apiurl = "http://www.smsit.dk/api/sendSms.php";
$msg = urlencode( $message );
$from = urlencode( substr($this->originator,0,11) ); // Max 11 Char.
foreach( $this->recipients as $phone ){
$URL = $apiurl."?apiKey=" . $this->username . "&mobile=" . $phone . "&message=" . $msg . "&senderId=" . $from;
$result = file_get_contents( $URL );
/*
0 Everything went as it should
1 Invalid API key
2 Invalid sender name
3 Invalid character set (charset)
4 Invalid mobile number
5 There is not filled out a message
6 The message is too long (That was she said)
7 API-key does not exist
*/
if((int)$result == 0) {
$success = true;
}
}
return $result;
}
}

View File

@ -126,7 +126,7 @@ class Installer {
$this->log('Populating database...');
$queries = array();
$queries[] = "INSERT INTO `" . PSM_DB_PREFIX . "servers` (`ip`, `port`, `label`, `type`, `status`, `error`, `rtime`, `last_online`, `last_check`, `active`, `email`, `sms`) VALUES ('http://sourceforge.net/index.php', 80, 'SourceForge', 'website', 'on', '', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 'yes', 'yes', 'yes'), ('smtp.gmail.com', 465, 'Gmail SMTP', 'service', 'on', '', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 'yes', 'yes', 'yes')";
$queries[] = "INSERT INTO `" . PSM_DB_PREFIX . "servers` (`ip`, `port`, `label`, `type`, `pattern`, `status`, `error`, `rtime`, `last_online`, `last_check`, `active`, `email`, `sms`) VALUES ('http://sourceforge.net/index.php', 80, 'SourceForge', 'website', '', 'on', '', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 'yes', 'yes', 'yes'), ('smtp.gmail.com', 465, 'Gmail SMTP', 'service', '', 'on', '', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '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'),
@ -181,6 +181,12 @@ class Installer {
PRIMARY KEY (`user_id`),
UNIQUE KEY `unique_username` (`user_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;",
PSM_DB_PREFIX . 'users_preferences' => "CREATE TABLE IF NOT EXISTS `" . PSM_DB_PREFIX . "users_preferences` (
`user_id` int(11) unsigned NOT NULL,
`key` varchar(255) NOT NULL,
`value` varchar(255) NOT NULL,
PRIMARY KEY (`user_id`, `key`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;",
PSM_DB_PREFIX . 'users_servers' => "CREATE TABLE `" . PSM_DB_PREFIX . "users_servers` (
`user_id` INT( 11 ) UNSIGNED NOT NULL ,
`server_id` INT( 11 ) UNSIGNED NOT NULL ,
@ -264,6 +270,10 @@ class Installer {
// upgrade to 3.0.0
$this->upgrade300();
}
if(version_compare($version_from, '3.1.0', '<')) {
// upgrade to 3.1.0
$this->upgrade310();
}
psm_update_conf('version', $version_to);
}
@ -378,4 +388,15 @@ class Installer {
}
$this->execSQL("ALTER TABLE `".PSM_DB_PREFIX."users` DROP `server_id`;");
}
protected function upgrade310() {
$queries = array();
$queries[] = "CREATE TABLE IF NOT EXISTS `" . PSM_DB_PREFIX . "users_preferences` (
`user_id` int(11) unsigned NOT NULL,
`key` varchar(255) NOT NULL,
`value` varchar(255) NOT NULL,
PRIMARY KEY (`user_id`, `key`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
$this->execSQL($queries);
}
}

View File

@ -0,0 +1,155 @@
<?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 Pepijn Over <pep@neanderthal-technology.com>
* @author Jérôme Cabanis <jerome@lauraly.com>
* @copyright Copyright (c) 2008-2014 Pepijn Over <pep@neanderthal-technology.com>
* @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3
* @version Release: @package_version@
* @link http://www.phpservermonitor.org/
**/
namespace psm\Util\Module;
use psm\Service\Template;
class Modal implements ModalInterface {
const MODAL_TYPE_OK = 0;
const MODAL_TYPE_OKCANCEL = 1;
const MODAL_TYPE_DANGER = 2;
/**
* Template service
* @var \psm\Service\Template $tpl
*/
protected $tpl;
/**
* prefix used for modal dialog box elements
* @var string $modal_id
*/
protected $modal_id;
/**
* @var int $type Type of modal dialog
*/
protected $type;
/**
* Modal dialog title
* @var string $title
*/
protected $title;
/**
* Modal dialog message
* @var string $body
*/
protected $message;
/**
* label of the OK button
* @var string $ok_label
*/
protected $ok_label;
public function __construct(Template $tpl, $modal_id = 'main', $type = self::MODAL_TYPE_OK ) {
$this->modal_id = $modal_id;
$this->tpl = $tpl;
$this->type = $type;
}
/**
* get the modal dialog box element prefix
* @return string
*/
public function getModalID() {
return $this->modal_id;
}
/**
* Set the modal dialog type
* @param int $type
* @return \psm\Util\Module\Modal
*/
public function setType($type) {
if(in_array($type, array(self::MODAL_TYPE_OK, self::MODAL_TYPE_OKCANCEL, self::MODAL_TYPE_DANGER))) {
$this->type = $type;
}
return $this;
}
/**
* Set the modal dialog title
* @param string $title
* @return \psm\Util\Module\Modal
*/
public function setTitle($title) {
$this->title = $title;
return $this;
}
/**
* Set the modal dialog message
* @param string $message
* @return \psm\Util\Module\Modal
*/
public function setMessage($message) {
$this->message = $message;
return $this;
}
public function setOKButtonLabel($label) {
$this->ok_label = $label;
return $this;
}
public function createHTML() {
$tpl_id = 'main_modal_container';
$this->tpl->newTemplate($tpl_id, 'main_modal.tpl.html');
$has_cancel = ($this->type == self::MODAL_TYPE_OK) ? false : true;
$button_type = ($this->type == self::MODAL_TYPE_DANGER) ? 'danger' : 'primary';
$button_label = empty($this->ok_label) ? psm_get_lang('system', 'ok') : $this->ok_label;
$message = !empty($this->message) ? $this->message : '';
$matches = array();
if(preg_match_all('/%(\d)/', $message, $matches, PREG_SET_ORDER)) {
foreach($matches as $match) {
$message = str_replace($match[0], '<span class="modalP' . $match[1] . '"></span>', $message);
}
}
$this->tpl->addTemplateData($tpl_id, array(
'modal_id' => $this->modal_id,
'modal_title' => !empty($this->title) ? $this->title : psm_get_lang('system', 'title'),
'modal_body' => $message,
'?has_cancel' => $has_cancel,
'label_cancel' => psm_get_lang('system', 'cancel'),
'modal_button_type' => $button_type,
'modal_button_label'=> $button_label,
));
$html = $this->tpl->getTemplate($tpl_id);
return $html;
}
}

View File

@ -19,37 +19,19 @@
*
* @package phpservermon
* @author Pepijn Over <pep@neanderthal-technology.com>
* @author Jérôme Cabanis <jerome@lauraly.com>
* @copyright Copyright (c) 2008-2014 Pepijn Over <pep@neanderthal-technology.com>
* @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3
* @version Release: @package_version@
* @link http://www.phpservermonitor.org/
* @since phpservermon 3.0.0
**/
namespace psm\Util;
namespace psm\Util\Module;
/**
* PHPMailer is not using namespaces so unable to load files in autoloader.
*/
require_once(PSM_PATH_VENDOR . '/PHPMailer/class.phpmailer.php');
require_once(PSM_PATH_VENDOR . '/PHPMailer/class.smtp.php');
interface ModalInterface {
/**
* PSM Mailer utility
*
* The PHPMailer is an open source lib that can be found in vendor/PHPMailer.
*
* @see \PHPMailer
*/
class Mailer extends \PHPMailer {
public function __construct(\psm\Service\Template $tpl);
/**
* Open new PHPMailer
*
* @param boolean $exceptions
*/
function __construct($exceptions = false) {
parent::__construct($exceptions);
}
}
public function getModalID();
public function createHTML();
}

View File

@ -64,13 +64,32 @@ class HistoryGraph {
0 => $this->generateGraphUptime($server_id),
1 => $this->generateGraphHistory($server_id),
);
$info_fields = array(
'latency_avg' => '%01.4f',
'uptime' => '%01.3f%%',
);
foreach($graphs as $i => &$graph) {
// add subarray for info fields
$graph['info'] = array();
foreach($info_fields as $field => $format) {
if(!isset($graph[$field])) {
continue;
}
$graph['info'][] = array(
'label' => psm_get_lang('servers', $field),
'value' => sprintf($format, $graph[$field]),
);
}
}
$this->tpl->addTemplateDataRepeat($tpl_id, 'graphs', $graphs);
$this->tpl->addTemplateData(
$tpl_id,
array(
'label_server' => psm_get_lang('servers', 'server'),
'label_latency_avg' => psm_get_lang('servers', 'latency_avg'),
'day_format' => psm_get_lang('servers', 'chart_day_format'),
'long_date_format' => psm_get_lang('servers', 'chart_long_date_format'),
'short_date_format' => psm_get_lang('servers', 'chart_short_date_format'),
@ -86,55 +105,26 @@ class HistoryGraph {
* @param int $server_id
* @return array
*/
protected function generateGraphUptime($server_id) {
$uptimes = $this->db->select(PSM_DB_PREFIX.'servers_uptime' , array('server_id' => $server_id), null, '', 'date');
$last_date = 0;
$latency_avg = 0;
// Create the list of points and server down zones
$line = array();
$lines = array();
$down = array();
foreach ($uptimes as $uptime) {
$latency_avg += (float) $uptime['latency'];
$time = strtotime($uptime['date']) * 1000;
if($uptime['status']) {
// The server is up
$line[] = '[' . $time . ',' . round((float)$uptime['latency'], 4) . ']';
if($last_date) {
// Was down before.
// Record the first and last date as a string in the down array
$down[] = '[' . $last_date . ',' . $time . ']';
$last_date = 0;
}
}
else {
if(!$last_date) {
$last_date = $time;
}
}
}
if(!empty($line)) {
$lines[] = '[' . implode(',', $line) . ']';
}
if($last_date) {
$down[] = '[' . $last_date . ',0]';
}
$buttons = array();
$buttons[] = array('mode' => 'hour', 'label' => psm_get_lang('servers', 'hour'), 'class_active' => 'btn-info');
$buttons[] = array('mode' => 'day', 'label' => psm_get_lang('servers', 'day'));
$buttons[] = array('mode' => 'week', 'label' => psm_get_lang('servers', 'week'));
$data = array(
'title' => psm_get_lang('servers', 'chart_last_week'),
'latency_avg' => count($uptimes) > 0 ? round(($latency_avg / count($uptimes)), 4) : 0,
'server_lines' => sizeof($lines) ? '[' . implode(',', $lines) . ']' : '',
'server_down' => sizeof($down) ? '[' . implode(',', $down) . ']' : '',
'series' => "[{label: '".psm_get_lang('servers', 'latency')."'}]",
'plotmode' => 'hour',
'buttons' => $buttons,
'chart_id' => $server_id . '_uptime',
public function generateGraphUptime($server_id) {
$lines = array(
'latency' => array(),
);
$cb_if_up = function($uptime_record) {
return ($uptime_record['status'] == 1);
};
$records = $this->getRecords('uptime', $server_id);
$data = $this->generateGraphLines($records, $lines, $cb_if_up, 'latency', true);
$data['title'] = psm_get_lang('servers', 'chart_last_week');
$data['plotmode'] = 'hour';
$data['buttons'] = array();
$data['buttons'][] = array('mode' => 'hour', 'label' => psm_get_lang('servers', 'hour'), 'class_active' => 'btn-info');
$data['buttons'][] = array('mode' => 'day', 'label' => psm_get_lang('servers', 'day'));
$data['buttons'][] = array('mode' => 'week', 'label' => psm_get_lang('servers', 'week'));
// make sure to add chart id after buttons so its added to those tmeplates as well
$data['chart_id'] = $server_id . '_uptime';
return $data;
}
@ -143,41 +133,102 @@ class HistoryGraph {
* @param int $server_id
* @return array
*/
protected function generateGraphHistory($server_id) {
$uptimes = $this->db->select(PSM_DB_PREFIX.'servers_history' , array('server_id' => $server_id), null, '', 'date');
$last_date = 0;
// Create the list of points and server down zones
public function generateGraphHistory($server_id) {
$lines = array(
'latency_avg' => array(),
'latency_max' => array(),
'latency_min' => array(),
);
$server = $this->db->selectRow(PSM_DB_PREFIX.'servers', array('server_id' => $server_id), array('warning_threshold'));
$cb_if_up = function($uptime_record) use($server) {
return ($uptime_record['checks_failed'] < $server['warning_threshold']);
};
$records = $this->getRecords('history', $server_id);
// dont add uptime for now because we have no way to calculate accurate uptimes for archived records
$data = $this->generateGraphLines($records, $lines, $cb_if_up, 'latency_avg', false);
$data['title'] = psm_get_lang('servers', 'chart_history');
$data['plotmode'] = 'month';
$data['buttons'] = array();
$data['buttons'][] = array('mode' => 'week2', 'label' => psm_get_lang('servers', 'week'));
$data['buttons'][] = array('mode' => 'month', 'label' => psm_get_lang('servers', 'month'), 'class_active' => 'btn-info');
$data['buttons'][] = array('mode' => 'year', 'label' => psm_get_lang('servers', 'year'));
// make sure to add chart id after buttons so its added to those tmeplates as well
$data['chart_id'] = $server_id . '_history';
return $data;
}
/**
* Get all uptime/history records for a server
* @param string $type
* @param int $server_id
* @return array
*/
protected function getRecords($type, $server_id) {
if(!in_array($type, array('history', 'uptime'))) {
return array();
}
$records = $this->db->select(PSM_DB_PREFIX.'servers_'.$type , array('server_id' => $server_id), null, '', 'date');
return $records;
}
/**
* Generate data arrays for graphs
* @param array $records all uptime records to parse
* @param array $lines array with keys as line ids to prepare (key must be available in uptime records)
* @param callable $cb_if_up function to check if the server is up or down
* @param string $latency_avg_key which key from uptime records to use for calculating averages
* @param boolean $add_uptime add uptime calculation?
* @return array
*/
protected function generateGraphLines($records, $lines, $cb_if_up, $latency_avg_key, $add_uptime = false) {
$data = array();
// PLEASE NOTE: all times are in microseconds! because of javascript.
$last_date = 0;
$latency_avg = 0;
$series = array();
// lowest timestamp of the graph (start time)
$time_start = 0;
// highest timestamp of the graph (end time)
$time_end = 0;
// number of microseconds of downtime
$time_down = 0;
$down = array();
foreach ($uptimes as $uptime) {
// Create the list of points and server down zones
foreach ($records as $i => $uptime) {
$time = strtotime($uptime['date']) * 1000;
// keep track of highest timestamp to use as end-date for graphs
// keep track of lowest and highest timestamp to use as end-date for graphs
// and for calculating uptime
if($i == 0 || $time < $time_start) {
$time_start = $time;
}
if($time > $time_end) {
$time_end = $time;
}
$latency_avg += (float) $uptime['latency_avg'];
// use the first line to calculate average latency
$latency_avg += (float) $uptime[$latency_avg_key];
if($uptime['checks_failed'] == 0) {
if($cb_if_up($uptime)) {
// The server is up
foreach($lines as $key => &$value) {
// add the value for each of the different lines
if(isset($uptime[$key])) {
$value[] = '[' . $time . ',' . round((float)$uptime[$key], 4) . ']';
$value[] = '[' . $time . ',' . round((float) $uptime[$key], 4) . ']';
}
}
if($last_date) {
// Was down before.
// Record the first and last date as a string in the down array
$down[] = '[' . $last_date . ',' . $time . ']';
// add the number of microseconds of downtime to counter for %
$time_down += ($time - $last_date);
$last_date = 0;
}
} else {
@ -199,23 +250,17 @@ class HistoryGraph {
if($last_date) {
$down[] = '[' . $last_date . ',0]';
}
$buttons = array();
$buttons[] = array('mode' => 'week2', 'label' => psm_get_lang('servers', 'week'));
$buttons[] = array('mode' => 'month', 'label' => psm_get_lang('servers', 'month'), 'class_active' => 'btn-info');
$buttons[] = array('mode' => 'year', 'label' => psm_get_lang('servers', 'year'));
$data = array(
'title' => psm_get_lang('servers', 'chart_history'),
'latency_avg' => count($uptimes) > 0 ? round(($latency_avg / count($uptimes)), 4) : 0,
'server_lines' => sizeof($lines_merged) ? '[' . implode(',', $lines_merged) . ']' : '',
'server_down' => sizeof($down) ? '[' . implode(',', $down) . ']' : '',
'series' => sizeof($series) ? '[' . implode(',', $series) . ']' : '',
'plotmode' => 'month',
'end_timestamp' => $time_end ? $time_end : '',
'buttons' => $buttons,
// make sure to add chart id after buttons so its added to those tmeplates as well
'chart_id' => $server_id . '_history',
);
if($add_uptime && $time_end > $time_start) {
$data['uptime'] = 100 - (($time_down / ($time_end - $time_start)) * 100);
}
$data['latency_avg'] = count($records) > 0 ? ($latency_avg / count($records)) : 0;
$data['server_lines'] = sizeof($lines_merged) ? '[' . implode(',', $lines_merged) . ']' : '';
$data['server_down'] = sizeof($down) ? '[' . implode(',', $down) . ']' : '';
$data['series'] = sizeof($series) ? '[' . implode(',', $series) . ']' : '';
$data['end_timestamp'] = $time_end ? $time_end : '';
return $data;
}
}
}

View File

@ -0,0 +1,130 @@
<?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 Pepijn Over <pep@neanderthal-technology.com>
* @copyright Copyright (c) 2008-2014 Pepijn Over <pep@neanderthal-technology.com>
* @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3
* @version Release: @package_version@
* @link http://www.phpservermonitor.org/
* @since phpservermon 3.1.0
**/
namespace psm\Util\Server;
/**
* The ServerValidator helps you to check input data for servers.
*/
class ServerValidator {
/**
* Database service
* @var \psm\Service\Database $db
*/
protected $db;
public function __construct(\psm\Service\Database $db) {
$this->db = $db;
}
/**
* Check if the server id exists
* @param int $server_id
* @return boolean
* @throws \InvalidArgumentException
*/
public function serverId($server_id) {
$server = $this->db->selectRow(PSM_DB_PREFIX . 'servers', array('server_id' => $server_id), array('server_id'));
if(empty($server)) {
throw new \InvalidArgumentException('server_no_match');
}
return true;
}
/**
* Check label
* @param string $label
* @return boolean
* @throws \InvalidArgumentException
*/
public function label($label) {
$label = trim($label);
if(empty($label) || strlen($label) > 255) {
throw new \InvalidArgumentException('server_label_bad_length');
}
return true;
}
/**
* Check server domain/ip
* @param string $value
* @param string $type if given, it can be checked for "website"/"ip"
* @return boolean
* @throws \InvalidArgumentException
*/
public function ip($value, $type = null) {
$value = trim($value);
if(empty($value) || strlen($value) > 255) {
throw new \InvalidArgumentException('server_ip_bad_length');
}
switch($type) {
case 'website':
if(!filter_var($value, FILTER_VALIDATE_URL)) {
throw new \InvalidArgumentException('server_ip_bad_website');
}
break;
case 'service':
if(!filter_var($value, FILTER_VALIDATE_IP)) {
throw new \InvalidArgumentException('server_ip_bad_service');
}
break;
}
return true;
}
/**
* Check server type
* @param string $type
* @return boolean
* @throws \InvalidArgumentException
*/
public function type($type) {
if(!in_array($type, array('service', 'website'))) {
throw new \InvalidArgumentException('server_type_invalid');
}
return true;
}
/**
* Check warning threshold
* @param int $value
* @return boolean
* @throws \InvalidArgumentException
*/
public function warningThreshold($value) {
if(!is_numeric($value) || intval($value) == 0) {
throw new \InvalidArgumentException('server_warning_threshold_invalid');
}
return true;
}
}

View File

@ -223,39 +223,13 @@ class StatusNotifier {
return false;
}
// we have to build an userlist for the log table..
$userlist = array();
// open the right class
// not making this any more dynamic, because perhaps some gateways need custom settings (like Mollie)
switch(strtolower(psm_get_conf('sms_gateway'))) {
case 'mosms':
$sms = new \psm\Txtmsg\Mosms();
break;
case 'inetworx':
$sms = new \psm\Txtmsg\Inetworx();
break;
case 'mollie':
$sms = new \psm\Txtmsg\Mollie();
$sms->setGateway(1);
break;
case 'spryng':
$sms = new \psm\Txtmsg\Spryng();
break;
case 'clickatell':
$sms = new \psm\Txtmsg\Clickatell();
break;
case 'textmarketer':
$sms = new \psm\Txtmsg\Textmarketer();
break;
case 'smsglobal':
$sms = new \psm\Txtmsg\Smsglobal();
break;
$sms = psm_build_sms();
if(!$sms) {
return false;
}
// copy login information from the config file
$sms->setLogin(psm_get_conf('sms_gateway_username'), psm_get_conf('sms_gateway_password'));
$sms->setOriginator(psm_get_conf('sms_from'));
// we have to build an userlist for the log table..
$userlist = array();
// add all users to the recipients list
foreach ($users as $user) {

View File

@ -149,7 +149,9 @@ class StatusUpdater {
$status = ($fp === false) ? false : true;
$this->rtime = (microtime(true) - $starttime);
fclose($fp);
if(is_resource) {
fclose($fp);
}
// check if server is available and rerun if asked.
if(!$status && $run < $max_runs) {

View File

@ -1,13 +1,13 @@
<!--%tpl_config-->
<form class="form-horizontal" action="index.php?mod=config&action=save" id="edit_config" method="post">
<form class="form-horizontal" name="edit_config" action="index.php?mod=config&action=save" id="edit_config" method="post">
<ul class="nav nav-tabs">
<li class="active"><a href="#config-general" data-toggle="tab">{label_general}</a></li>
<li><a href="#config-email" data-toggle="tab">{label_tab_email}</a></li>
<li><a href="#config-sms" data-toggle="tab">{label_tab_sms}</a></li>
<li><a href="#config-logging" data-toggle="tab">{label_tab_log}</a></li>
<li class="{general_active}"><a href="#config-general" data-toggle="tab">{label_general}</a></li>
<li class="{email_active}"><a href="#config-email" data-toggle="tab">{label_tab_email}</a></li>
<li class="{sms_active}"><a href="#config-sms" data-toggle="tab">{label_tab_sms}</a></li>
<li class="{logging_active}"><a href="#config-logging" data-toggle="tab">{label_tab_log}</a></li>
</ul>
<div class="tab-content well">
<div id="config-general" class="tab-pane active">
<div id="config-general" class="tab-pane {general_active}">
<fieldset>
<legend>{label_general}</legend>
<div class="control-group">
@ -46,11 +46,11 @@
</div>
</div>
<div class="form-actions">
<button class="btn btn-success" type="submit">{label_save}</button>
<button class="btn btn-success" type="submit" name="general_submit">{label_save}</button>
</div>
</fieldset>
</div>
<div id="config-email" class="tab-pane">
<div id="config-email" class="tab-pane {email_active}">
<fieldset>
<legend>{label_settings_email}</legend>
<div class="control-group">
@ -94,12 +94,18 @@
<input type="password" id="email_smtp_password" name="email_smtp_password" value="{email_smtp_password}" maxlength="100" placeholder="{label_email_smtp_noauth}" />
</div>
</div>
<div class="control-group">
<div class="controls">
<button class="btn btn-primary show-modal" data-modal-id="testEmail">{label_test}</button>
<input type="hidden" name="test_email" value="0" />
</div>
</div>
<div class="form-actions">
<button class="btn btn-success" type="submit">{label_save}</button>
<button class="btn btn-success" type="submit" name="email_submit" >{label_save}</button>
</div>
</fieldset>
</div>
<div id="config-sms" class="tab-pane">
<div id="config-sms" class="tab-pane {sms_active}">
<fieldset>
<legend>{label_settings_sms}</legend>
<div class="control-group">
@ -118,6 +124,8 @@
<option value="clickatell" {sms_selected_clickatell}>{label_sms_gateway_clickatell}</option>
<option value="smsglobal" {sms_selected_smsglobal}>{label_sms_gateway_smsglobal}</option>
<option value="textmarketer" {sms_selected_textmarketer}>{label_sms_gateway_textmarketer}</option>
<option value="smsglobal" {sms_selected_smsglobal}>{label_sms_gateway_smsglobal}</option>
<option value="smsit" {sms_selected_smsit}>{label_sms_gateway_smsit}</option>
</select>
</div>
</div>
@ -139,12 +147,18 @@
<input type="text" id="sms_from" name="sms_from" value="{sms_from}" maxlength="255" />
</div>
</div>
<div class="control-group">
<div class="controls">
<button class="btn btn-primary show-modal" data-modal-id="testSMS">{label_test}</button>
<input type="hidden" name="test_sms" value="0" />
</div>
</div>
<div class="form-actions">
<button class="btn btn-success" type="submit">{label_save}</button>
<button class="btn btn-success" type="submit" name="sms_submit">{label_save}</button>
</div>
</fieldset>
</div>
<div id="config-logging" class="tab-pane">
<div id="config-logging" class="tab-pane {logging_active}">
<fieldset>
<legend>{label_settings_log}</legend>
<div class="control-group">
@ -158,7 +172,7 @@
<label class="checkbox"><input type="checkbox" id="log_sms" name="log_sms[]" {log_sms_checked} /> {label_log_sms}</label>
</div>
<div class="form-actions">
<button class="btn btn-success" type="submit">{label_save}</button>
<button class="btn btn-success" type="submit" name="logging_submit">{label_save}</button>
</div>
</fieldset>
</div>

View File

@ -7,6 +7,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, minimum-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<link rel="icon" type="image/png" href="favicon.png" />
{auto_refresh}
<!-- Le styles -->
<link href="static/plugin/twitter-bootstrap/css/bootstrap.min.css" rel="stylesheet">
@ -19,14 +21,8 @@
<script type="text/javascript" src="static/plugin/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="static/plugin/twitter-bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="static/js/scripts.js"></script>
<script type="text/javascript">
$(document).bind('ready', function(){
psm_flash_message();
psm_tooltips();
});
</script>
</head>
<body data-spy="scroll" data-target=".subnav" data-offset="50">
<body data-spy="scroll" data-target=".subnav" data-offset="50" class="{body_class}">
<!-- navbar -->
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
@ -43,28 +39,30 @@
</div>
<!-- /navbar -->
{html_modal}
<!-- container -->
<div class="container-fluid">
<div class="page-header">
<h1>{subtitle}</h1>
</div>
<div class="row-fluid">
<div id="main-container">
<div class="page-header">
<div class="header-label"><h1>{subtitle}</h1></div>
<div class="header-accessories">{header_accessories}</div>
</div>
<div id="main-content">
{html_sidebar}
<div class="span{content_span}">
<div id="page-container">
<div id="flashmessage" class="hide">
<!--%tpl_repeat_messages-->
<div class="alert alert-{shortcode}">
<p class="pull-left span1"><i class="icon-{icon}"></i></p>
<p>{message}</p>
</div>
<!--%%tpl_repeat_messages-->
{messages}
<!--%tpl_repeat_messages-->
<div class="alert alert-{shortcode}">
<p class="pull-left span1"><i class="icon-{icon}"></i></p>
<p>{message}</p>
</div>
<!--%%tpl_repeat_messages-->
{messages}
</div>
{content}
</div>
</div>
{html_footer}
</div>
</div>
<!-- /container -->
</body>
</html>
@ -80,7 +78,7 @@
<!--%%tpl_repeat_menu-->
{menu}
<li id="nav_option_help">
<a href="http://www.phpservermonitor.org/" target="_blank">{label_help}</a>
<a href="http://www.phpservermonitor.org/support" target="_blank">{label_help}</a>
</li>
</ul>
<ul class="nav pull-right">

View File

@ -0,0 +1,14 @@
<!--%tpl_main_modal_container-->
<div id="{modal_id}Modal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="{modal_id}ModalLabel" aria-hidden="true">
<div class="modal-header">
<h3 id="{modal_id}ModalLabel">{modal_title}</h3>
</div>
<div class="modal-body">
<p>{modal_body}</p>
</div>
<div class="modal-footer">
<!--?has_cancel--><button class="btn btn-default" data-dismiss="modal" aria-hidden="true">{label_cancel}</button><!--??has_cancel-->
<button class="btn btn-{modal_button_type} modalOKButton" >{modal_button_label}</button>
</div>
</div>
<!--%%tpl_main_modal_container-->

View File

@ -1,5 +1,5 @@
<!--%tpl_main_sidebar_container-->
<div class="span2">
<div id="sidebar-container">
<div class="sidebar-nav">
<ul class="nav nav-list">
<li class="nav-header">{subtitle}</li>

View File

@ -28,12 +28,13 @@
<div class="info-content">
<div class="info-dropdown btn-group">
<button class="btn dropdown-toggle" data-toggle="dropdown"><i class="icon-info-sign"></i></button>
<ul class="dropdown-menu">
<li><span>{label_latency_avg}: {latency_avg}</span></li>
</ul>
<!--%tpl_repeat_info-->
<li><span>{label}: {value}</span></li>
<!--%%tpl_repeat_info-->
<ul class="dropdown-menu">{info}</ul>
</div>
<div class="server-info">
{label_latency_avg}: {latency_avg}<br/>
<ul>{info}</ul>
</div>
</div>
<div class="chart-selector">

View File

@ -5,7 +5,7 @@
<li><a href="#log_email_content" data-toggle="tab">{label_email}</a></li>
<li><a href="#log_sms_content" data-toggle="tab">{label_sms}</a></li>
</ul>
<div class="tab-content">
<div class="tab-content well">
<div class="tab-pane active" id="log_status_content">
{content_status}
</div>
@ -22,30 +22,50 @@
<!--%tpl_server_log_entries-->
<!-- {logtitle} -->
<table class="table table-bordered table-striped">
<colgroup>
<col />
<col />
<col style="width: 135px" />
<col />
</colgroup>
<thead>
<tr>
<th>{label_server}</th>
<th>{label_message}</th>
<th>{label_date}</th>
<th>{label_users}</th>
<th class="hidden-phone">{label_server}</th>
<th class="hidden-phone">{label_message}</th>
<th class="hidden-phone">{label_date}</th>
<!--?has_users--><th class="hidden-phone">{label_users}</th><!--??has_users-->
</tr>
</thead>
<tbody>
<!--%tpl_repeat_entries-->
<tr class="{class}">
<td>{server}</td>
<td>{message}</td>
<td>{datetime_format}</td>
<td>{users}</td>
</tr>
<!--%%tpl_repeat_entries-->
{entries}
<!--%tpl_repeat_entries-->
<tr class="{class}">
<td>
<div class="table-body">
<div class="table-cell">
<div class="visible-phone pull-right">
&nbsp;{datetime_format}
</div>
<i class="{type_icon}" title="{type_title}"></i> <span class="title">{server}</span> {ip}
</div>
</div>
<div class="visible-phone">
<div class="table-separator"/></div>
<div class="table-body">
<div class="table-cell-details">{message}</div>
</div>
</div>
<!--?has_users--><div class="visible-phone">
<div class="table-separator"/></div>
<div class="table-body">
<div class="table-cell-details">{label_users}: {user_list}</div>
</div>
</div><!--??has_users-->
</td>
<td class="hidden-phone">{message}</td>
<td class="hidden-phone tight">{datetime_format}</td>
<!--?has_users--><td class="hidden-phone tight">{users}</td><!--??has_users-->
</tr>
<!--%%tpl_repeat_entries-->
{entries}
<!--?no_logs-->
<tr class="{class}">
<td colspan="4" class="cell-center">{label_no_logs}</td>
</tr>
<!--??no_logs-->
</tbody>
</table>
<!--%%tpl_server_log_entries-->

View File

@ -2,38 +2,64 @@
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>&nbsp;</th>
<th>{label_label}</th>
<th>{label_domain}</th>
<th>{label_port}</th>
<th>{label_type}</th>
<th>{label_rtime}</th>
<th>{label_last_online}</th>
<th>{label_monitoring}</th>
<th>{label_send_email}</th>
<th>{label_send_sms}</th>
<th>{label_action}</th>
<th class="hidden-phone">&nbsp;</th>
<th class="hidden-phone">{label_label}</th>
<th class="hidden-phone">{label_domain}</th>
<th class="visible-desktop">{label_port}</th>
<th class="visible-desktop">{label_type}</th>
<th class="hidden-phone">{label_rtime}</th>
<th class="hidden-phone">{label_last_online}</th>
<th class="hidden-phone">{label_monitoring}</th>
<th class="visible-desktop">{label_email}</th>
<th class="visible-desktop">{label_sms}</th>
<th class="hidden-phone">{label_action}</th>
</tr>
</thead>
<tbody>
<!--%tpl_repeat_servers-->
<tr>
<td>
<span class="label label-status-{status}">
<a href="{url_view}" title="{error}">{status}</a>
</span>
<td class="hidden-phone"><div class="table-cell-title"><span class="label label-status-{status}"><a href="{url_view}" title="{error}">{status}</a></span></div></td>
<td class="hidden-phone"><div class="table-cell-title"><a href="{url_view}">{label}</a></div></td>
<td class="nowrap visible-tablet"><div class="table-cell-title"><i class="{type_icon}" title="{type}"></i> {ip_short}</div></td>
<td class="nowrap visible-desktop"><div class="table-cell-title">{ip}</div></td>
<td class="nowrap visible-desktop"><div class="table-cell-title">{port}</div></td>
<td class="nowrap visible-desktop"><div class="table-cell-title">{type}</div></td>
<td class="nowrap hidden-phone"><div class="table-cell-title">{rtime} s</div></td>
<td class="nowrap hidden-phone"><div class="table-cell-title">{last_online}</div></td>
<td class="tight visible-tablet"><div class="table-cell-title"><i class="{active_icon}" title="{active_title}"></i> <i class="{email_icon}" title="{label_email}"></i> <i class="{sms_icon}" title="{label_sms}"></i></div></td>
<td class="tight visible-desktop"><div class="table-cell-title">{active}</div></td>
<td class="tight visible-desktop"><div class="table-cell-title">{email}</div></td>
<td class="tight visible-desktop"><div class="table-cell-title">{sms}</div></td>
<td class="tight hidden-phone">
<div class="table-cell-title">
<a class="btn btn-small" href="index.php?mod=server&amp;action=view&amp;id={server_id}"><i class="icon-chart"></i></a>
{html_actions}
</div>
</td>
<td class="visible-phone">
<div class="table-body">
<div class="table-cell-title">
<span class="label label-status-{status}"><a href="{url_view}" title="{error}">{status}</a></span>
<a class="title" href="{url_view}">{label}</a>
</div>
<div class="table-cell tight">
&nbsp;<a class="btn btn-small" href="index.php?mod=server&amp;action=view&amp;id={server_id}"><i class="icon-chart"></i></a>
{html_actions}
</div>
</div>
<div class="table-body">
<div class="table-row">
<div class="table-cell"><i class="{type_icon}" title="{type}"></i> {ip_short}</div>
<div class="table-cell tight">
<i class="{active_icon}" title="{active_title}"></i> <i class="{email_icon}" title="{label_email}"></i> <i class="{sms_icon}" title="{label_sms}"></i>
</div>
</div>
</div>
<div class="table-body">
<div class="table-row"><div class="table-cell-details tight">{label_rtime}: &nbsp;</div><div class="table-cell-details">{rtime} s</div></div>
<div class="table-row"><div class="table-cell-details tight">{label_last_online}: &nbsp;</div><div class="table-cell-details">{last_online}</div></div>
</div>
</td>
<td><a href="{url_view}">{label}</a></td>
<td>{ip}</td>
<td>{port}</td>
<td>{type}</td>
<td>{rtime} s</td>
<td>{last_online}</td>
<td>{active}</td>
<td>{email}</td>
<td>{sms}</td>
<td><a class="btn btn-small" href="index.php?mod=server&amp;action=view&amp;id={server_id}"><i class="icon-eye-open"></i></a>
{html_actions}</td>
</tr>
<!--%%tpl_repeat_servers-->
{servers}
@ -45,7 +71,7 @@
<a class="btn btn-small" href="index.php?mod=server&amp;action=edit&amp;id={server_id}" title="{label_edit}">
<i class="icon-pencil"></i>
</a>
<a class="btn btn-small btn-danger" href="javascript:sm_delete('{server_id}', 'server');" title="{label_delete}">
<a class="btn btn-small btn-danger show-modal" href="index.php?mod=server&action=delete&id={server_id}" title="{label_delete}" data-modal-id="delete" data-modal-param="{label}">
<i class="icon-remove icon-white"></i>
</a>
<!--%%tpl_server_list_admin_actions-->

View File

@ -1,43 +1,73 @@
<!--%tpl_server_status-->
<style type="text/css">
body {
background: black;
}
.page-header {
border-bottom: 0;
}
h2, p {
margin: 0;
padding: 0;
}
h2 {
margin-bottom: 10px;
}
</style>
<div class="entity-container">
<!--%tpl_repeat_servers_offline-->
<div class="offline">
<div class="entity {class_warning}" onclick="window.location.href='{url_view}'">
<h2>{label}</h2>
<p>{label_last_online}: {last_online_nice}</p>
<p>{label_last_check}: {last_checked_nice}</p>
<div class="tab-content">
<div id="flow-layout" class="tab-pane {block_layout_active}">
<div class="entity-container">
<!--%tpl_repeat_servers_offline-->
<div class="offline">
<div class="entity {class_warning}" onclick="window.location.href='{url_view}'">
<h2>{label}</h2>
<p>{label_last_online}: {last_online_nice}</p>
<p>{label_last_check}: {last_checked_nice}</p>
</div>
</div>
<!--%%tpl_repeat_servers_offline-->
{servers_offline}
<!--%tpl_repeat_servers_online-->
<div class="online">
<div class="entity" onclick="window.location.href='{url_view}'">
<h2>{label}</h2>
<p>{label_last_online}: {last_online_nice}</p>
<p>{label_rtime}: {rtime}s</p>
</div>
</div>
<!--%%tpl_repeat_servers_online-->
{servers_online}
</div>
</div>
<!--%%tpl_repeat_servers_offline-->
{servers_offline}
<!--%tpl_repeat_servers_online-->
<div class="online">
<div class="entity" onclick="window.location.href='{url_view}'">
<h2>{label}</h2>
<p>{label_last_online}: {last_checked_nice}</p>
<p>{label_rtime}: {rtime}s</p>
<div id="list-layout" class="tab-pane {list_layout_active}">
<div class="entity-container">
<table class="table table-bordered">
<tbody>
<!--%tpl_repeat_servers_offline2-->
<tr class="row-offline" onclick="window.location.href='{url_view}'">
<td class="{class_warning}"><div class="server-name">{label}</div>
<div class="visible-phone">
<div class="table-body">
<div class="table-row"><div class="table-cell-details tight">{label_last_online}: &nbsp;</div><div class="table-cell-details">{last_online_nice}</div></div>
<div class="table-row"><div class="table-cell-details tight">{label_last_check}: &nbsp;</div><div class="table-cell-details">{last_checked_nice}</div></div>
</div>
</div>
</td>
<td class="{class_warning} hidden-phone">{label_last_online}: {last_online_nice}</td>
<td class="{class_warning} hidden-phone">{label_last_check}: {last_checked_nice}</td>
</tr>
<!--%%tpl_repeat_servers_offline2-->
{servers_offline2}
<!--%tpl_repeat_servers_online2-->
<tr class="row-online" onclick="window.location.href='{url_view}'">
<td><div class="server-name">{label}</div>
<div class="visible-phone">
<div class="table-body">
<div class="table-row"><div class="table-cell-details tight">{label_last_online}: &nbsp;</div><div class="table-cell-details">{last_online_nice}</div></div>
<div class="table-row"><div class="table-cell-details tight">{label_rtime}: &nbsp;</div><div class="table-cell-details">{rtime}</div></div>
</div>
</div>
</td>
<td class="hidden-phone">{label_last_online}: {last_online_nice}</td>
<td class="hidden-phone">{label_rtime}: {rtime}s</td>
</tr>
<!--%%tpl_repeat_servers_online2-->
{servers_online2}
</tbody>
</table>
</div>
</div>
<!--%%tpl_repeat_servers_online-->
{servers_online}
</div>
<!--%%tpl_server_status-->
<!--%%tpl_server_status-->
<!--%tpl_status_layout_selector-->
<div class="btn-group" data-toggle="buttons-radio">
<button class="btn {block_layout_active}" data-toggle="tab" data-target="#flow-layout" onclick="psm_saveLayout(0)"><i class="icon-th-large"></i></button>
<button class="btn {list_layout_active}" data-toggle="tab" data-target="#list-layout" onclick="psm_saveLayout(1)"><i class="icon-th-list"></i></button>
</div>
<!--%%tpl_status_layout_selector-->

View File

@ -60,11 +60,11 @@
<td>{active}</td>
</tr>
<tr>
<td>{label_send_email}:</td>
<td>{label_email}:</td>
<td>{email}</td>
</tr>
<tr>
<td>{label_send_sms}:</td>
<td>{label_sms}:</td>
<td>{sms}</td>
</tr>
{html_actions}
@ -75,12 +75,12 @@
<!--%tpl_server_view_admin_actions-->
<tr>
<td>&nbsp;</td>
<td>
<td class="hidden-small">&nbsp;</td>
<td class="action-small" colspan="2">
<a class="btn btn-success" href="{url_edit}">
<i class="icon-edit icon-white"></i>&nbsp;{label_edit}
</a>
<a class="btn btn-danger" href="javascript:sm_delete('{server_id}', 'server');">
<a class="btn btn-danger show-modal" href="{url_delete}" data-modal-id="delete" data-modal-param="{server_name}">
<i class="icon-remove icon-white"></i>&nbsp;{label_delete}
</a>
</td>

View File

@ -2,15 +2,15 @@
<form class="form-horizontal well" action="{form_action}" method="post">
<fieldset>
<div class="control-group">
<label class="control-label" for="name">{label_name}</label>
<label class="control-label" for="user_name">{label_user_name}</label>
<div class="controls">
<input type="text" id="name" name="name" value="{name}" maxlength="255" required>
<input type="text" id="user_name" name="user_name" value="{user_name}" maxlength="64" required autofocus=>
</div>
</div>
<div class="control-group">
<label class="control-label" for="user_name">{label_user_name}</label>
<label class="control-label" for="name">{label_name}</label>
<div class="controls">
<input type="text" id="user_name" name="user_name" value="{user_name}" maxlength="64" required>
<input type="text" id="name" name="name" value="{name}" maxlength="255" required>
</div>
</div>
<div class="control-group">
@ -29,18 +29,18 @@
<input type="password" id="password_repeat" name="password_repeat" maxlength="255" placeholder="{placeholder_password}" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="mobile">{label_mobile}</label>
<div class="controls">
<input type="text" id="mobile" name="mobile" value="{mobile}" maxlength="15" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="email">{label_email}</label>
<div class="controls">
<input type="text" id="email" name="email" value="{email}" maxlength="255" required>
</div>
</div>
<div class="control-group">
<label class="control-label" for="mobile">{label_mobile}</label>
<div class="controls">
<input type="text" id="mobile" name="mobile" value="{mobile}" maxlength="15" />
</div>
</div>
<div class="form-actions">
<button class="btn btn-success" type="submit">{label_save}</button>
</div>

View File

@ -2,29 +2,56 @@
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>{label_name}</th>
<th>{label_user_name}</th>
<th>{label_level}</th>
<th>{label_mobile}</th>
<th>{label_email}</th>
<th>{label_servers}</th>
<th width="75">{label_action}</th>
<th class="hidden-phone">{label_user}</th>
<th class="visible-desktop">{label_name}</th>
<th class="visible-desktop">{label_level}</th>
<th class="hidden-phone">{label_email}</th>
<th class="hidden-phone">{label_mobile}</th>
<th class="hidden-phone">{label_servers}</th>
<th class="hidden-phone tight">{label_action}</th>
</tr>
</thead>
<tbody>
<!--%tpl_repeat_users-->
<tr>
<td>{name}</td>
<td>{user_name}</td>
<td>{label_level_{level}}</td>
<td>{mobile}</td>
<td>{email}</td>
<td>{emp_servers}</td>
<td>
<div class="table-body">
<div class="table-cell-title">
<span class="nowrap">
<span class="hidden-desktop"><i class="{icon_level_{level}}" title="{label_level_{level}}"></i>&nbsp;</span>
<span class="title">{user_name}</span>
</span>
<span class="hidden-desktop">({name})</span>
</div>
<div class="table-cell tight">
<div class="visible-phone">
<a class="btn btn-small" href="index.php?mod=user&amp;action=edit&amp;id={user_id}" title="{label_edit}">
<i class="icon-pencil"></i>
</a>
<a class="btn btn-small btn-danger show-modal" href="index.php?mod=user&action=delete&id={user_id}" title="{label_delete}" data-modal-id="delete" data-modal-param="{user_name}">
<i class="icon-remove icon-white"></i>
</a>
</div>
</div>
</div>
<div class="visible-phone">
<div class="table-body">
<div class="table-row"><div class="table-cell-details tight">{label_email}:&nbsp;</div><div class="table-cell-details">{email}</div></div>
<div class="table-row"><div class="table-cell-details tight">{label_mobile}:&nbsp;</div><div class="table-cell-details">{mobile}</div></div>
<div class="table-row"><div class="table-cell-details tight">{label_servers}:&nbsp;</div><div class="table-cell-details">{emp_servers}</div></div>
</div>
</div>
</td>
<td class="visible-desktop nowrap"><div class="table-cell-title">{name}</div></td>
<td class="visible-desktop tight"><div class="table-cell-title">{label_level_{level}}</div></td>
<td class="hidden-phone tight"><div class="table-cell-title">{email}</div></td>
<td class="hidden-phone tight"><div class="table-cell-title">{mobile}</div></td>
<td class="hidden-phone"><div class="table-cell-title">{emp_servers}</div></td>
<td class="hidden-phone tight">
<a class="btn btn-small" href="index.php?mod=user&amp;action=edit&amp;id={user_id}" title="{label_edit}">
<i class="icon-pencil"></i>
</a>
<a class="btn btn-small btn-danger" href="javascript:sm_delete('{user_id}', 'user');" title="{label_delete}">
<a class="btn btn-small btn-danger show-modal" href="index.php?mod=user&action=delete&id={user_id}" title="{label_delete}" data-modal-id="delete" data-modal-param="{user_name}">
<i class="icon-remove icon-white"></i>
</a>
</td>
@ -39,18 +66,18 @@
<form class="form-horizontal well" action="index.php?mod=user&amp;action=save&amp;id={edit_user_id}" method="post">
<fieldset>
<legend>{titlemode}</legend>
<div class="control-group">
<label class="control-label" for="name">{label_name}</label>
<div class="controls">
<input type="text" id="name" name="name" value="{edit_value_name}" maxlength="255" required>
</div>
</div>
<div class="control-group">
<label class="control-label" for="user_name">{label_user_name}</label>
<div class="controls">
<input type="text" id="user_name" name="user_name" value="{edit_value_user_name}" maxlength="64" required>
</div>
</div>
<div class="control-group">
<label class="control-label" for="name">{label_name}</label>
<div class="controls">
<input type="text" id="name" name="name" value="{edit_value_name}" maxlength="255" required>
</div>
</div>
<div class="control-group">
<label class="control-label" for="level">{label_level}</label>
<div class="controls">
@ -77,18 +104,18 @@
<input type="password" id="password_repeat" name="password_repeat" maxlength="255" placeholder="{placeholder_password}" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="mobile">{label_mobile}</label>
<div class="controls">
<input type="text" id="mobile" name="mobile" value="{edit_value_mobile}" maxlength="15" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="email">{label_email}</label>
<div class="controls">
<input type="text" id="email" name="email" value="{edit_value_email}" maxlength="255" required>
</div>
</div>
<div class="control-group">
<label class="control-label" for="mobile">{label_mobile}</label>
<div class="controls">
<input type="text" id="mobile" name="mobile" value="{edit_value_mobile}" maxlength="15" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="servers[]">{label_servers}</label>
<div class="controls">

View File

@ -1,3 +1,7 @@
#main-container {
overflow: hidden;
}
#history-panel {
width: 100%;
max-width: 1100px;
@ -39,6 +43,10 @@
padding-top: 40px;
height: 200px;
}
.server-info ul {
list-style: none;
margin: 0;
}
.chart-selector {
}
@ -47,11 +55,11 @@
.chart-container {
margin-right: 0;
}
.chart-content {
margin-right: 0;
}
.info-container {
float: none;
clear: both;
@ -62,11 +70,11 @@
display: block;
float: left;
}
.server-info {
display: none;
}
.chart-selector {
float: right;
}

View File

@ -10,6 +10,19 @@ body {
-ms-user-select: none;
user-select: none;
}
body.black_background {
background: black;
}
body.black_background .page-header {
border-bottom: 0;
}
body.black_background .page-header h1 {
color: #888;
}
.navbar-fixed-top {
position: fixed;
margin: 0;
@ -28,30 +41,141 @@ body {
background-color: #444;
}
#main-container {
padding-left: 20px;
padding-right: 20px;
}
#main-content {
display: table;
width: 100%;
}
#sidebar-container {
display: table-cell;
vertical-align: top;
width: 1px;
white-space: nowrap;
}
#page-container {
display: table-cell;
vertical-align: top;
}
.powered {
display: inline-block;
white-space: nowrap;
}
.page-header {
display: table;
width: 100%;
}
.header-label {
display: table-cell;
}
.header-accessories {
display: table-cell;
white-space: nowrap;
text-align: right;
}
.header-accessories .btn-group {
display: inline-block;
vertical-align: bottom;
}
table {
background-color: white;
}
fieldset {
display: inline-block;
}
.tab-content {
display: block;
width: auto;
padding-top: 10px;
padding-top: 0;
padding-bottom: 0;
}
.tab-content.well {
padding-top: 19px;
}
.nav-tabs {
position: relative;
top: 1px;
margin-left: 10px;
margin-bottom: 0;
border: 0;
}
.nav-tabs > .active > a, .nav-tabs > .active > a:hover {
background-color: whiteSmoke;
background-color: #f5f5f5;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
}
.nav-tabs > li > a, .nav-tabs > li > a:hover {
padding: 8px 8px;
}
/* Tables */
.align-middle {
vertical-align: middle;
}
.tight {
width: 10px;
white-space: nowrap;
}
.nowrap {
white-space: nowrap;
}
.table-body {
display: table;
width: 100%;
}
.table-row {
display: table-row
}
.table-cell {
display: table-cell;
vertical-align: top;
}
.table-cell-title {
display: table-cell;
vertical-align: middle;
height: 32px;
}
.table-cell-title .label {
position: relative;
top: -2px;
}
.table-separator {
margin: 4px 0;
border-top: 1px solid #EEE;
border-bottom: 1px solid #FFF;
}
td.cell-center {
text-align: center;
}
@media (max-width: 767px) {
.table-cell .title, .table-cell-title .title {
font-size: 1.1em;
font-weight: bold;
}
}
.table-cell-details {
display: table-cell;
font-size: 11px;
font-style: italic;
line-height: 13px;
}
/* Form */
legend {
margin-top: 0px;
margin-bottom: 0px;
}
.form-horizontal .control-label {
@ -72,6 +196,7 @@ legend {
color: #666;
}
/* Status page */
.offline, .online {
display: inline-block;
width: 100%;
@ -86,6 +211,13 @@ legend {
margin-bottom: 20px;
cursor: pointer;
}
.entity h2 {
margin-bottom: 10px;
}
.entity p {
margin: 0;
padding: 0;
}
.offline .entity {
background: #a00000;
color: #f7cece;
@ -101,15 +233,67 @@ legend {
color: #d8f7ce;
border: 2px solid #d8f7ce;
}
.entity-container table td {
padding: 6px 8px;
vertical-align: middle;
}
.row-offline, .row-online {
cursor: pointer;
}
.row-offline td, .row-offline tr:hover td {
background: #a00000 !important;
color: #f7cece;
}
.row-offline td.warning, .row-offline tr:hover tr.warning {
background: #FAA732 !important;
color: #F3F3B1;
}
.row-online td, .row-online tr:hover td {
background: #53a000 !important;
color: #d8f7ce;
}
.entity-container .server-name {
display: inline-block;
font-size: 1.15em;
line-height: 18px;
font-weight: bold;
white-space: nowrap;
}
.visible-small {
display: none;
}
td.visible-desktop, th.visible-desktop,
td.hidden-phone, th.hidden-phone,
td.hidden-tablet, th.hidden-tablet {
display: table-cell;
}
span.visible-desktop, span.visible-desktop,
span.hidden-phone, span.hidden-phone,
span.hidden-tablet, span.hidden-tablet {
display: inline-block;
}
span.visible-phone, span.visible-phone,
span.visible-tablet, span.visible-tablet,
span.hidden-desktop, span.hidden-desktop {
display: none;
}
@media (min-width: 980px) {
.hidden-desktop {
display: none !important;
}
}
@media (max-width: 979px) {
#sidebar-container {
display: table-row;
}
#page-container {
display: table-row;
}
.sidebar-nav .nav-list {
padding: 0;
}
@ -126,14 +310,49 @@ legend {
.visible-desktop {
display: none !important;
}
.tab-content {
.tab-content.well {
padding-left: 10px;
padding-right: 10px;
}
}
@media (max-width: 767px) {
td.visible-phone, th.visible-phone,
td.hidden-desktop, th.hidden-desktop {
display: table-cell;
}
span.visible-phone, span.visible-phone,
span.hidden-desktop, span.hidden-desktop {
display: inline-block;
}
td.hidden-phone, th.hidden-phone,
td.visible-desktop, th.visible-desktop {
display: none;
}
span.hidden-phone, span.hidden-phone,
span.visible-desktop, span.visible-desktop {
display: none;
}
}
@media (min-width: 768px) and (max-width: 979px) {
td.visible-tablet, th.visible-tablet,
td.hidden-desktop, th.hidden-desktop {
display: table-cell;
}
span.visible-tablet, span.visible-tablet,
span.hidden-desktop, span.hidden-desktop {
display: inline-block;
}
td.hidden-tablet, th.hidden-tablet,
td.visible-desktop, th.visible-desktop {
display: none;
}
span.hidden-tablet, span.hidden-tablet,
span.visible-desktop, span.visible-desktop {
display: none;
}
}
@media (max-width: 479px) {
.container-fluid {
#main-container, .container-fluid {
padding-left: 10px;
padding-right: 10px;
}
@ -151,18 +370,34 @@ legend {
.entity {
margin: 0 10px 20px 10px;
}
.hidden-small {
display: none !important;
}
.action-small {
text-align: center !important;
background-color: white;
}
.visible-small {
display: block;
}
td.visible-small {
display: table-cell;
}
}
body.install{
padding-top:20px;
}
.label-status-on{
.label-status-on, .label-status-off, .label-status-warning {
vertical-align: baseline;
}
.label-status-on {
background-color: #468847;
}
.label-status-off{
.label-status-off {
background-color: #B94A48;
}
.label-status-warning{
.label-status-warning {
background-color: #FAA732;
}
.label a{
@ -230,4 +465,98 @@ legend{
.oce-first{
background-color:#eee;
}
}
/* Bootstrap 2.3.2 added icons */
.icon-hdd {
background-position: 0 -144px;
}
.icon-bullhorn {
background-position: -24px -144px;
}
.icon-bell {
background-position: -48px -144px;
}
.icon-certificate {
background-position: -72px -144px;
}
.icon-thumbs-up {
background-position: -96px -144px;
}
.icon-thumbs-down {
background-position: -120px -144px;
}
.icon-hand-right {
background-position: -144px -144px;
}
.icon-hand-left {
background-position: -168px -144px;
}
.icon-hand-up {
background-position: -192px -144px;
}
.icon-hand-down {
background-position: -216px -144px;
}
.icon-circle-arrow-right {
background-position: -240px -144px;
}
.icon-circle-arrow-left {
background-position: -264px -144px;
}
.icon-circle-arrow-up {
background-position: -288px -144px;
}
.icon-circle-arrow-down {
background-position: -312px -144px;
}
.icon-globe {
background-position: -336px -144px;
}
.icon-wrench {
background-position: -360px -144px;
}
.icon-tasks {
background-position: -384px -144px;
}
.icon-filter {
background-position: -408px -144px;
}
.icon-briefcase {
background-position: -432px -144px;
}
.icon-fullscreen {
background-position: -456px -144px;
}
/* personal added icons */
.icon-chart {
background-position: 0px -168px;
}
.icon-mobile {
background-position: -24px -168px;
}
.icon-admin {
background-position: -48px -168px;
}

View File

@ -1,9 +1,74 @@
function sm_delete(id, mod) {
var del = confirm("Are you sure you want to delete this record?");
if (del === true) {
var loc = 'index.php?action=delete&id=' + id + '&mod=' + mod;
window.location = loc;
}
$().ready(function() {
$('.show-modal').click(function (e) {
var $this = $(this);
if ($this.is('a')) {
e.preventDefault();
}
var $modal_id = $this.attr('data-modal-id') || 'main';
var $modal = $('#' + $modal_id + 'Modal');
if($modal.length) {
$modal.find('.modalOKButton').data('modal-origin', $this);
var param = $this.attr('data-modal-param');
if(param) {
var ary = param.split(',');
for (var index = 0; index < ary.length && index < 9; ++index) {
var value = ary[index];
$($modal).find('span.modalP' + (index+1)).text(value);
}
}
scroll(0, 0);
$modal.modal('show');
} else {
// Just in case we forgot the dialog box
var conf = confirm("Are you sure?");
if (conf === true) {
window.location = href;
}
}
return false;
});
$('.modalOKButton').click(function(e) {
var $this = $(this);
var $origin = $this.data('modal-origin');
if ($origin.is('a')) {
window.location = $origin.attr('href');
} else {
$origin.next('input[type=hidden]').attr('value', 1);
$origin.closest('form').submit();
}
return false;
});
psm_flash_message();
psm_tooltips();
});
function psm_xhr(mod, params, method, on_complete, options) {
method = (typeof method == 'undefined') ? 'GET' : method;
var xhr_options = {
data: params,
type: method,
success: on_complete,
error: function(jqjqXHR, textStatus, errorThrown) {
psm_flash_message(errorThrown);
}
};
$.extend(xhr_options, options);
var result = $.ajax('index.php?xhr=1&mod=' + mod, xhr_options);
return result;
}
function psm_saveLayout(layout) {
var params = {
action: 'saveLayout',
layout: layout
};
psm_xhr('server_status', params, 'POST');
}
function psm_tooltips() {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 29 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff