N°1877 & N°2012: Fix regression backup link on setup, security hardening

This commit is contained in:
Stephen Abello
2019-02-18 10:39:57 +01:00
parent bf62b63173
commit 6b5cc7ca4b
3 changed files with 33 additions and 13 deletions

View File

@@ -121,9 +121,11 @@ header("Expires: Fri, 17 Jul 1970 05:00:00 GMT"); // Date in the past
$sOperation = Utils::ReadParam('operation', '');
try
{
if (is_file(utils::GetConfigFilePath()) && !is_writable(utils::GetConfigFilePath()))
$sAuthent = utils::ReadParam('authent', '', false, 'raw_data');
if (!file_exists(APPROOT.'data/setup/authent') || $sAuthent !== file_get_contents(APPROOT.'data/setup/authent'))
{
throw new Exception('Setup operations are not allowed outside of the setup');
throw new SecurityException('Setup operations are not allowed outside of the setup');
SetupPage::log_error("Setup operations are not allowed outside of the setup");
}
switch($sOperation)