diff --git a/nexus/Install/Install.php b/nexus/Install/Install.php index afc891dc..b3f4652b 100644 --- a/nexus/Install/Install.php +++ b/nexus/Install/Install.php @@ -632,4 +632,16 @@ class Install return compact('version', 'match'); } + public function checkLock($path) + { + if (file_exists("$path/.lock")) { + die("Locked! Delete .lock file first"); + } + } + + public function setLock($path) + { + file_put_contents("$path/.lock", "Lock at: " . date('Y-m-d H:i:s')); + } + } diff --git a/nexus/Install/install/install.php b/nexus/Install/install/install.php index e2a86e39..253e09da 100644 --- a/nexus/Install/install/install.php +++ b/nexus/Install/install/install.php @@ -5,6 +5,7 @@ require ROOT_PATH . 'nexus/Install/install_update_start.php'; $isPost = $_SERVER['REQUEST_METHOD'] == 'POST'; $install = new \Nexus\Install\Install(); +$install->checkLock(__DIR__); $currentStep = $install->currentStep(); $maxStep = $install->maxStep(); if (!$install->canAccessStep($currentStep)) { @@ -191,6 +192,7 @@ if (!empty($error) || (isset($mysqlInfo) && !$mysqlInfo['match'])) { echo '
For questions, consult the installation log at: ' . $install->getLogFile() . '
'; echo '
For security reasons, please delete the following directories
'; echo '
' . $install->getInsallDirectory() . '
'; + $install->setLock(__DIR__); } echo''; diff --git a/nexus/Install/update/update.php b/nexus/Install/update/update.php index be246862..1698f536 100644 --- a/nexus/Install/update/update.php +++ b/nexus/Install/update/update.php @@ -5,6 +5,7 @@ require ROOT_PATH . 'nexus/Install/install_update_start.php'; $isPost = $_SERVER['REQUEST_METHOD'] == 'POST'; $update = new \Nexus\Install\Update(); +$update->checkLock(__DIR__); $currentStep = $update->currentStep(); $maxStep = $update->maxStep(); if (!$update->canAccessStep($currentStep)) { @@ -227,6 +228,7 @@ if (!empty($error) || (isset($mysqlInfo) && !$mysqlInfo['match'])) { echo '
For questions, consult the upgrade log at: ' . $update->getLogFile() . '
'; echo '
For security reasons, please delete the following directories
'; echo '
' . $update->getUpdateDirectory() . '
'; + $update->setLock(__DIR__); } echo'';