adding upgrade message for 2.1 upgrades

This commit is contained in:
Pepijn Over 2014-03-14 21:32:09 +01:00
parent 48f9ce168d
commit 59eddd9380
2 changed files with 15 additions and 7 deletions

View File

@ -86,17 +86,25 @@ it will open a page where you can change the necessary information for your tool
## Upgrade
For a regular upgrade, follow these steps:
* Replace all files except(!) config.php
* Navigate to install.php
* Follow the steps
* Enjoy
### From 2.0
The structure of the project has changed quite a bit since 2.0, but if you have not made any local changes the upgrade is quite easy.
The best thing to do is to replace all your current files with the new release, except for the config.inc.php file.
The config file has actually been renamed since 2.0, but if you keep it there while upgrading the install script will use it to prefill your database information.
The rest of the steps are identical to a regular upgrade (see above), except that you can remove the old config.inc.php file afterwards.
* Replace all files except(!) config.inc.php
* Navigate to install.php
* Follow the steps
* Remove the old config.inc.php file
### From 2.1
One of the new features introduced in 2.2 is a user authentication system. Because the users in previous versions do not have a password, after upgrading you would not be able to login.
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 change the username of all existing users to their email addresses, which you could use for the forgot password screen.
## Setting up a cronjob
@ -160,4 +168,4 @@ See CREDITS file.
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/>.
along with PHP Server Monitor. If not, see <http://www.gnu.org/licenses/>.

View File

@ -177,9 +177,9 @@ class Install extends AbstractModule {
if($this->db->status()) {
if($this->isUpgrade()) {
// upgrade
if(version_compare($version_from, '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
$this->addMessage('PLEASE CREATE A USER!', 'warning');
$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');
} else {
$this->setTemplateId('install_config_upgrade', 'install.tpl.html');