diff --git a/src/includes/password_compatibility_library.inc.php b/src/includes/password_compatibility_library.inc.php index 6442b715..09999ed5 100644 --- a/src/includes/password_compatibility_library.inc.php +++ b/src/includes/password_compatibility_library.inc.php @@ -23,7 +23,7 @@ * @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3 * @version Release: @package_version@ * @link http://www.phpservermonitor.org/ - * @since phpservermon 2.2.0 + * @since phpservermon 3.0.0 **/ /** diff --git a/src/includes/psmconfig.inc.php b/src/includes/psmconfig.inc.php index 997f983c..1e92e60f 100644 --- a/src/includes/psmconfig.inc.php +++ b/src/includes/psmconfig.inc.php @@ -23,13 +23,13 @@ * @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3 * @version Release: @package_version@ * @link http://www.phpservermonitor.org/ - * @since phpservermon 2.2.0 + * @since phpservermon 3.0.0 **/ /** * Current PSM version */ -define('PSM_VERSION', '2.2.0-dev'); +define('PSM_VERSION', '3.0.0'); /** * URL to check for updates. Will not be checked if turned off on config page. diff --git a/src/psm/Module/Config/ConfigModule.class.php b/src/psm/Module/Config/ConfigModule.class.php index d6ce4c01..0ba96740 100644 --- a/src/psm/Module/Config/ConfigModule.class.php +++ b/src/psm/Module/Config/ConfigModule.class.php @@ -23,7 +23,7 @@ * @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3 * @version Release: @package_version@ * @link http://www.phpservermonitor.org/ - * @since phpservermon 2.2 + * @since phpservermon 3.0 **/ namespace psm\Module\Config; diff --git a/src/psm/Module/Install/Controller/InstallController.class.php b/src/psm/Module/Install/Controller/InstallController.class.php index f332960f..fde992e3 100644 --- a/src/psm/Module/Install/Controller/InstallController.class.php +++ b/src/psm/Module/Install/Controller/InstallController.class.php @@ -182,9 +182,9 @@ class InstallController extends AbstractController { if($this->db->status()) { if($this->isUpgrade()) { // upgrade - 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'); + if(version_compare(PSM_VERSION, '3.0.0', '<')) { + // upgrade from before 3.0, does not have passwords yet.. create new user first + $this->addMessage('Your current version does not have an authentication system, but since v3.0 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/install.tpl.html'); } else { $this->setTemplateId('install_config_upgrade', 'install/install.tpl.html'); @@ -213,7 +213,7 @@ class InstallController extends AbstractController { } // check if user submitted username + password in previous step // this would only be the case for new installs, and install from - // before 2.2 + // before 3.0 $new_user = array( 'user_name' => psm_POST('username'), 'name' => psm_POST('username'), @@ -244,7 +244,7 @@ class InstallController extends AbstractController { $installer->upgrade($version_from, PSM_VERSION); } - if(version_compare($version_from, '2.2.0', '<')) { + if(version_compare($version_from, '3.0.0', '<')) { $add_user = true; } } diff --git a/src/psm/Module/Install/InstallModule.class.php b/src/psm/Module/Install/InstallModule.class.php index 4ee600c1..97b7d934 100644 --- a/src/psm/Module/Install/InstallModule.class.php +++ b/src/psm/Module/Install/InstallModule.class.php @@ -23,7 +23,7 @@ * @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3 * @version Release: @package_version@ * @link http://www.phpservermonitor.org/ - * @since phpservermon 2.2 + * @since phpservermon 3.0 **/ namespace psm\Module\Install; diff --git a/src/psm/Module/ModuleInterface.class.php b/src/psm/Module/ModuleInterface.class.php index b02fe705..206f24fb 100644 --- a/src/psm/Module/ModuleInterface.class.php +++ b/src/psm/Module/ModuleInterface.class.php @@ -23,7 +23,7 @@ * @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3 * @version Release: @package_version@ * @link http://www.phpservermonitor.org/ - * @since phpservermon 2.2 + * @since phpservermon 3.0 **/ namespace psm\Module; diff --git a/src/psm/Module/Server/Controller/AbstractServerController.class.php b/src/psm/Module/Server/Controller/AbstractServerController.class.php index 7015f542..260fc606 100644 --- a/src/psm/Module/Server/Controller/AbstractServerController.class.php +++ b/src/psm/Module/Server/Controller/AbstractServerController.class.php @@ -23,7 +23,7 @@ * @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3 * @version Release: @package_version@ * @link http://www.phpservermonitor.org/ - * @since phpservermon 2.2.0 + * @since phpservermon 3.0.0 **/ namespace psm\Module\Server\Controller; diff --git a/src/psm/Module/Server/Controller/ServerController.class.php b/src/psm/Module/Server/Controller/ServerController.class.php index 896718fa..74c1e779 100644 --- a/src/psm/Module/Server/Controller/ServerController.class.php +++ b/src/psm/Module/Server/Controller/ServerController.class.php @@ -266,11 +266,11 @@ class ServerController extends AbstractServerController { // add all available servers to the menu $servers = $this->getServers(); $options = array(); - foreach($servers as $i => $server) { + foreach($servers as $i => $server_available) { $options[] = array( - 'class_active' => ($server['server_id'] == $this->server_id) ? 'active' : '', - 'url' => psm_build_url(array('mod' => 'server', 'action' => 'view', 'id' => $server['server_id'])), - 'label' => $server['label'], + 'class_active' => ($server_available['server_id'] == $this->server_id) ? 'active' : '', + 'url' => psm_build_url(array('mod' => 'server', 'action' => 'view', 'id' => $server_available['server_id'])), + 'label' => $server_available['label'], ); } $sidebar = new \psm\Util\Module\Sidebar($this->tpl); @@ -278,13 +278,13 @@ class ServerController extends AbstractServerController { $sidebar->addDropdown( 'server', - psm_get_lang('menu', 'server'), + $server['label'], $options, 'th', 'success' ); // check which module the user came from, and add a link accordingly - $back_to = isset($_GET['back_to']) && $_GET['back_to'] == 'status' ? $_GET['back_to'] : 'server'; + $back_to = isset($_GET['back_to']) && $_GET['back_to'] == 'server_status' ? $_GET['back_to'] : 'server'; $sidebar->addButton( 'go_back', psm_get_lang('system', 'go_back'), diff --git a/src/psm/Module/Server/Controller/UpdateController.class.php b/src/psm/Module/Server/Controller/UpdateController.class.php index bb753ac3..f6f241ff 100644 --- a/src/psm/Module/Server/Controller/UpdateController.class.php +++ b/src/psm/Module/Server/Controller/UpdateController.class.php @@ -24,7 +24,7 @@ * @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3 * @version Release: @package_version@ * @link http://www.phpservermonitor.org/ - * @since phpservermon 2.2.0 + * @since phpservermon 3.0.0 **/ namespace psm\Module\Server\Controller; diff --git a/src/psm/Module/Server/ServerModule.class.php b/src/psm/Module/Server/ServerModule.class.php index 2055192f..0c72801b 100644 --- a/src/psm/Module/Server/ServerModule.class.php +++ b/src/psm/Module/Server/ServerModule.class.php @@ -23,7 +23,7 @@ * @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3 * @version Release: @package_version@ * @link http://www.phpservermonitor.org/ - * @since phpservermon 2.2 + * @since phpservermon 3.0 **/ namespace psm\Module\Server; diff --git a/src/psm/Module/User/Controller/LoginController.class.php b/src/psm/Module/User/Controller/LoginController.class.php index 51e3b119..a363fa2b 100644 --- a/src/psm/Module/User/Controller/LoginController.class.php +++ b/src/psm/Module/User/Controller/LoginController.class.php @@ -23,7 +23,7 @@ * @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3 * @version Release: @package_version@ * @link http://www.phpservermonitor.org/ - * @since phpservermon 2.2.0 + * @since phpservermon 3.0.0 **/ namespace psm\Module\User\Controller; diff --git a/src/psm/Module/User/Controller/ProfileController.class.php b/src/psm/Module/User/Controller/ProfileController.class.php index 5f6a5a2e..a9d11158 100644 --- a/src/psm/Module/User/Controller/ProfileController.class.php +++ b/src/psm/Module/User/Controller/ProfileController.class.php @@ -22,7 +22,7 @@ * @copyright Copyright (c) 2008-2014 Pepijn Over * @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3 * @version Release: @package_version@ - * @since phpservermon 2.2.0 + * @since phpservermon 3.0.0 **/ namespace psm\Module\User\Controller; diff --git a/src/psm/Module/User/UserModule.class.php b/src/psm/Module/User/UserModule.class.php index 4ff6f761..824bd72b 100644 --- a/src/psm/Module/User/UserModule.class.php +++ b/src/psm/Module/User/UserModule.class.php @@ -23,7 +23,7 @@ * @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3 * @version Release: @package_version@ * @link http://www.phpservermonitor.org/ - * @since phpservermon 2.2 + * @since phpservermon 3.0 **/ namespace psm\Module\User; diff --git a/src/psm/Router.class.php b/src/psm/Router.class.php index 6072f37e..378f302a 100644 --- a/src/psm/Router.class.php +++ b/src/psm/Router.class.php @@ -23,7 +23,7 @@ * @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3 * @version Release: @package_version@ * @link http://www.phpservermonitor.org/ - * @since phpservermon 2.2 + * @since phpservermon 3.0 **/ namespace psm; diff --git a/src/psm/Service/Database.class.php b/src/psm/Service/Database.class.php index 4dc998af..d5933809 100644 --- a/src/psm/Service/Database.class.php +++ b/src/psm/Service/Database.class.php @@ -494,5 +494,3 @@ class Database { trigger_error('SQL error: ' . $e->getMessage(), E_USER_WARNING); } } - -?> \ No newline at end of file diff --git a/src/psm/Service/Template.class.php b/src/psm/Service/Template.class.php index eb212991..8c639f1a 100644 --- a/src/psm/Service/Template.class.php +++ b/src/psm/Service/Template.class.php @@ -28,9 +28,20 @@ namespace psm\Service; class Template { - protected $output; + + /** + * Loaded templates + * @var array $templates + */ protected $templates = array(); + /** + * Cache of parsed files + * @var array $files_parsed + * @see parseFile() + */ + protected $files_parsed = array(); + function __construct() { // add the main template $this->newTemplate('main', 'main.tpl.html'); @@ -255,13 +266,18 @@ class Template { protected function parseFile($filename) { if (!file_exists($filename)) return false; + if(isset($this->files_parsed[$filename])) { + return $this->files_parsed[$filename]; + } + ob_start(); include($filename); $file_content = ob_get_contents(); ob_end_clean(); + $this->files_parsed[$filename] = $file_content; + return $file_content; } } -?> diff --git a/src/psm/Service/User.class.php b/src/psm/Service/User.class.php index 40eb5139..ca2dd04b 100644 --- a/src/psm/Service/User.class.php +++ b/src/psm/Service/User.class.php @@ -24,7 +24,7 @@ * @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3 * @version Release: @package_version@ * @link http://www.phpservermonitor.org/ - * @since phpservermon 2.2.0 + * @since phpservermon 3.0.0 **/ namespace psm\Service; diff --git a/src/psm/Txtmsg/Clickatell.class.php b/src/psm/Txtmsg/Clickatell.class.php index 7b25901e..eac33b97 100644 --- a/src/psm/Txtmsg/Clickatell.class.php +++ b/src/psm/Txtmsg/Clickatell.class.php @@ -64,5 +64,3 @@ class Clickatell extends Core { return psm_curl_get($url); } } - -?> \ No newline at end of file diff --git a/src/psm/Txtmsg/Core.class.php b/src/psm/Txtmsg/Core.class.php index 36bf84c6..16dee361 100644 --- a/src/psm/Txtmsg/Core.class.php +++ b/src/psm/Txtmsg/Core.class.php @@ -62,5 +62,3 @@ abstract class Core implements TxtmsgInterface { array_push($this->recipients, $recipient); } } - -?> \ No newline at end of file diff --git a/src/psm/Txtmsg/Inetworx.class.php b/src/psm/Txtmsg/Inetworx.class.php index 2f3f7e1b..ec2f8887 100644 --- a/src/psm/Txtmsg/Inetworx.class.php +++ b/src/psm/Txtmsg/Inetworx.class.php @@ -143,5 +143,3 @@ class Inetworx extends Core { } //end function auth_https_post } - -?> diff --git a/src/psm/Txtmsg/Mollie.class.php b/src/psm/Txtmsg/Mollie.class.php index 2125ecbb..cf9c6b50 100644 --- a/src/psm/Txtmsg/Mollie.class.php +++ b/src/psm/Txtmsg/Mollie.class.php @@ -97,5 +97,4 @@ class Mollie extends Core { } return $buf; } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/src/psm/Txtmsg/Mosms.class.php b/src/psm/Txtmsg/Mosms.class.php index 3389636c..d2e37d19 100644 --- a/src/psm/Txtmsg/Mosms.class.php +++ b/src/psm/Txtmsg/Mosms.class.php @@ -54,5 +54,3 @@ class Mosms extends Core { return $result; } } - -?> \ No newline at end of file diff --git a/src/psm/Txtmsg/Spryng.class.php b/src/psm/Txtmsg/Spryng.class.php index 015ad33d..36ed0601 100644 --- a/src/psm/Txtmsg/Spryng.class.php +++ b/src/psm/Txtmsg/Spryng.class.php @@ -73,5 +73,3 @@ class Spryng extends Core { return $data; } } - -?> \ No newline at end of file diff --git a/src/psm/Txtmsg/Textmarketer.php b/src/psm/Txtmsg/Textmarketer.php index d89fecdf..5952bc7d 100644 --- a/src/psm/Txtmsg/Textmarketer.php +++ b/src/psm/Txtmsg/Textmarketer.php @@ -57,5 +57,3 @@ class Textmarketer extends Core { } } - -?> diff --git a/src/psm/Txtmsg/TxtmsgInterface.class.php b/src/psm/Txtmsg/TxtmsgInterface.class.php index e679a6c5..8bd7b0a8 100644 --- a/src/psm/Txtmsg/TxtmsgInterface.class.php +++ b/src/psm/Txtmsg/TxtmsgInterface.class.php @@ -35,5 +35,3 @@ interface TxtmsgInterface { public function sendSMS($message); } - -?> \ No newline at end of file diff --git a/src/psm/Util/Install/Installer.class.php b/src/psm/Util/Install/Installer.class.php index c840fc59..f8c1c17a 100644 --- a/src/psm/Util/Install/Installer.class.php +++ b/src/psm/Util/Install/Installer.class.php @@ -229,9 +229,9 @@ class Installer { // upgrade to 2.1.0 $this->upgrade210(); } - if(version_compare($version_from, '2.2.0', '<')) { - // upgrade to 2.2.0 - $this->upgrade220(); + if(version_compare($version_from, '3.0.0', '<')) { + // upgrade to 3.0.0 + $this->upgrade300(); } $this->db->save(PSM_DB_PREFIX . 'config', array('value' => $version_to), array('key' => 'version')); } @@ -257,9 +257,9 @@ class Installer { } /** - * Upgrade for v2.2.0 release + * Upgrade for v3.0.0 release */ - protected function upgrade220() { + protected function upgrade300() { $queries = array(); // language is now stored as language code (ISO 639-1) + country code (ISO 3166-1) $queries[] = "UPDATE `" . PSM_DB_PREFIX . "config` SET `value`='bg_BG' WHERE `key`='language' AND `value`='bg';"; @@ -321,7 +321,7 @@ class Installer { ) ENGINE = MYISAM ;"; $this->execSQL($queries); - // from 2.2 all user-server relations are in a separate table + // from 3.0 all user-server relations are in a separate table $users = $this->db->select(PSM_DB_PREFIX . 'users', null, array('user_id', 'server_id')); foreach($users as $user) { $idc = array(); diff --git a/src/psm/Util/Mailer.class.php b/src/psm/Util/Mailer.class.php index cd4931f9..18f369dd 100644 --- a/src/psm/Util/Mailer.class.php +++ b/src/psm/Util/Mailer.class.php @@ -23,7 +23,7 @@ * @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3 * @version Release: @package_version@ * @link http://www.phpservermonitor.org/ - * @since phpservermon 2.2.0 + * @since phpservermon 3.0.0 **/ namespace psm\Util; @@ -53,5 +53,3 @@ class Mailer extends \PHPMailer { } } - -?> \ No newline at end of file diff --git a/src/psm/Util/Updater/Autorun.class.php b/src/psm/Util/Updater/Autorun.class.php index 8e789012..9dfb0902 100644 --- a/src/psm/Util/Updater/Autorun.class.php +++ b/src/psm/Util/Updater/Autorun.class.php @@ -23,7 +23,7 @@ * @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3 * @version Release: @package_version@ * @link http://www.phpservermonitor.org/ - * @since phpservermon 2.2.0 + * @since phpservermon 3.0.0 **/ namespace psm\Util\Updater; diff --git a/src/psm/Util/User/UserValidator.class.php b/src/psm/Util/User/UserValidator.class.php index ef06be2a..77fa822b 100644 --- a/src/psm/Util/User/UserValidator.class.php +++ b/src/psm/Util/User/UserValidator.class.php @@ -23,7 +23,7 @@ * @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3 * @version Release: @package_version@ * @link http://www.phpservermonitor.org/ - * @since phpservermon 2.2.0 + * @since phpservermon 3.0.0 **/ namespace psm\Util\User;