Skip to content

Commit

Permalink
bug in upgrade script causing it not to ask for new user;
Browse files Browse the repository at this point in the history
makefile: execute lint check on target folder instead of source;
redirect user to install if no installation is found
  • Loading branch information
Pepijn Over committed Apr 6, 2014
1 parent 3ee8b94 commit bf0a2a3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea/*
/nbproject
/config.php
/build
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ help:

export:
@echo 'Building release for tag $(tag) '
@echo 'Testing on syntax errors (thats all the automated testing your are going to get for now..) '
find . -name "*.php" | xargs -I file php -l file
rm -rf ./build
mkdir ./build ./build/phpservermon
mkdir -p ./build ./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 -type f | xargs chmod 0644
find ./build/phpservermon -type d | xargs chmod 0755
Expand Down
3 changes: 2 additions & 1 deletion src/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ function __autoload($class) {
// attempt to load configuration from database
if(!psm_load_conf()) {
// 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
$version_db = psm_get_conf('version');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ protected function executeConfig() {
if($this->db->status()) {
if($this->isUpgrade()) {
// 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
$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');
Expand Down

0 comments on commit bf0a2a3

Please sign in to comment.