bug in upgrade script causing it not to ask for new user;

makefile: execute lint check on target folder instead of source;
redirect user to install if no installation is found
This commit is contained in:
Pepijn Over 2014-04-06 16:52:58 +02:00
parent 3ee8b9406b
commit bf0a2a34de
4 changed files with 7 additions and 6 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
.idea/* .idea/*
/nbproject /nbproject
/config.php /config.php
/build

View File

@ -6,11 +6,10 @@ help:
export: export:
@echo 'Building release for tag $(tag) ' @echo 'Building release for tag $(tag) '
@echo 'Testing on syntax errors (thats all the automated testing your are going to get for now..) ' mkdir -p ./build ./build/phpservermon
find . -name "*.php" | xargs -I file php -l file
rm -rf ./build
mkdir ./build ./build/phpservermon
git archive $(tag) | tar -xf - -C ./build/phpservermon/ git archive $(tag) | tar -xf - -C ./build/phpservermon/
@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/phpservermon -name "*.php" -exec sed -i "" "s/@package_version@/$(tag)/" {} \;
find ./build/phpservermon -type f | xargs chmod 0644 find ./build/phpservermon -type f | xargs chmod 0644
find ./build/phpservermon -type d | xargs chmod 0755 find ./build/phpservermon -type d | xargs chmod 0755

View File

@ -109,7 +109,8 @@ if(defined('PSM_INSTALL') && PSM_INSTALL) {
// attempt to load configuration from database // attempt to load configuration from database
if(!psm_load_conf()) { if(!psm_load_conf()) {
// unable to load from config table // unable to load from config table
die('We were unable to find an existing installation. <a href="install.php">Please click here to install PHP Server Monitor</a>.'); header('Location: install.php');
die();
} }
// config load OK, make sure database version is up to date // config load OK, make sure database version is up to date
$version_db = psm_get_conf('version'); $version_db = psm_get_conf('version');

View File

@ -182,7 +182,7 @@ class InstallController extends AbstractController {
if($this->db->status()) { if($this->db->status()) {
if($this->isUpgrade()) { if($this->isUpgrade()) {
// upgrade // upgrade
if(version_compare(PSM_VERSION, '3.0.0', '<')) { if(version_compare($this->getPreviousVersion(), '3.0.0', '<')) {
// upgrade from before 3.0, does not have passwords yet.. create new user first // 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->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'); $this->setTemplateId('install_config_new_user', 'install/install.tpl.html');