removing sidebar from config page;

moving update message to the footer and adding new version number

changing CHANGELOG to markdown format

changing template directory structure to match module structure
This commit is contained in:
Pepijn Over 2014-03-31 22:03:12 +02:00
parent 9fc6c60f9b
commit a120c877bb
28 changed files with 170 additions and 168 deletions

View File

@ -1,78 +0,0 @@
#########################
#
# Version 2.2.0
# ?, 2014
#
#########################
- New project url: http://www.phpservermonitor.org
- Added user login system with 2 user levels (administrator and regular user).
- Added warning threshold option (set number of failed checks before server goes offline).
- Added SMTP support.
- Adding Bulgarian language file (thanks to Plamen Vasilev).
- Added user profile page.
- Added history tracking of server uptime.
- Added history graphs of server uptime and latency (thanks to Jérôme Cabanis).
- Date and time formats are taken from language file and localized per language (thanks to Jérôme Cabanis).
- When checking a website, the updater will now follow 302 Location headers.
- String/pattern search on websites did not work for websites with compression turned on.
- Switched from mysql_* to PDO.
- Updated PHPMailer package to v5.2.6.
- Fixed several XSS vulnerabilities.
#########################
#
# Version 2.1.0
# February 8, 2014
#
#########################
- Merged PHP Server Monitor Plus project by Luiz Alberto S. Ribeiro (https://github.com/madeinnordeste/PHP-Server-Monitor-Plus).
-- New layout (thanks to twitter bootstrap)
- New install module.
- Regex search on website has been added by Paul Feakins.
- Support for mosms provider by Andreas Ek.
- Support for Textmarketer provider by Perri Vardy-Mason.
- Language files are now automatically detected, instead of a hardcoded list.
- Adding Korean language file (thanks to Ik-Jun).
- Adding Portuguese / Brazilian language file (thanks to Luiz Alberto S. Ribeiro).
- Large status page by Michael Greenhill.
- New config file (see install instructions in README).
- Cronjob will be prevented from running multiple times at the same time (with a 10 mins timeout).
#########################
#
# Version 2.0.1
# October 29, 2011
#
#########################
- Adding German language file (thanks to Brunbaur Herbert).
- Adding French language file (thanks to David Ribeiro).
- classes/sm/smUpdaterStatus.class.php: the curl option CURLOPT_CUSTOMREQUEST has been changed to CURLOPT_NOBODY.
- Servers page: auto refresh can be configured at the config page.
- Servers page: if the server is a website, the "Domain/Ip" field will be a link to the website.
- New text message gateway: Clickatell.com (thanks to Simon).
- If cURL is not installed, the install.php script will throw an error.
- HTTP status codes 5xx will also be treated as error.
#########################
#
# Version 2.0.0
# October 19, 2009
#
#########################
- Server type ("service" or "website").
- Different types of notification.
- New text message gateways.
- Code rewrite.
- New layout.
- Check for updates function.
#########################
#
# Version 1.0.1
# September 18, 2008
#
#########################
- log.php
- tpl/log.tpl.html
- Select order by clause used datetime field after DATE_FORMAT had been performed,
resulting in a wrong list of log entries shown.

70
CHANGELOG.md Executable file
View File

@ -0,0 +1,70 @@
# PHP Server Monitor
## Changelog
### v2.2.0 (not yet released, 2014)
* New module structure (not backwards compatible).
* Template directory restructured to correspond with module structure.
* Added user login system with 2 user levels (administrator and regular user).
* Added warning threshold option (set number of failed checks before server goes offline).
* Added SMTP support.
* Adding Bulgarian language file (thanks to Plamen Vasilev).
* Added user profile page.
* Added history tracking of server uptime.
* Added history graphs of server uptime and latency (thanks to Jérôme Cabanis).
* Status page is now default homepage.
* Updated French translation.
* Date and time formats are taken from language file and localized per language (thanks to Jérôme Cabanis).
* When checking a website, the updater will now follow 302 Location headers.
* String/pattern search on websites did not work for websites with compression turned on.
* Switched from mysql_* to PDO.
* Updated PHPMailer package to v5.2.6.
* Fixed several XSS vulnerabilities.
* Project website updated to <http://www.phpservermonitor.org>
### v2.1.0 (released February 8, 2014)
* PHP 5.3+ required
* Merged PHP Server Monitor Plus project by Luiz Alberto S. Ribeiro (<https://github.com/madeinnordeste/PHP-Server-Monitor-Plus>).
* New layout (thanks to twitter bootstrap)
* New install module.
* Regex search on website has been added by Paul Feakins.
* Support for mosms provider by Andreas Ek.
* Support for Textmarketer provider by Perri Vardy-Mason.
* Language files are now automatically detected, instead of a hardcoded list.
* Adding Korean language file (thanks to Ik-Jun).
* Adding Portuguese / Brazilian language file (thanks to Luiz Alberto S. Ribeiro).
* Large status page by Michael Greenhill.
* New config file (see install instructions in README).
* Cronjob will be prevented from running multiple times at the same time (with a 10 mins timeout).
### v2.0.1 (released October 29, 2011)
* Adding German language file (thanks to Brunbaur Herbert).
* Adding French language file (thanks to David Ribeiro).
* classes/sm/smUpdaterStatus.class.php: the curl option CURLOPT_CUSTOMREQUEST has been changed to CURLOPT_NOBODY.
* Servers page: auto refresh can be configured at the config page.
* Servers page: if the server is a website, the "Domain/Ip" field will be a link to the website.
* New text message gateway: Clickatell.com (thanks to Simon).
* If cURL is not installed, the install.php script will throw an error.
* HTTP status codes 5xx will also be treated as error.
### v2.0.0 (released October 19, 2009)
* Server type ("service" or "website").
* Different types of notification.
* New text message gateways.
* Code rewrite.
* New layout.
* Check for updates function.
### v1.0.1 (released September 18, 2008)
* log.php
* tpl/log.tpl.html
* Select order by clause used datetime field after DATE_FORMAT had been performed, resulting in a wrong list of log entries shown.

View File

@ -159,6 +159,7 @@ function psm_update_conf($key, $value) {
array('value' => $value), array('value' => $value),
array('key' => $key) array('key' => $key)
); );
$GLOBALS['sm_config'][$key] = $value;
} }
############################################### ###############################################
@ -312,26 +313,41 @@ function psm_date($time) {
} }
/** /**
* Check if an update is available for PHP Server Monitor * 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 * @global object $db
* @return boolean * @return boolean
*/ */
function psm_check_updates() { function psm_update_available() {
global $db; global $db;
if(!psm_get_conf('show_update')) {
// user does not want updates, fair enough.
return false;
}
$last_update = psm_get_conf('last_update_check'); $last_update = psm_get_conf('last_update_check');
if((time() - (7 * 24 * 60 * 60)) > $last_update) { if((time() - PSM_UPDATE_INTERVAL) > $last_update) {
// been more than a week since update, lets go // been more than a week since update, lets go
// update "update-date" // update last check date
$db->save(PSM_DB_PREFIX . 'config', array('value' => time()), array('key' => 'last_update_check')); psm_update_conf('last_update_check', time());
$latest = psm_curl_get('http://www.phpservermonitor.org/version.php'); $latest = psm_curl_get(PSM_UPDATE_URL);
$current = psm_get_conf('version'); // add latest version to database
if($latest !== false && strlen($latest) < 15) {
return version_compare($latest, $current, '>'); psm_update_conf('version_update_check', $latest);
}
} else {
$latest = psm_get_conf('version_update_check');
}
if($latest != false) {
$current = psm_get_conf('version');
return version_compare($latest, $current, '>');
} else {
return false;
} }
return false;
} }
/** /**

View File

@ -31,6 +31,18 @@
*/ */
define('PSM_VERSION', '2.2.0-dev'); define('PSM_VERSION', '2.2.0-dev');
/**
* URL to check for updates. Will not be checked if turned off on config page.
* @see psm_update_available()
*/
define('PSM_UPDATE_URL', 'http://www.phpservermonitor.org/version.php');
/**
* Default update interval (1 week). Only applicable when updates are enabled.
* @see psm_update_available()
*/
define('PSM_UPDATE_INTERVAL', 7 * 24 * 60 * 60);
/** /**
* Configuration for: Hashing strength * Configuration for: Hashing strength
* This is the place where you define the strength of your password hashing/salting * This is the place where you define the strength of your password hashing/salting

View File

@ -42,7 +42,7 @@ $sm_lang = array(
'edit' => 'Редактиране на', 'edit' => 'Редактиране на',
'insert' => 'Добавяне', 'insert' => 'Добавяне',
'add_new' => 'Добави нов', 'add_new' => 'Добави нов',
'update_available' => 'Налична е нова версия. Може да я свалите от <a href="http://www.phpservermonitor.org" target="_blank">тук</a>.', 'update_available' => 'Налична е нова версия ({version}). Може да я свалите от <a href="http://www.phpservermonitor.org" target="_blank">тук</a>.',
'back_to_top' => 'Нагоре', 'back_to_top' => 'Нагоре',
'go_back' => 'Go back', 'go_back' => 'Go back',
// date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php // date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php

View File

@ -42,7 +42,7 @@ $sm_lang = array(
'edit' => 'Bearbeiten', 'edit' => 'Bearbeiten',
'insert' => 'Einf&uuml;gen', 'insert' => 'Einf&uuml;gen',
'add_new' => 'Neuen Eintrag erstellen', 'add_new' => 'Neuen Eintrag erstellen',
'update_available' => 'Ein neues Update ist verf&uuml;gbar auf <a href="http://www.phpservermonitor.org" target="_blank">http://www.phpservermonitor.org</a>.', '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', 'back_to_top' => 'Back to top',
'go_back' => 'Go back', 'go_back' => 'Go back',
// date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php // date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php

View File

@ -42,7 +42,7 @@ $sm_lang = array(
'edit' => 'Edit', 'edit' => 'Edit',
'insert' => 'Insert', 'insert' => 'Insert',
'add_new' => 'Add new', 'add_new' => 'Add new',
'update_available' => 'A new update is available from <a href="http://www.phpservermonitor.org" target="_blank">http://www.phpservermonitor.org</a>.', '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', 'back_to_top' => 'Back to top',
'go_back' => 'Go back', 'go_back' => 'Go back',
// date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php // date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php

View File

@ -42,7 +42,7 @@ $sm_lang = array(
'edit' => 'Editer', 'edit' => 'Editer',
'insert' => 'Nouveau', 'insert' => 'Nouveau',
'add_new' => 'Nouveau', 'add_new' => 'Nouveau',
'update_available' => 'Une nouvelle version est disponible à l\'adresse <a href="http://www.phpservermonitor.org" target="_blank">http://www.phpservermonitor.org</a>.', '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', 'back_to_top' => 'Haut de page',
'go_back' => 'Retour', 'go_back' => 'Retour',
// date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php // date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php

View File

@ -42,7 +42,7 @@ $sm_lang = array(
'edit' => '수정', 'edit' => '수정',
'insert' => '삽입', 'insert' => '삽입',
'add_new' => '새계정 추가', 'add_new' => '새계정 추가',
'update_available' => '새로운 업데이트가 있습니다. 다음사이트를 방문 해 주십시오. <a href="http://www.phpservermonitor.org" target="_blank">http://www.phpservermonitor.org</a>.', 'update_available' => '새로운 업데이트가 있습니다 ({version}). 다음사이트를 방문 해 주십시오. <a href="http://www.phpservermonitor.org" target="_blank">http://www.phpservermonitor.org</a>.',
'back_to_top' => 'Back to top', 'back_to_top' => 'Back to top',
'go_back' => 'Go back', 'go_back' => 'Go back',
// date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php // date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php

View File

@ -42,7 +42,7 @@ $sm_lang = array(
'edit' => 'Wijzig', 'edit' => 'Wijzig',
'insert' => 'Voeg toe', 'insert' => 'Voeg toe',
'add_new' => 'Voeg toe', 'add_new' => 'Voeg toe',
'update_available' => 'Een nieuwe update is beschikbaar op <a href="http://www.phpservermonitor.org" target="_blank">http://www.phpservermonitor.org</a>.', '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', 'back_to_top' => 'Terug naar boven',
'go_back' => 'Terug', 'go_back' => 'Terug',
// date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php // date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php

View File

@ -42,7 +42,7 @@ $sm_lang = array(
'edit' => 'Editar', 'edit' => 'Editar',
'insert' => 'Inserir', 'insert' => 'Inserir',
'add_new' => 'Adicionar novo', 'add_new' => 'Adicionar novo',
'update_available' => 'Uma atualização disponível em <a href="http://www.phpservermonitor.org" target="_blank">http://www.phpservermonitor.org</a>.', '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', 'back_to_top' => 'Voltar ao topo',
'go_back' => 'Go back', 'go_back' => 'Go back',
// date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php // date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php

View File

@ -167,10 +167,6 @@ abstract class AbstractController implements ControllerInterface {
* 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
*/ */
protected function createHTML() { protected function createHTML() {
if(psm_get_conf('show_update')) {
// user wants updates, lets see what we can do
$this->createHTMLUpdateAvailable();
}
$tpl_data = array(); $tpl_data = array();
if(!empty($this->messages)) { if(!empty($this->messages)) {
@ -198,6 +194,10 @@ abstract class AbstractController implements ControllerInterface {
$tpl_data['content'] = $this->tpl->getTemplate($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'));
}
// add the module's custom template to the main template to get some content // add the module's custom template to the main template to get some content
$this->setTemplateId('main'); $this->setTemplateId('main');
$this->tpl->addTemplatedata($this->getTemplateId(), $tpl_data); $this->tpl->addTemplatedata($this->getTemplateId(), $tpl_data);
@ -261,18 +261,6 @@ abstract class AbstractController implements ControllerInterface {
return $this->tpl->getTemplate($tpl_id); return $this->tpl->getTemplate($tpl_id);
} }
/**
* First check if an update is available, if there is add a message
* to the main template
*/
protected function createHTMLUpdateAvailable() {
if(psm_check_updates()) {
// yay, new update available =D
// @todo perhaps find a way to make the message more persistent?
$this->addMessage(psm_get_lang('system', 'update_available'));
}
}
/** /**
* Use this to add language specific labels to template * Use this to add language specific labels to template
* *

View File

@ -76,16 +76,7 @@ class ConfigController extends AbstractController {
* Populate all the config fields with values from the database * Populate all the config fields with values from the database
*/ */
protected function executeIndex() { protected function executeIndex() {
$this->setTemplateId('config', 'config.tpl.html'); $this->setTemplateId('config', 'config/config.tpl.html');
$sidebar = new \psm\Util\Module\Sidebar($this->tpl);
$this->setSidebar($sidebar);
$sidebar->addLink(
'save',
psm_get_lang('system', 'save'),
"javascript:$('#edit_config').submit();",
'ok'
);
$config_db = $this->db->select( $config_db = $this->db->select(
PSM_DB_PREFIX . 'config', PSM_DB_PREFIX . 'config',

View File

@ -62,13 +62,13 @@ class InstallController extends AbstractController {
protected function createHTML() { protected function createHTML() {
$html_results = ''; $html_results = '';
if(!empty($this->messages)) { if(!empty($this->messages)) {
$this->tpl->newTemplate('install_results', 'install.tpl.html'); $this->tpl->newTemplate('install_results', 'install/install.tpl.html');
$this->tpl->addTemplateDataRepeat('install_results', 'resultmsgs', $this->messages); $this->tpl->addTemplateDataRepeat('install_results', 'resultmsgs', $this->messages);
$html_results = $this->tpl->getTemplate('install_results'); $html_results = $this->tpl->getTemplate('install_results');
$this->messages = array(); $this->messages = array();
} }
$tpl_id = $this->getTemplateId(); $tpl_id = $this->getTemplateId();
$this->setTemplateId('install', 'install.tpl.html'); $this->setTemplateId('install', 'install/install.tpl.html');
$this->tpl->addTemplateData($this->getTemplateId(), array( $this->tpl->addTemplateData($this->getTemplateId(), array(
'html_install' => $this->tpl->getTemplate($tpl_id), 'html_install' => $this->tpl->getTemplate($tpl_id),
@ -82,7 +82,7 @@ class InstallController extends AbstractController {
* Say hi to our new user * Say hi to our new user
*/ */
protected function executeIndex() { protected function executeIndex() {
$this->setTemplateId('install_index', 'install.tpl.html'); $this->setTemplateId('install_index', 'install/install.tpl.html');
// build prerequisites // build prerequisites
$errors = 0; $errors = 0;
@ -113,7 +113,7 @@ class InstallController extends AbstractController {
* Help the user create a new config file * Help the user create a new config file
*/ */
protected function executeConfig() { protected function executeConfig() {
$this->setTemplateId('install_config_new', 'install.tpl.html'); $this->setTemplateId('install_config_new', 'install/install.tpl.html');
$tpl_data = array(); $tpl_data = array();
if(!defined('PSM_DB_PREFIX')) { if(!defined('PSM_DB_PREFIX')) {
@ -165,7 +165,7 @@ class InstallController extends AbstractController {
$this->addMessage('Configuration file written successfully.', 'success'); $this->addMessage('Configuration file written successfully.', 'success');
} else { } else {
$this->addMessage('Config file is not writable, we cannot save it for you.', 'error'); $this->addMessage('Config file is not writable, we cannot save it for you.', 'error');
$this->tpl->newTemplate('install_config_new_copy', 'install.tpl.html'); $this->tpl->newTemplate('install_config_new_copy', 'install/install.tpl.html');
$tpl_data['html_config_copy'] = $this->tpl->getTemplate('install_config_new_copy'); $tpl_data['html_config_copy'] = $this->tpl->getTemplate('install_config_new_copy');
$tpl_data['php_config'] = $config_php; $tpl_data['php_config'] = $config_php;
} }
@ -182,14 +182,14 @@ class InstallController extends AbstractController {
if(version_compare(PSM_VERSION, '2.2.0', '<')) { if(version_compare(PSM_VERSION, '2.2.0', '<')) {
// upgrade from before 2.2, does not have passwords yet.. create new user first // upgrade from before 2.2, does not have passwords yet.. create new user first
$this->addMessage('Your current version does not have an authentication system, but since v2.2 access to the monitor is restricted by user accounts. Please set up a new account to be able to login after the upgrade, and which you can use to change the passwords for your other accounts.', 'info'); $this->addMessage('Your current version does not have an authentication system, but since v2.2 access to the monitor is restricted by user accounts. Please set up a new account to be able to login after the upgrade, and which you can use to change the passwords for your other accounts.', 'info');
$this->setTemplateId('install_config_new_user', 'install.tpl.html'); $this->setTemplateId('install_config_new_user', 'install/install.tpl.html');
} else { } else {
$this->setTemplateId('install_config_upgrade', 'install.tpl.html'); $this->setTemplateId('install_config_upgrade', 'install/install.tpl.html');
$tpl_data['version'] = PSM_VERSION; $tpl_data['version'] = PSM_VERSION;
} }
} else { } else {
// fresh install ahead // fresh install ahead
$this->setTemplateId('install_config_new_user', 'install.tpl.html'); $this->setTemplateId('install_config_new_user', 'install/install.tpl.html');
$tpl_data['username'] = (isset($_POST['username'])) ? $_POST['username'] : ''; $tpl_data['username'] = (isset($_POST['username'])) ? $_POST['username'] : '';
$tpl_data['email'] = (isset($_POST['email'])) ? $_POST['email'] : ''; $tpl_data['email'] = (isset($_POST['email'])) ? $_POST['email'] : '';
@ -272,7 +272,7 @@ class InstallController extends AbstractController {
} }
} }
$this->setTemplateId('install_success', 'install.tpl.html'); $this->setTemplateId('install_success', 'install/install.tpl.html');
} }
/** /**

View File

@ -44,7 +44,7 @@ class LogController extends AbstractServerController {
* Prepare the template with a list of all log entries * Prepare the template with a list of all log entries
*/ */
protected function executeIndex() { protected function executeIndex() {
$this->setTemplateId('log_list', 'log.tpl.html'); $this->setTemplateId('server_log_list', 'server/log.tpl.html');
$entries = array(); $entries = array();
$entries['status'] = $this->getEntries('status'); $entries['status'] = $this->getEntries('status');
@ -80,10 +80,10 @@ class LogController extends AbstractServerController {
} }
// add entries to template // add entries to template
$this->tpl->newTemplate('log_entries', 'log.tpl.html'); $this->tpl->newTemplate('server_log_entries', 'server/log.tpl.html');
$this->tpl->addTemplateDataRepeat('log_entries', 'entries', $records); $this->tpl->addTemplateDataRepeat('server_log_entries', 'entries', $records);
$this->tpl->addTemplateData( $this->tpl->addTemplateData(
'log_entries', 'server_log_entries',
array( array(
'logtitle' => $key, 'logtitle' => $key,
) )
@ -91,7 +91,7 @@ class LogController extends AbstractServerController {
$this->tpl->addTemplateData( $this->tpl->addTemplateData(
$this->getTemplateId(), $this->getTemplateId(),
array( array(
'content_' . $key => $this->tpl->getTemplate('log_entries'), 'content_' . $key => $this->tpl->getTemplate('server_log_entries'),
) )
); );
} }

View File

@ -51,7 +51,7 @@ class ServerController extends AbstractServerController {
* Prepare the template to show a list of all servers * Prepare the template to show a list of all servers
*/ */
protected function executeIndex() { protected function executeIndex() {
$this->setTemplateId('servers_list', 'servers.tpl.html'); $this->setTemplateId('server_list', 'server/server.tpl.html');
$sidebar = new \psm\Util\Module\Sidebar($this->tpl); $sidebar = new \psm\Util\Module\Sidebar($this->tpl);
$this->setSidebar($sidebar); $this->setSidebar($sidebar);
@ -64,8 +64,8 @@ class ServerController extends AbstractServerController {
'plus' 'plus'
); );
// get the action buttons per server // get the action buttons per server
$this->tpl->newTemplate('servers_list_admin_actions', 'servers.tpl.html'); $this->tpl->newTemplate('server_list_admin_actions', 'server/server.tpl.html');
$html_actions = $this->tpl->getTemplate('servers_list_admin_actions'); $html_actions = $this->tpl->getTemplate('server_list_admin_actions');
} else { } else {
$html_actions = ''; $html_actions = '';
} }
@ -104,7 +104,7 @@ class ServerController extends AbstractServerController {
* Prepare the template to show the update screen for a single server * Prepare the template to show the update screen for a single server
*/ */
protected function executeEdit() { protected function executeEdit() {
$this->setTemplateId('servers_update', 'servers.tpl.html'); $this->setTemplateId('server_update', 'server/server.tpl.html');
$sidebar = new \psm\Util\Module\Sidebar($this->tpl); $sidebar = new \psm\Util\Module\Sidebar($this->tpl);
$this->setSidebar($sidebar); $this->setSidebar($sidebar);

View File

@ -46,7 +46,7 @@ class StatusController extends AbstractServerController {
* @todo move the background colurs to the config * @todo move the background colurs to the config
*/ */
protected function executeIndex() { protected function executeIndex() {
$this->setTemplateId('status', 'status.tpl.html'); $this->setTemplateId('server_status', 'server/status.tpl.html');
$this->addFooter(false); $this->addFooter(false);
// get the active servers from database // get the active servers from database

View File

@ -46,7 +46,7 @@ class LoginController extends AbstractController {
} }
protected function executeLogin() { protected function executeLogin() {
$this->setTemplateId('login', 'login.tpl.html'); $this->setTemplateId('user_login', 'user/login.tpl.html');
if(isset($_POST['user_name']) && isset($_POST['user_password'])) { if(isset($_POST['user_name']) && isset($_POST['user_password'])) {
$rememberme = (isset($_POST['user_rememberme'])) ? true : false; $rememberme = (isset($_POST['user_rememberme'])) ? true : false;
@ -83,7 +83,7 @@ class LoginController extends AbstractController {
* Show/process the password forgot form (before the mail) * Show/process the password forgot form (before the mail)
*/ */
protected function executeForgot() { protected function executeForgot() {
$this->setTemplateId('login_forgot', 'login.tpl.html'); $this->setTemplateId('user_login_forgot', 'user/login.tpl.html');
if(isset($_POST['user_name'])) { if(isset($_POST['user_name'])) {
$user = $this->user->getUserByUsername($_POST['user_name']); $user = $this->user->getUserByUsername($_POST['user_name']);
@ -118,7 +118,7 @@ class LoginController extends AbstractController {
* Show/process the password reset form (after the mail) * Show/process the password reset form (after the mail)
*/ */
protected function executeReset() { protected function executeReset() {
$this->setTemplateId('login_reset', 'login.tpl.html'); $this->setTemplateId('user_login_reset', 'user/login.tpl.html');
$user_id = (isset($_GET['user_id'])) ? intval($_GET['user_id']) : 0; $user_id = (isset($_GET['user_id'])) ? intval($_GET['user_id']) : 0;
$token = (isset($_GET['token'])) ? $_GET['token'] : ''; $token = (isset($_GET['token'])) ? $_GET['token'] : '';

View File

@ -68,7 +68,7 @@ class UserController extends AbstractController {
* Prepare the template to show a list of all users * Prepare the template to show a list of all users
*/ */
protected function executeIndex() { protected function executeIndex() {
$this->setTemplateId('users_list', 'users.tpl.html'); $this->setTemplateId('user_list', 'user/user.tpl.html');
$sidebar = new \psm\Util\Module\Sidebar($this->tpl); $sidebar = new \psm\Util\Module\Sidebar($this->tpl);
$this->setSidebar($sidebar); $this->setSidebar($sidebar);
@ -113,7 +113,7 @@ class UserController extends AbstractController {
* Prepare the template to show the update screen for a user * Prepare the template to show the update screen for a user
*/ */
protected function executeEdit() { protected function executeEdit() {
$this->setTemplateId('users_update', 'users.tpl.html'); $this->setTemplateId('user_update', 'user/user.tpl.html');
$sidebar = new \psm\Util\Module\Sidebar($this->tpl); $sidebar = new \psm\Util\Module\Sidebar($this->tpl);
$this->setSidebar($sidebar); $this->setSidebar($sidebar);

View File

@ -118,6 +118,7 @@ class Installer {
('log_email', '1'), ('log_email', '1'),
('log_sms', '1'), ('log_sms', '1'),
('version', '" . PSM_VERSION . "'), ('version', '" . PSM_VERSION . "'),
('version_update_check', '" . PSM_VERSION . "'),
('auto_refresh_servers', '0'), ('auto_refresh_servers', '0'),
('show_update', '1'), ('show_update', '1'),
('last_update_check', '0'), ('last_update_check', '0'),
@ -269,6 +270,8 @@ class Installer {
$queries[] = "UPDATE `" . PSM_DB_PREFIX . "config` SET `value`='nl_NL' WHERE `key`='language' AND `value`='nl';"; $queries[] = "UPDATE `" . PSM_DB_PREFIX . "config` SET `value`='nl_NL' WHERE `key`='language' AND `value`='nl';";
$queries[] = "UPDATE `" . PSM_DB_PREFIX . "config` SET `value`='pt_BR' WHERE `key`='language' AND `value`='br';"; $queries[] = "UPDATE `" . PSM_DB_PREFIX . "config` SET `value`='pt_BR' WHERE `key`='language' AND `value`='br';";
$queries[] = "INSERT INTO `" . PSM_DB_PREFIX . "config` (`key`, `value`) VALUES ('version_update_check', '" . PSM_VERSION . "');";
$queries[] = "ALTER TABLE `" . PSM_DB_PREFIX . "log` CHANGE `log_id` `log_id` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT;"; $queries[] = "ALTER TABLE `" . PSM_DB_PREFIX . "log` CHANGE `log_id` `log_id` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT;";
$queries[] = "ALTER TABLE `" . PSM_DB_PREFIX . "log` CHANGE `server_id` `server_id` INT( 11 ) UNSIGNED NOT NULL;"; $queries[] = "ALTER TABLE `" . PSM_DB_PREFIX . "log` CHANGE `server_id` `server_id` INT( 11 ) UNSIGNED NOT NULL;";

View File

@ -102,6 +102,6 @@
<!--%tpl_main_footer--> <!--%tpl_main_footer-->
<footer class="footer"> <footer class="footer">
<p class="pull-right"><a href="#">{label_back_to_top}</a></p> <p class="pull-right"><a href="#">{label_back_to_top}</a></p>
<p><small>Powered by <a href="http://www.phpservermonitor.org/" target="_blank">PHP Server Monitor</a>.</small></p> <p><small>Powered by <a href="http://www.phpservermonitor.org/" target="_blank">PHP Server Monitor</a>.<br/>{update_available}</small></p>
</footer> </footer>
<!--%%tpl_main_footer--> <!--%%tpl_main_footer-->

View File

@ -1,4 +1,4 @@
<!--%tpl_log_list--> <!--%tpl_server_log_list-->
<div class="tabbable"> <div class="tabbable">
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li class="active"><a href="#log_status_content" data-toggle="tab">{label_status}</a></li> <li class="active"><a href="#log_status_content" data-toggle="tab">{label_status}</a></li>
@ -17,9 +17,9 @@
</div> </div>
</div> </div>
</div> </div>
<!--%%tpl_log_list--> <!--%%tpl_server_log_list-->
<!--%tpl_log_entries--> <!--%tpl_server_log_entries-->
<!-- {logtitle} --> <!-- {logtitle} -->
<table class="table table-bordered table-striped"> <table class="table table-bordered table-striped">
<thead> <thead>
@ -42,4 +42,4 @@
{entries} {entries}
</tbody> </tbody>
</table> </table>
<!--%%tpl_log_entries--> <!--%%tpl_server_log_entries-->

View File

@ -1,4 +1,4 @@
<!--%tpl_servers_list--> <!--%tpl_server_list-->
<table class="table table-bordered table-striped"> <table class="table table-bordered table-striped">
<thead> <thead>
<tr> <tr>
@ -38,18 +38,18 @@
{servers} {servers}
</tbody> </tbody>
</table> </table>
<!--%%tpl_servers_list--> <!--%%tpl_server_list-->
<!--%tpl_servers_list_admin_actions--> <!--%tpl_server_list_admin_actions-->
<a class="btn btn-small" href="index.php?mod=server&amp;action=edit&amp;id={server_id}" title="{label_edit}"> <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> <i class="icon-pencil"></i>
</a> </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" href="javascript:sm_delete('{server_id}', 'server');" title="{label_delete}">
<i class="icon-remove icon-white"></i> <i class="icon-remove icon-white"></i>
</a> </a>
<!--%%tpl_servers_list_admin_actions--> <!--%%tpl_server_list_admin_actions-->
<!--%tpl_servers_update--> <!--%tpl_server_update-->
<form class="form-horizontal well" action="index.php?mod=server&action=save&id={edit_server_id}" method="post"> <form class="form-horizontal well" action="index.php?mod=server&action=save&id={edit_server_id}" method="post">
<fieldset> <fieldset>
<legend>{titlemode}</legend> <legend>{titlemode}</legend>
@ -125,4 +125,4 @@
</div> </div>
</fieldset> </fieldset>
</form> </form>
<!--%%tpl_servers_update--> <!--%%tpl_server_update-->

View File

@ -1,4 +1,4 @@
<!--%tpl_status--> <!--%tpl_server_status-->
<style type="text/css"> <style type="text/css">
body { body {
background: {bg}; background: {bg};
@ -73,4 +73,4 @@
<!--%%tpl_repeat_servers_online--> <!--%%tpl_repeat_servers_online-->
{servers_online} {servers_online}
</div> </div>
<!--%%tpl_status--> <!--%%tpl_server_status-->

View File

@ -1,4 +1,4 @@
<!--%tpl_login--> <!--%tpl_user_login-->
<div class="container"> <div class="container">
<form class="form-signin" method="post"> <form class="form-signin" method="post">
<h3 class="form-signin-heading">{title_sign_in}</h3> <h3 class="form-signin-heading">{title_sign_in}</h3>
@ -12,9 +12,9 @@
<a class="btn" href="?action=forgot">{label_password_forgot}</a> <a class="btn" href="?action=forgot">{label_password_forgot}</a>
</form> </form>
</div> </div>
<!--%%tpl_login--> <!--%%tpl_user_login-->
<!--%tpl_login_forgot--> <!--%tpl_user_login_forgot-->
<div class="container"> <div class="container">
<form class="form-signin" method="post"> <form class="form-signin" method="post">
<h3 class="form-signin-heading">{title_forgot}</h3> <h3 class="form-signin-heading">{title_forgot}</h3>
@ -23,9 +23,9 @@
<a class="btn" href="?">{label_go_back}</a> <a class="btn" href="?">{label_go_back}</a>
</form> </form>
</div> </div>
<!--%%tpl_login_forgot--> <!--%%tpl_user_login_forgot-->
<!--%tpl_login_reset--> <!--%tpl_user_login_reset-->
<div class="container"> <div class="container">
<form class="form-signin" method="post"> <form class="form-signin" method="post">
<h3 class="form-signin-heading">{title_reset}</h3> <h3 class="form-signin-heading">{title_reset}</h3>
@ -36,4 +36,4 @@
<a class="btn" href="?">{label_go_back}</a> <a class="btn" href="?">{label_go_back}</a>
</form> </form>
</div> </div>
<!--%%tpl_login_reset--> <!--%%tpl_user_login_reset-->

View File

@ -1,4 +1,4 @@
<!--%tpl_users_list--> <!--%tpl_user_list-->
<table class="table table-bordered table-striped"> <table class="table table-bordered table-striped">
<thead> <thead>
<tr> <tr>
@ -33,9 +33,9 @@
{users} {users}
</tbody> </tbody>
</table> </table>
<!--%%tpl_users_list--> <!--%%tpl_user_list-->
<!--%tpl_users_update--> <!--%tpl_user_update-->
<form class="form-horizontal well" action="index.php?mod=user&amp;action=save&amp;id={edit_user_id}" method="post"> <form class="form-horizontal well" action="index.php?mod=user&amp;action=save&amp;id={edit_user_id}" method="post">
<fieldset> <fieldset>
<legend>{titlemode}</legend> <legend>{titlemode}</legend>
@ -110,4 +110,4 @@
</div> </div>
</fieldset> </fieldset>
</form> </form>
<!--%%tpl_users_update--> <!--%%tpl_user_update-->