Bug #1104 - Corrections in the upgrade scripts for proper detection of the old system's location.

skala
Ivan Tcholakov 16 years ago
parent 085ae09396
commit 623362317f
  1. 8
      main/install/index.php
  2. 29
      main/install/install.lib.php

@ -159,7 +159,7 @@ if ($_POST['step2_install'] || $_POST['step2_update_8'] || $_POST['step2_update_
$installType = 'update'; $installType = 'update';
if ($_POST['step2_update_8']) { if ($_POST['step2_update_8']) {
$emptyUpdatePath = false; $emptyUpdatePath = false;
$proposedUpdatePath = api_add_trailing_slash(empty($_POST['updatePath']) ? $_SERVER['DOCUMENT_ROOT'] : $_POST['updatePath']); $proposedUpdatePath = api_add_trailing_slash(empty($_POST['updatePath']) ? api_get_path(SYS_PATH) : $_POST['updatePath']);
if (file_exists($proposedUpdatePath)) { if (file_exists($proposedUpdatePath)) {
if (in_array($my_old_version, $update_from_version_8)) { if (in_array($my_old_version, $update_from_version_8)) {
$_POST['step2'] = 1; $_POST['step2'] = 1;
@ -386,7 +386,7 @@ if ($encryptPassForm == '1') {
$("#id_contact_form").css("display","none"); $("#id_contact_form").css("display","none");
$("#img_plus_and_minus").html('&nbsp;<img src="<?php echo api_get_path(WEB_IMG_PATH) ?>div_show.gif" alt="<?php echo get_lang('Show') ?>" title="<?php echo get_lang('Show') ?>" style ="vertical-align:middle" >&nbsp;<?php echo get_lang('ContactInformation') ?>'); $("#img_plus_and_minus").html('&nbsp;<img src="<?php echo api_get_path(WEB_IMG_PATH) ?>div_show.gif" alt="<?php echo get_lang('Show') ?>" title="<?php echo get_lang('Show') ?>" style ="vertical-align:middle" >&nbsp;<?php echo get_lang('ContactInformation') ?>');
} }
}); });
}); });
function send_contact_information() { function send_contact_information() {
@ -408,13 +408,13 @@ if ($encryptPassForm == '1') {
data: data_post, data: data_post,
success: function(datos) { success: function(datos) {
if (datos == 'required_field_error') { if (datos == 'required_field_error') {
message = "<?php echo get_lang('FormHasErrorsPleaseComplete') ?>"; message = "<?php echo get_lang('FormHasErrorsPleaseComplete') ?>";
} else if (datos == '1') { } else if (datos == '1') {
message = "<?php echo get_lang('ContactInformationHasBeenSent') ?>"; message = "<?php echo get_lang('ContactInformationHasBeenSent') ?>";
} else { } else {
message = "<?php echo get_lang('Error').': '.get_lang('ContactInformationHasNotBeenSent') ?>"; message = "<?php echo get_lang('Error').': '.get_lang('ContactInformationHasNotBeenSent') ?>";
} }
alert(message); alert(message);
} }
}); });
} }

@ -410,6 +410,9 @@ function get_config_param($param, $updatePath = '') {
if (empty($updatePath) && !empty($_POST['updatePath'])) { if (empty($updatePath) && !empty($_POST['updatePath'])) {
$updatePath = $_POST['updatePath']; $updatePath = $_POST['updatePath'];
} }
if (empty($updatePath)) {
$updatePath = api_get_path(SYS_PATH);
}
$updatePath = api_add_trailing_slash(str_replace('\\', '/', realpath($updatePath))); $updatePath = api_add_trailing_slash(str_replace('\\', '/', realpath($updatePath)));
$updateFromInstalledVersionFile = ''; $updateFromInstalledVersionFile = '';
@ -1207,7 +1210,7 @@ function display_requirements($installType, $badUpdatePath, $updatePath = '', $u
<table border="0" cellpadding="5" align="center"> <table border="0" cellpadding="5" align="center">
<tr> <tr>
<td><?php echo get_lang('OldVersionRootPath'); ?>:</td> <td><?php echo get_lang('OldVersionRootPath'); ?>:</td>
<td><input type="text" name="updatePath" size="50" value="<?php echo ($badUpdatePath && !empty($updatePath)) ? htmlentities($updatePath) : $_SERVER['DOCUMENT_ROOT'].'/old_version/'; ?>" /></td> <td><input type="text" name="updatePath" size="50" value="<?php echo ($badUpdatePath && !empty($updatePath)) ? htmlentities($updatePath) : api_get_path(SYS_SERVER_ROOT_PATH).'old_version/'; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td colspan="2" align="center"> <td colspan="2" align="center">
@ -1334,7 +1337,7 @@ function display_license_agreement() {
</td> </td>
</tr> </tr>
<tr><td><input type="checkbox" name="accept" id="accept_licence" value="1"><?php echo get_lang('IAccept'); ?></td></tr> <tr><td><input type="checkbox" name="accept" id="accept_licence" value="1"><?php echo get_lang('IAccept'); ?></td></tr>
<tr><td><p><?php echo get_lang('DokeosArtLicense'); ?></p></td></tr> <tr><td><p><?php echo get_lang('DokeosArtLicense'); ?></p></td></tr>
<tr> <tr>
<td> <td>
<table width="100%"> <table width="100%">
@ -1348,10 +1351,10 @@ function display_license_agreement() {
</tr> </tr>
</table> </table>
</td> </td>
</tr> </tr>
</table> </table>
<!-- Contact information form --> <!-- Contact information form -->
<div> <div>
<div class="formw"> <div class="formw">
<a href="javascript://" class = "advanced_parameters" > <a href="javascript://" class = "advanced_parameters" >
@ -1360,11 +1363,11 @@ function display_license_agreement() {
</div> </div>
</div> </div>
<div id="id_contact_form" style="display:block"> <div id="id_contact_form" style="display:block">
<div class="normal-message"><?php echo get_lang('ContactInformationDescription') ?></div> <div class="normal-message"><?php echo get_lang('ContactInformationDescription') ?></div>
<p><?php echo get_contact_registration_form() ?></p><br /> <p><?php echo get_contact_registration_form() ?></p><br />
</div> </div>
<?php <?php
} }
@ -1376,8 +1379,8 @@ function get_contact_registration_form() {
$html =' $html ='
<div id="contact_registration"> <div id="contact_registration">
<fieldset style="width:90%;padding:15px;border:1pt solid #eee"> <fieldset style="width:90%;padding:15px;border:1pt solid #eee">
<div id="div_sent_information"></div> <div id="div_sent_information"></div>
<form> <form>
<div class="row"> <div class="row">
<div class="label"><span class="form_required">*</span>'.get_lang('PersonName').'</div> <div class="label"><span class="form_required">*</span>'.get_lang('PersonName').'</div>
@ -1477,7 +1480,7 @@ function get_contact_registration_form() {
<div class="label">&nbsp;</div> <div class="label">&nbsp;</div>
<div class="formw"><span class="form_required">*</span><small>'.get_lang('FieldRequired').'</small></div> <div class="formw"><span class="form_required">*</span><small>'.get_lang('FieldRequired').'</small></div>
</div> </div>
</form> </form>
</fieldset> </fieldset>
@ -1784,7 +1787,7 @@ function display_configuration_settings_form($installType, $urlForm, $languageFo
//Parameter 11: institute (short) name //Parameter 11: institute (short) name
display_configuration_parameter($installType, get_lang('InstituteURL'), 'institutionUrlForm', $institutionUrlForm); display_configuration_parameter($installType, get_lang('InstituteURL'), 'institutionUrlForm', $institutionUrlForm);
/* /*
//old method //old method
<tr> <tr>
@ -1920,5 +1923,5 @@ function get_countries_list_from_array($combo = false) {
return $country_select; return $country_select;
} }
return $a_countries; return $a_countries;
} }

Loading…
Cancel
Save