diff --git a/setup/applicationinstaller.class.inc.php b/setup/applicationinstaller.class.inc.php index 70ed0a128..f155583ba 100644 --- a/setup/applicationinstaller.class.inc.php +++ b/setup/applicationinstaller.class.inc.php @@ -379,12 +379,19 @@ class ApplicationInstaller { throw new Exception("Failed to find the source directory '$sSourcePath', please check the rights of the web server"); } - if (!is_dir($sTargetPath) && !mkdir($sTargetPath)) + if (!is_dir($sTargetPath)) { - throw new Exception("Failed to create directory '$sTargetPath', please check the rights of the web server"); - } - // owner:rwx user/group:rx - chmod($sTargetPath, 0755); + if (!mkdir($sTargetPath)) + { + throw new Exception("Failed to create directory '$sTargetPath', please check the rights of the web server"); + } + else + { + // adjust the rights if and only if the directory was just created + // owner:rwx user/group:rx + chmod($sTargetPath, 0755); + } + } $oFactory = new ModelFactory($sSourcePath); $aModules = $oFactory->FindModules(); diff --git a/setup/setuputils.class.inc.php b/setup/setuputils.class.inc.php index def93fd71..c2740bc91 100644 --- a/setup/setuputils.class.inc.php +++ b/setup/setuputils.class.inc.php @@ -697,11 +697,9 @@ DoCheckDBConnection(); // Validate the initial values immediately $("#db_server").bind("keyup change", function() { CheckDBConnection(); }); $("#db_user").bind("keyup change", function() { CheckDBConnection(); }); $("#db_pwd").bind("keyup change", function() { CheckDBConnection(); }); -$("#db_new_name").bind("click", function() { $("#create_db").attr("checked", "checked"); }); -$("#db_new_name").bind("keyup change", function() { WizardUpdateButtons(); }); -$("#db_name").bind("keyup change", function() { WizardUpdateButtons(); }); +$("#db_new_name").bind("click keyup change", function() { $("#create_db").attr("checked", "checked"); WizardUpdateButtons(); }); +$("#db_name").bind("click keyup change", function() { $("#existing_db").attr("checked", "checked"); WizardUpdateButtons(); }); $("#db_prefix").bind("keyup change", function() { WizardUpdateButtons(); }); -$("#db_name").bind("click", function() { $("#existing_db").attr("checked", "checked"); WizardUpdateButtons(); }); $("#existing_db").bind("click change", function() { WizardUpdateButtons(); }); $("#create_db").bind("click change", function() { WizardUpdateButtons(); }); EOF @@ -836,8 +834,7 @@ EOF $sDBNameInput .= ''; } $oPage->add_ready_script('$("#db_name_container").html("'.addslashes($sDBNameInput).'");'); - $oPage->add_ready_script('$("#db_name").bind("click", function() { $("#existing_db").attr("checked", "checked"); WizardUpdateButtons(); });'); - $oPage->add_ready_script('$("#db_name").bind("keyup change", function() { WizardUpdateButtons(); });'); + $oPage->add_ready_script('$("#db_name").bind("click keyup change", function() { $("#existing_db").attr("checked", "checked"); WizardUpdateButtons(); });'); } $oPage->add_ready_script('WizardUpdateButtons();'); diff --git a/setup/wizardsteps.class.inc.php b/setup/wizardsteps.class.inc.php index c51f9ff8d..eb1ab618f 100644 --- a/setup/wizardsteps.class.inc.php +++ b/setup/wizardsteps.class.inc.php @@ -607,7 +607,7 @@ class WizStepAdminAccount extends WizardStep public function Display(WebPage $oPage) { - $sAdminUser = $this->oWizard->GetParameter('admin_user', ''); + $sAdminUser = $this->oWizard->GetParameter('admin_user', 'admin'); $sAdminPwd = $this->oWizard->GetParameter('admin_pwd', ''); $sConfirmPwd = $this->oWizard->GetParameter('confirm_pwd', ''); $sAdminLanguage = $this->oWizard->GetParameter('admin_language', 'EN US'); @@ -711,7 +711,7 @@ class WizStepModulesChoice extends WizardStep $aSelectedChoices = json_decode($this->oWizard->GetParameter('selected_components', '{}'), true); $aSelected = utils::ReadParam('choice', array()); $aSelectedChoices[$index] = $aSelected; - $this->oWizard->SetParameter('selected_components', json_encode($aSelectedChoices, JSON_FORCE_OBJECT)); + $this->oWizard->SetParameter('selected_components', json_encode($aSelectedChoices)); if ($this->GetStepInfo($index) == null) { @@ -763,7 +763,7 @@ class WizStepModulesChoice extends WizardStep // relative path: i.e. relative to the directory containing the XML file $sFullPath = dirname($this->GetSourceFilePath()).'/'.$sBannerPath; $sRealPath = realpath($sFullPath); - $sBannerUrl = utils::GetDefaultUrlAppRoot().str_replace(APPROOT, '', $sRealPath); + $sBannerUrl = utils::GetDefaultUrlAppRoot().str_replace(realpath(APPROOT), '', $sRealPath); } $oPage->add('