diff --git a/README.md b/README.md index d4bc024f..e11bde2a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![OpenSupports](http://www.opensupports.com/logo.png) -[![Build Status](https://travis-ci.org/opensupports/opensupports.svg?branch=master)](https://travis-ci.org/opensupports/opensupports) v4.1.1 +[![Build Status](https://travis-ci.org/opensupports/opensupports.svg?branch=master)](https://travis-ci.org/opensupports/opensupports) v4.1.2 OpenSupports is an open source ticket system built primarily with PHP and ReactJS. Please, visit our website for more information: [http://www.opensupports.com/](http://www.opensupports.com/) diff --git a/client/package.json b/client/package.json index 228d77d4..784b2b4d 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "OpenSupports", - "version": "4.1.1", + "version": "4.1.2", "author": "Ivan Diaz ", "description": "Open source ticket system made with PHP and ReactJS", "repository": { diff --git a/client/src/app/install/install-step-4-user-system.js b/client/src/app/install/install-step-4-user-system.js index 528efd8a..d4ae18c0 100644 --- a/client/src/app/install/install-step-4-user-system.js +++ b/client/src/app/install/install-step-4-user-system.js @@ -30,7 +30,6 @@ class InstallStep4UserSystem extends React.Component {
{i18n('NEXT')} -
@@ -46,17 +45,12 @@ class InstallStep4UserSystem extends React.Component { }); } - onPreviousClick(event) { - event.preventDefault(); - history.push('/install/step-3'); - } - onSubmit(form) { this.props.dispatch(ConfigActions.updateUserSystemSettings({ 'user-system-enabled': form['user-system-enabled'] * 1, 'registration': form['registration'] * 1 })); - + history.push('/install/step-5'); } @@ -69,4 +63,4 @@ export default connect((store) => { return { language: store.config.language }; -})(InstallStep4UserSystem); \ No newline at end of file +})(InstallStep4UserSystem); diff --git a/server/controllers/system/check-requirements.php b/server/controllers/system/check-requirements.php index 5eb35cb2..1958460f 100755 --- a/server/controllers/system/check-requirements.php +++ b/server/controllers/system/check-requirements.php @@ -30,7 +30,9 @@ class CheckRequirementsController extends Controller { } public function handler() { - $configWritable = !!fopen('config.php', 'w+'); + if(InstallationDoneController::isInstallationDone()) { + throw new Exception(ERRORS::INIT_SETTINGS_DONE); + } Response::respondSuccess([ 'phpVersion' => [ @@ -50,8 +52,8 @@ class CheckRequirementsController extends Controller { ], 'files' => [ 'name' => 'Folder: /api/files', - 'value' => $configWritable ? 'Writable' : 'Not writable', - 'ok' => $configWritable + 'value' => is_writable('files') ? 'Writable' : 'Not writable', + 'ok' => is_writable('files') ] ]); } @@ -64,4 +66,4 @@ class CheckRequirementsController extends Controller { else if($currentVersion[0] < $requiredVersion[0]) return false; else return $currentVersion[1] >= $requiredVersion[1]; } -} \ No newline at end of file +} diff --git a/server/controllers/system/init-database.php b/server/controllers/system/init-database.php index dd21c026..d777add9 100755 --- a/server/controllers/system/init-database.php +++ b/server/controllers/system/init-database.php @@ -48,9 +48,7 @@ class InitDatabaseController extends Controller { $dbUser = Controller::request('dbUser'); $dbPass = Controller::request('dbPassword'); - if(!defined('MYSQL_HOST')) { - RedBean::setup('mysql:host=' . $dbHost, $dbUser, $dbPass); - } + RedBean::setup('mysql:host=' . $dbHost, $dbUser, $dbPass); if($dbName) { RedBean::addDatabase($dbName, 'mysql:host='. $dbHost . ';dbname=' . $dbName, $dbUser, $dbPass); @@ -81,4 +79,4 @@ class InitDatabaseController extends Controller { fclose($configFile); Response::respondSuccess(); } -} \ No newline at end of file +} diff --git a/tests/system/init-settings.rb b/tests/system/init-settings.rb index 920815dc..4a10c846 100644 --- a/tests/system/init-settings.rb +++ b/tests/system/init-settings.rb @@ -1,4 +1,17 @@ describe '/system/init-settings' do + it 'should prevent initing database if already called' do + result = request('/system/init-database', {}) + (result['status']).should.equal('fail') + (result['message']).should.equal('INIT_SETTINGS_DONE') + + result = request('/system/check-requirements', {}) + (result['status']).should.equal('success') + + result = request('/system/init-database', {}) + (result['status']).should.equal('fail') + (result['message']).should.equal('INIT_SETTINGS_DONE') + end + it 'should initialize correctly' do result = request('/system/init-settings', { 'user-system-enabled' => true, @@ -25,4 +38,4 @@ describe '/system/init-settings' do (result['status']).should.equal('success') end -end \ No newline at end of file +end diff --git a/version_upgrades/4.1.1/4.1.1.php b/version_upgrades/4.1.2/4.1.2.php similarity index 100% rename from version_upgrades/4.1.1/4.1.1.php rename to version_upgrades/4.1.2/4.1.2.php diff --git a/version_upgrades/4.1.1/libs/Hashing.php b/version_upgrades/4.1.2/libs/Hashing.php similarity index 100% rename from version_upgrades/4.1.1/libs/Hashing.php rename to version_upgrades/4.1.2/libs/Hashing.php diff --git a/version_upgrades/4.1.1/libs/LinearCongruentialGenerator.php b/version_upgrades/4.1.2/libs/LinearCongruentialGenerator.php similarity index 100% rename from version_upgrades/4.1.1/libs/LinearCongruentialGenerator.php rename to version_upgrades/4.1.2/libs/LinearCongruentialGenerator.php diff --git a/version_upgrades/4.1.1/libs/MailSender.php b/version_upgrades/4.1.2/libs/MailSender.php similarity index 98% rename from version_upgrades/4.1.1/libs/MailSender.php rename to version_upgrades/4.1.2/libs/MailSender.php index 10751415..e8850bfc 100644 --- a/version_upgrades/4.1.1/libs/MailSender.php +++ b/version_upgrades/4.1.2/libs/MailSender.php @@ -1,5 +1,5 @@