diff --git a/src/setup.php b/src/setup.php index 8438839..bf3c9d6 100644 --- a/src/setup.php +++ b/src/setup.php @@ -28,6 +28,12 @@ $db = null; $ver = ''; $error = ''; +$setupToken = stoken(); +if ($setupToken == '' || strlen($setupToken) != 36) { + $setupToken = update_stoken(); +} +$setupToken = htmlspecialchars($setupToken); + $configExists = file_exists(MTTPATH. 'config.php'); $oldConfigExists = file_exists(MTTPATH. 'db/config.php'); @@ -40,8 +46,11 @@ if (!$configExists && $oldConfigExists) // First we need to migrate database config require_once(MTTPATH. 'db/config.php'); if (isset($config['password']) && $config['password'] != '') { - if (!isset($_POST['configpassword']) || $_POST['configpassword'] != $config['password']) { - exitMessage("Enter current password to continue.
"); + if (isset($_POST['configpassword'])) { + check_post_stoken(); + } + if ( !isset($_POST['configpassword']) || $_POST['configpassword'] != $config['password'] ) { + exitMessage("Enter current password to continue.
"); } } Config::loadConfigV14($config); @@ -90,7 +99,9 @@ if ($ver == '') { # We already have settings file and need to create tables. exitMessage("
Click next to create tables in '". htmlspecialchars($dbtype). "' database.

-
"); + + + "); } elseif ($install == '') { @@ -98,6 +109,7 @@ if ($ver == '') exitMessage("
Select database type to use:

+