From a120c877bb4fff203881ecfd3477c343329a87df Mon Sep 17 00:00:00 2001 From: Pepijn Over Date: Mon, 31 Mar 2014 22:03:12 +0200 Subject: [PATCH] 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 --- CHANGELOG | 78 ------------------- CHANGELOG.md | 70 +++++++++++++++++ src/includes/functions.inc.php | 36 ++++++--- src/includes/psmconfig.inc.php | 12 +++ src/lang/bg_BG.lang.php | 2 +- src/lang/de_DE.lang.php | 2 +- src/lang/en_US.lang.php | 2 +- src/lang/fr_FR.lang.php | 2 +- src/lang/ko_KR.lang.php | 2 +- src/lang/nl_NL.lang.php | 2 +- src/lang/pt_BR.lang.php | 2 +- src/psm/Module/AbstractController.class.php | 20 +---- .../Controller/ConfigController.class.php | 11 +-- .../Controller/InstallController.class.php | 18 ++--- .../Server/Controller/LogController.class.php | 10 +-- .../Controller/ServerController.class.php | 8 +- .../Controller/StatusController.class.php | 2 +- .../User/Controller/LoginController.class.php | 6 +- .../User/Controller/UserController.class.php | 4 +- src/psm/Util/Install/Installer.class.php | 3 + src/templates/{ => config}/config.tpl.html | 0 src/templates/{ => install}/install.tpl.html | 0 src/templates/main.tpl.html | 2 +- src/templates/{ => server}/log.tpl.html | 8 +- .../server.tpl.html} | 12 +-- src/templates/{ => server}/status.tpl.html | 4 +- src/templates/{ => user}/login.tpl.html | 12 +-- .../{users.tpl.html => user/user.tpl.html} | 8 +- 28 files changed, 170 insertions(+), 168 deletions(-) delete mode 100755 CHANGELOG create mode 100755 CHANGELOG.md rename src/templates/{ => config}/config.tpl.html (100%) rename src/templates/{ => install}/install.tpl.html (100%) rename src/templates/{ => server}/log.tpl.html (90%) rename src/templates/{servers.tpl.html => server/server.tpl.html} (95%) rename src/templates/{ => server}/status.tpl.html (96%) rename src/templates/{ => user}/login.tpl.html (91%) rename src/templates/{users.tpl.html => user/user.tpl.html} (97%) diff --git a/CHANGELOG b/CHANGELOG deleted file mode 100755 index 170a6adb..00000000 --- a/CHANGELOG +++ /dev/null @@ -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. diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100755 index 00000000..28f801f8 --- /dev/null +++ b/CHANGELOG.md @@ -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 + + +### v2.1.0 (released February 8, 2014) + + * PHP 5.3+ required + * Merged PHP Server Monitor Plus project by Luiz Alberto S. Ribeiro (). + * 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. diff --git a/src/includes/functions.inc.php b/src/includes/functions.inc.php index 90ec504b..2c9fc670 100644 --- a/src/includes/functions.inc.php +++ b/src/includes/functions.inc.php @@ -159,6 +159,7 @@ function psm_update_conf($key, $value) { array('value' => $value), 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 * @return boolean */ -function psm_check_updates() { +function psm_update_available() { 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'); - if((time() - (7 * 24 * 60 * 60)) > $last_update) { + if((time() - PSM_UPDATE_INTERVAL) > $last_update) { // been more than a week since update, lets go - // update "update-date" - $db->save(PSM_DB_PREFIX . 'config', array('value' => time()), array('key' => 'last_update_check')); - $latest = psm_curl_get('http://www.phpservermonitor.org/version.php'); - $current = psm_get_conf('version'); - - return version_compare($latest, $current, '>'); + // update last check date + psm_update_conf('last_update_check', time()); + $latest = psm_curl_get(PSM_UPDATE_URL); + // add latest version to database + if($latest !== false && strlen($latest) < 15) { + 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; } /** diff --git a/src/includes/psmconfig.inc.php b/src/includes/psmconfig.inc.php index d90da462..997f983c 100644 --- a/src/includes/psmconfig.inc.php +++ b/src/includes/psmconfig.inc.php @@ -31,6 +31,18 @@ */ 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 * This is the place where you define the strength of your password hashing/salting diff --git a/src/lang/bg_BG.lang.php b/src/lang/bg_BG.lang.php index 7e4a3463..b12143f8 100644 --- a/src/lang/bg_BG.lang.php +++ b/src/lang/bg_BG.lang.php @@ -42,7 +42,7 @@ $sm_lang = array( 'edit' => 'Редактиране на', 'insert' => 'Добавяне', 'add_new' => 'Добави нов', - 'update_available' => 'Налична е нова версия. Може да я свалите от тук.', + 'update_available' => 'Налична е нова версия ({version}). Може да я свалите от тук.', 'back_to_top' => 'Нагоре', 'go_back' => 'Go back', // date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php diff --git a/src/lang/de_DE.lang.php b/src/lang/de_DE.lang.php index bd604b75..06dba025 100644 --- a/src/lang/de_DE.lang.php +++ b/src/lang/de_DE.lang.php @@ -42,7 +42,7 @@ $sm_lang = array( 'edit' => 'Bearbeiten', 'insert' => 'Einfügen', 'add_new' => 'Neuen Eintrag erstellen', - 'update_available' => 'Ein neues Update ist verfügbar auf http://www.phpservermonitor.org.', + 'update_available' => 'Ein neues Update ({version}) ist verfügbar auf http://www.phpservermonitor.org.', 'back_to_top' => 'Back to top', 'go_back' => 'Go back', // date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php diff --git a/src/lang/en_US.lang.php b/src/lang/en_US.lang.php index fe0faf9e..974b4b69 100644 --- a/src/lang/en_US.lang.php +++ b/src/lang/en_US.lang.php @@ -42,7 +42,7 @@ $sm_lang = array( 'edit' => 'Edit', 'insert' => 'Insert', 'add_new' => 'Add new', - 'update_available' => 'A new update is available from http://www.phpservermonitor.org.', + 'update_available' => 'A new version ({version}) is available from http://www.phpservermonitor.org.', 'back_to_top' => 'Back to top', 'go_back' => 'Go back', // date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php diff --git a/src/lang/fr_FR.lang.php b/src/lang/fr_FR.lang.php index 9a2f98eb..445f3b4d 100644 --- a/src/lang/fr_FR.lang.php +++ b/src/lang/fr_FR.lang.php @@ -42,7 +42,7 @@ $sm_lang = array( 'edit' => 'Editer', 'insert' => 'Nouveau', 'add_new' => 'Nouveau', - 'update_available' => 'Une nouvelle version est disponible à l\'adresse http://www.phpservermonitor.org.', + 'update_available' => 'Une nouvelle version ({version}) est disponible à l\'adresse http://www.phpservermonitor.org.', 'back_to_top' => 'Haut de page', 'go_back' => 'Retour', // date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php diff --git a/src/lang/ko_KR.lang.php b/src/lang/ko_KR.lang.php index 8ab9bc86..beb1d2b7 100644 --- a/src/lang/ko_KR.lang.php +++ b/src/lang/ko_KR.lang.php @@ -42,7 +42,7 @@ $sm_lang = array( 'edit' => '수정', 'insert' => '삽입', 'add_new' => '새계정 추가', - 'update_available' => '새로운 업데이트가 있습니다. 다음사이트를 방문 해 주십시오. http://www.phpservermonitor.org.', + 'update_available' => '새로운 업데이트가 있습니다 ({version}). 다음사이트를 방문 해 주십시오. http://www.phpservermonitor.org.', 'back_to_top' => 'Back to top', 'go_back' => 'Go back', // date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php diff --git a/src/lang/nl_NL.lang.php b/src/lang/nl_NL.lang.php index 6d437354..ce10bcec 100644 --- a/src/lang/nl_NL.lang.php +++ b/src/lang/nl_NL.lang.php @@ -42,7 +42,7 @@ $sm_lang = array( 'edit' => 'Wijzig', 'insert' => 'Voeg toe', 'add_new' => 'Voeg toe', - 'update_available' => 'Een nieuwe update is beschikbaar op http://www.phpservermonitor.org.', + 'update_available' => 'Een nieuwe update ({version}) is beschikbaar op http://www.phpservermonitor.org.', 'back_to_top' => 'Terug naar boven', 'go_back' => 'Terug', // date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php diff --git a/src/lang/pt_BR.lang.php b/src/lang/pt_BR.lang.php index 69cbb4d8..31647918 100644 --- a/src/lang/pt_BR.lang.php +++ b/src/lang/pt_BR.lang.php @@ -42,7 +42,7 @@ $sm_lang = array( 'edit' => 'Editar', 'insert' => 'Inserir', 'add_new' => 'Adicionar novo', - 'update_available' => 'Uma atualização disponível em http://www.phpservermonitor.org.', + 'update_available' => 'Uma atualização ({version}) disponível em http://www.phpservermonitor.org.', 'back_to_top' => 'Voltar ao topo', 'go_back' => 'Go back', // date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php diff --git a/src/psm/Module/AbstractController.class.php b/src/psm/Module/AbstractController.class.php index cb6062f3..337b2796 100644 --- a/src/psm/Module/AbstractController.class.php +++ b/src/psm/Module/AbstractController.class.php @@ -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 */ protected function createHTML() { - if(psm_get_conf('show_update')) { - // user wants updates, lets see what we can do - $this->createHTMLUpdateAvailable(); - } $tpl_data = array(); if(!empty($this->messages)) { @@ -198,6 +194,10 @@ abstract class AbstractController implements ControllerInterface { $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 $this->setTemplateId('main'); $this->tpl->addTemplatedata($this->getTemplateId(), $tpl_data); @@ -261,18 +261,6 @@ abstract class AbstractController implements ControllerInterface { 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 * diff --git a/src/psm/Module/Config/Controller/ConfigController.class.php b/src/psm/Module/Config/Controller/ConfigController.class.php index c03b0cc4..086c3602 100644 --- a/src/psm/Module/Config/Controller/ConfigController.class.php +++ b/src/psm/Module/Config/Controller/ConfigController.class.php @@ -76,16 +76,7 @@ class ConfigController extends AbstractController { * Populate all the config fields with values from the database */ protected function executeIndex() { - $this->setTemplateId('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' - ); + $this->setTemplateId('config', 'config/config.tpl.html'); $config_db = $this->db->select( PSM_DB_PREFIX . 'config', diff --git a/src/psm/Module/Install/Controller/InstallController.class.php b/src/psm/Module/Install/Controller/InstallController.class.php index 7fb4dbce..6444641d 100644 --- a/src/psm/Module/Install/Controller/InstallController.class.php +++ b/src/psm/Module/Install/Controller/InstallController.class.php @@ -62,13 +62,13 @@ class InstallController extends AbstractController { protected function createHTML() { $html_results = ''; 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); $html_results = $this->tpl->getTemplate('install_results'); $this->messages = array(); } $tpl_id = $this->getTemplateId(); - $this->setTemplateId('install', 'install.tpl.html'); + $this->setTemplateId('install', 'install/install.tpl.html'); $this->tpl->addTemplateData($this->getTemplateId(), array( 'html_install' => $this->tpl->getTemplate($tpl_id), @@ -82,7 +82,7 @@ class InstallController extends AbstractController { * Say hi to our new user */ protected function executeIndex() { - $this->setTemplateId('install_index', 'install.tpl.html'); + $this->setTemplateId('install_index', 'install/install.tpl.html'); // build prerequisites $errors = 0; @@ -113,7 +113,7 @@ class InstallController extends AbstractController { * Help the user create a new config file */ protected function executeConfig() { - $this->setTemplateId('install_config_new', 'install.tpl.html'); + $this->setTemplateId('install_config_new', 'install/install.tpl.html'); $tpl_data = array(); if(!defined('PSM_DB_PREFIX')) { @@ -165,7 +165,7 @@ class InstallController extends AbstractController { $this->addMessage('Configuration file written successfully.', 'success'); } else { $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['php_config'] = $config_php; } @@ -182,14 +182,14 @@ class InstallController extends AbstractController { if(version_compare(PSM_VERSION, '2.2.0', '<')) { // 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->setTemplateId('install_config_new_user', 'install.tpl.html'); + $this->setTemplateId('install_config_new_user', 'install/install.tpl.html'); } else { - $this->setTemplateId('install_config_upgrade', 'install.tpl.html'); + $this->setTemplateId('install_config_upgrade', 'install/install.tpl.html'); $tpl_data['version'] = PSM_VERSION; } } else { // 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['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'); } /** diff --git a/src/psm/Module/Server/Controller/LogController.class.php b/src/psm/Module/Server/Controller/LogController.class.php index 9d83167d..65e617bc 100644 --- a/src/psm/Module/Server/Controller/LogController.class.php +++ b/src/psm/Module/Server/Controller/LogController.class.php @@ -44,7 +44,7 @@ class LogController extends AbstractServerController { * Prepare the template with a list of all log entries */ protected function executeIndex() { - $this->setTemplateId('log_list', 'log.tpl.html'); + $this->setTemplateId('server_log_list', 'server/log.tpl.html'); $entries = array(); $entries['status'] = $this->getEntries('status'); @@ -80,10 +80,10 @@ class LogController extends AbstractServerController { } // add entries to template - $this->tpl->newTemplate('log_entries', 'log.tpl.html'); - $this->tpl->addTemplateDataRepeat('log_entries', 'entries', $records); + $this->tpl->newTemplate('server_log_entries', 'server/log.tpl.html'); + $this->tpl->addTemplateDataRepeat('server_log_entries', 'entries', $records); $this->tpl->addTemplateData( - 'log_entries', + 'server_log_entries', array( 'logtitle' => $key, ) @@ -91,7 +91,7 @@ class LogController extends AbstractServerController { $this->tpl->addTemplateData( $this->getTemplateId(), array( - 'content_' . $key => $this->tpl->getTemplate('log_entries'), + 'content_' . $key => $this->tpl->getTemplate('server_log_entries'), ) ); } diff --git a/src/psm/Module/Server/Controller/ServerController.class.php b/src/psm/Module/Server/Controller/ServerController.class.php index 9dbfdbca..2ac9823b 100644 --- a/src/psm/Module/Server/Controller/ServerController.class.php +++ b/src/psm/Module/Server/Controller/ServerController.class.php @@ -51,7 +51,7 @@ class ServerController extends AbstractServerController { * Prepare the template to show a list of all servers */ 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); $this->setSidebar($sidebar); @@ -64,8 +64,8 @@ class ServerController extends AbstractServerController { 'plus' ); // get the action buttons per server - $this->tpl->newTemplate('servers_list_admin_actions', 'servers.tpl.html'); - $html_actions = $this->tpl->getTemplate('servers_list_admin_actions'); + $this->tpl->newTemplate('server_list_admin_actions', 'server/server.tpl.html'); + $html_actions = $this->tpl->getTemplate('server_list_admin_actions'); } else { $html_actions = ''; } @@ -104,7 +104,7 @@ class ServerController extends AbstractServerController { * Prepare the template to show the update screen for a single server */ 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); $this->setSidebar($sidebar); diff --git a/src/psm/Module/Server/Controller/StatusController.class.php b/src/psm/Module/Server/Controller/StatusController.class.php index 6d2d6d82..b7568712 100644 --- a/src/psm/Module/Server/Controller/StatusController.class.php +++ b/src/psm/Module/Server/Controller/StatusController.class.php @@ -46,7 +46,7 @@ class StatusController extends AbstractServerController { * @todo move the background colurs to the config */ protected function executeIndex() { - $this->setTemplateId('status', 'status.tpl.html'); + $this->setTemplateId('server_status', 'server/status.tpl.html'); $this->addFooter(false); // get the active servers from database diff --git a/src/psm/Module/User/Controller/LoginController.class.php b/src/psm/Module/User/Controller/LoginController.class.php index 2a959291..51e3b119 100644 --- a/src/psm/Module/User/Controller/LoginController.class.php +++ b/src/psm/Module/User/Controller/LoginController.class.php @@ -46,7 +46,7 @@ class LoginController extends AbstractController { } 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'])) { $rememberme = (isset($_POST['user_rememberme'])) ? true : false; @@ -83,7 +83,7 @@ class LoginController extends AbstractController { * Show/process the password forgot form (before the mail) */ protected function executeForgot() { - $this->setTemplateId('login_forgot', 'login.tpl.html'); + $this->setTemplateId('user_login_forgot', 'user/login.tpl.html'); if(isset($_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) */ 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; $token = (isset($_GET['token'])) ? $_GET['token'] : ''; diff --git a/src/psm/Module/User/Controller/UserController.class.php b/src/psm/Module/User/Controller/UserController.class.php index 14269235..2a19f796 100644 --- a/src/psm/Module/User/Controller/UserController.class.php +++ b/src/psm/Module/User/Controller/UserController.class.php @@ -68,7 +68,7 @@ class UserController extends AbstractController { * Prepare the template to show a list of all users */ 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); $this->setSidebar($sidebar); @@ -113,7 +113,7 @@ class UserController extends AbstractController { * Prepare the template to show the update screen for a user */ 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); $this->setSidebar($sidebar); diff --git a/src/psm/Util/Install/Installer.class.php b/src/psm/Util/Install/Installer.class.php index 21e65cf2..c840fc59 100644 --- a/src/psm/Util/Install/Installer.class.php +++ b/src/psm/Util/Install/Installer.class.php @@ -118,6 +118,7 @@ class Installer { ('log_email', '1'), ('log_sms', '1'), ('version', '" . PSM_VERSION . "'), + ('version_update_check', '" . PSM_VERSION . "'), ('auto_refresh_servers', '0'), ('show_update', '1'), ('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`='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 `server_id` `server_id` INT( 11 ) UNSIGNED NOT NULL;"; diff --git a/src/templates/config.tpl.html b/src/templates/config/config.tpl.html similarity index 100% rename from src/templates/config.tpl.html rename to src/templates/config/config.tpl.html diff --git a/src/templates/install.tpl.html b/src/templates/install/install.tpl.html similarity index 100% rename from src/templates/install.tpl.html rename to src/templates/install/install.tpl.html diff --git a/src/templates/main.tpl.html b/src/templates/main.tpl.html index 083b2664..d043a077 100755 --- a/src/templates/main.tpl.html +++ b/src/templates/main.tpl.html @@ -102,6 +102,6 @@ diff --git a/src/templates/log.tpl.html b/src/templates/server/log.tpl.html similarity index 90% rename from src/templates/log.tpl.html rename to src/templates/server/log.tpl.html index 666e40c5..9cc631c7 100755 --- a/src/templates/log.tpl.html +++ b/src/templates/server/log.tpl.html @@ -1,4 +1,4 @@ - +
- + - + @@ -42,4 +42,4 @@ {entries}
- \ No newline at end of file + \ No newline at end of file diff --git a/src/templates/servers.tpl.html b/src/templates/server/server.tpl.html similarity index 95% rename from src/templates/servers.tpl.html rename to src/templates/server/server.tpl.html index 23b16738..e81cd77f 100755 --- a/src/templates/servers.tpl.html +++ b/src/templates/server/server.tpl.html @@ -1,4 +1,4 @@ - + @@ -38,18 +38,18 @@ {servers}
- + - + - + - +
{titlemode} @@ -125,4 +125,4 @@
- \ No newline at end of file + \ No newline at end of file diff --git a/src/templates/status.tpl.html b/src/templates/server/status.tpl.html similarity index 96% rename from src/templates/status.tpl.html rename to src/templates/server/status.tpl.html index 82ed5831..e5878447 100755 --- a/src/templates/status.tpl.html +++ b/src/templates/server/status.tpl.html @@ -1,4 +1,4 @@ - +