Updating all "wrong" domains regarding open_basedir to use the customerroot instead the documentroot
This commit is contained in:
@@ -725,4 +725,19 @@ if(isFroxlorVersion('0.9.6'))
|
||||
updateToVersion('0.9.7-svn1');
|
||||
}
|
||||
|
||||
if(isFroxlorVersion('0.9.7-svn1'))
|
||||
{
|
||||
showUpdateStep("Updating from 0.9.7-svn1 to 0.9.7-svn2", false);
|
||||
|
||||
showUpdateStep("Updating open_basedir due to security - issue");
|
||||
$result = $db->query("SELECT `id` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `documentroot` LIKE '%:%' AND `openbasedir_path` = '0' AND `openbasedir` = '1'");
|
||||
while($row = $db->fetch_array($result))
|
||||
{
|
||||
$db->query("UPDATE `".TABLE_PANEL_DOMAINS."` SET `openbasedir_path` = '1' WHERE `id` = " . $row['id']);
|
||||
}
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToVersion('0.9.7-svn2');
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
*/
|
||||
function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||
{
|
||||
global $settings, $lng;
|
||||
global $settings, $lng, $db;
|
||||
|
||||
if(versionInUpdate($current_version, '0.9.4-svn2'))
|
||||
{
|
||||
@@ -124,4 +124,29 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||
$question .= $redirects.'</select>';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
|
||||
if(versionInUpdate($current_version, '0.9.7-svn2'))
|
||||
{
|
||||
$has_preconfig = false;
|
||||
$result = $db->query("SELECT `domain` FROM " . TABLE_PANEL_DOMAINS . " WHERE `documentroot` LIKE '%:%' AND `openbasedir_path` = '0' AND `openbasedir` = '1'");
|
||||
$wrongOpenBasedirDomain = array();
|
||||
while($row = $db->fetch_array($result))
|
||||
{
|
||||
$wrongOpenBasedirDomain[] = $row['domain'];
|
||||
}
|
||||
|
||||
if(count($wrongOpenBasedirDomain) > 0)
|
||||
{
|
||||
$has_preconfig = true;
|
||||
$description = 'Resetting the open_basedir to customer - root';
|
||||
$question = '<strong>Due to a security - issue regarding open_basedir, Froxlor will set the open_basedir for the following domains to the customers root instead of the chosen documentroot:</strong><br /> ';
|
||||
$question.= '<ul>';
|
||||
foreach($wrongOpenBasedirDomain as $domain)
|
||||
{
|
||||
$question.= '<li>' . $domain . '</li>';
|
||||
}
|
||||
$question.= '</ul>';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ define('PACKAGE_ENABLED', 2);
|
||||
|
||||
// VERSION INFO
|
||||
|
||||
$version = '0.9.7-svn1';
|
||||
$version = '0.9.7-svn2';
|
||||
$dbversion = '2';
|
||||
$branding = '';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user