fix install chamilo CT#7539

1.10.x
aragonc 10 years ago
parent 9b21b39936
commit d6fa3b2352
  1. 6
      main/install/index.php
  2. 273
      main/install/install.lib.php

@ -560,11 +560,11 @@ if (@$_POST['step2']) {
//STEP 6 : LAST CHECK BEFORE INSTALL //STEP 6 : LAST CHECK BEFORE INSTALL
?> ?>
<div class="RequirementHeading"> <div class="RequirementHeading">
<h2><?php echo display_step_sequence().get_lang('LastCheck'); ?></h2> <h3><?php echo display_step_sequence().get_lang('LastCheck'); ?></h3>
</div> </div>
<div class="RequirementContent"> <div class="RequirementContent">
<?php echo get_lang('HereAreTheValuesYouEntered'); ?> <?php echo get_lang('HereAreTheValuesYouEntered'); ?>
</div><br /> </div>
<?php <?php
if ($installType == 'new') { if ($installType == 'new') {
@ -629,7 +629,7 @@ if (@$_POST['step2']) {
$msg = get_lang('UpdateExecution'); $msg = get_lang('UpdateExecution');
} }
echo '<div class="RequirementHeading"> echo '<div class="RequirementHeading">
<h2>'.display_step_sequence().$msg.'</h2>'; <h3>'.display_step_sequence().$msg.'</h3>';
if (!empty($installationProfile)) { if (!empty($installationProfile)) {
echo ' <h3>('.$installationProfile.')</h3>'; echo ' <h3>('.$installationProfile.')</h3>';
} }

@ -605,18 +605,20 @@ function display_language_selection_box($name = 'language_list', $default_langua
} }
// Displaying the box. // Displaying the box.
echo "\t\t<select name=\"$name\">\n"; $html = '';
$html .= "\t\t<select class='form-control' name=\"$name\">\n";
foreach ($language_list as $key => $value) { foreach ($language_list as $key => $value) {
if ($key == $default_language) { if ($key == $default_language) {
$option_end = ' selected="selected">'; $option_end = ' selected="selected">';
} else { } else {
$option_end = '>'; $option_end = '>';
} }
echo "\t\t\t<option value=\"$key\"$option_end"; $html .= "\t\t\t<option value=\"$key\"$option_end";
echo $value; $html .= $value;
echo "</option>\n"; $html .= "</option>\n";
} }
echo "\t\t</select>\n"; $html .= "\t\t</select>\n";
return $html;
} }
/** /**
@ -633,10 +635,10 @@ function display_language_selection()
<p><?php echo get_lang('PleaseSelectInstallationProcessLanguage'); ?>:</p> <p><?php echo get_lang('PleaseSelectInstallationProcessLanguage'); ?>:</p>
<form id="lang_form" method="post" action="<?php echo api_get_self(); ?>"> <form id="lang_form" method="post" action="<?php echo api_get_self(); ?>">
<div class="form-group"> <div class="form-group">
<div class="col-sm-2"> <div class="col-sm-4">
<?php display_language_selection_box('language_list', api_get_interface_language()); ?> <?php echo display_language_selection_box('language_list', api_get_interface_language()); ?>
</div> </div>
<div class="col-sm-8"> <div class="col-sm-6">
<button type="submit" name="step1" class="btn btn-success" value="<?php echo get_lang('Next'); ?>"> <button type="submit" name="step1" class="btn btn-success" value="<?php echo get_lang('Next'); ?>">
<i class="fa fa-forward"> </i> <i class="fa fa-forward"> </i>
<?php echo get_lang('Next'); ?></button> <?php echo get_lang('Next'); ?></button>
@ -683,7 +685,7 @@ function display_requirements(
echo '</div>'; echo '</div>';
// SERVER REQUIREMENTS // SERVER REQUIREMENTS
echo '<div class="RequirementHeading"><h2>'.get_lang('ServerRequirements').'</h2>'; echo '<div class="RequirementHeading"><h4>'.get_lang('ServerRequirements').'</h4>';
$timezone = checkPhpSettingExists("date.timezone"); $timezone = checkPhpSettingExists("date.timezone");
if (!$timezone) { if (!$timezone) {
@ -768,7 +770,7 @@ function display_requirements(
// RECOMMENDED SETTINGS // RECOMMENDED SETTINGS
// Note: these are the settings for Joomla, does this also apply for Chamilo? // Note: these are the settings for Joomla, does this also apply for Chamilo?
// Note: also add upload_max_filesize here so that large uploads are possible // Note: also add upload_max_filesize here so that large uploads are possible
echo '<div class="RequirementHeading"><h2>'.get_lang('RecommendedSettings').'</h2>'; echo '<div class="RequirementHeading"><h4>'.get_lang('RecommendedSettings').'</h4>';
echo '<div class="RequirementText">'.get_lang('RecommendedSettingsInfo').'</div>'; echo '<div class="RequirementText">'.get_lang('RecommendedSettingsInfo').'</div>';
echo '<div class="RequirementContent">'; echo '<div class="RequirementContent">';
echo '<table class="table"> echo '<table class="table">
@ -842,7 +844,7 @@ function display_requirements(
echo '</div>'; echo '</div>';
// DIRECTORY AND FILE PERMISSIONS // DIRECTORY AND FILE PERMISSIONS
echo '<div class="RequirementHeading"><h2>'.get_lang('DirectoryAndFilePermissions').'</h2>'; echo '<div class="RequirementHeading"><h4>'.get_lang('DirectoryAndFilePermissions').'</h4>';
echo '<div class="RequirementText">'.get_lang('DirectoryAndFilePermissionsInfo').'</div>'; echo '<div class="RequirementText">'.get_lang('DirectoryAndFilePermissionsInfo').'</div>';
echo '<div class="RequirementContent">'; echo '<div class="RequirementContent">';
@ -1449,7 +1451,22 @@ function display_database_settings_form(
<?php <?php
} }
function panel($content=null, $title=null, $id=null, $style=null){
$html = '';
if(empty($style)){
$style = 'default';
}
if (!empty($title)){
$panelTitle = Display::div($title, array('class' => 'panel-heading'));
$panelBody = Display::div($content, array('class' => 'panel-body'));
$panelParent = Display::div($panelTitle . $panelBody, array('id' => $id, 'class' => 'panel panel-'.$style));
} else {
$panelBody = Display::div($html, array('class' => 'panel-body'));
$panelParent = Display::div($panelBody, array('id' => $id, 'class' => 'panel panel-'.$style));
}
$html .= $panelParent;
return $html;
}
/** /**
* Displays a parameter in a table row. * Displays a parameter in a table row.
* Used by the display_configuration_settings_form function. * Used by the display_configuration_settings_form function.
@ -1466,14 +1483,15 @@ function display_configuration_parameter(
$parameterValue, $parameterValue,
$displayWhenUpdate = 'true' $displayWhenUpdate = 'true'
) { ) {
echo "<tr>"; $html = '<div class="form-group">';
echo "<td>$parameterName</td>"; $html.= '<label class="col-sm-6 control-label">' . $parameterName . '</label>';
if ($installType == INSTALL_TYPE_UPDATE && $displayWhenUpdate) { if ($installType == INSTALL_TYPE_UPDATE && $displayWhenUpdate) {
echo '<td><input type="hidden" name="'.$formFieldName.'" value="'.api_htmlentities($parameterValue, ENT_QUOTES).'" />'.$parameterValue."</td>"; $html.= '<input type="hidden" name="' . $formFieldName . '" value="'. api_htmlentities($parameterValue, ENT_QUOTES). '" />' . $parameterValue;
} else { } else {
echo '<td><input type="text" size="'.FORM_FIELD_DISPLAY_LENGTH.'" maxlength="'.MAX_FORM_FIELD_LENGTH.'" name="'.$formFieldName.'" value="'.api_htmlentities($parameterValue, ENT_QUOTES).'" />'."</td>"; $html.= '<div class="col-sm-6"><input class="form-control" type="text" size="'.FORM_FIELD_DISPLAY_LENGTH.'" maxlength="'.MAX_FORM_FIELD_LENGTH.'" name="'.$formFieldName.'" value="'.api_htmlentities($parameterValue, ENT_QUOTES).'" />'."</div>";
} }
echo "</tr>"; $html.= "</div>";
return $html;
} }
/** /**
@ -1520,148 +1538,151 @@ function display_configuration_settings_form(
echo '<p>'.get_lang('ConfigSettingsInfo').' <strong>main/inc/conf/configuration.php</strong></p>'; echo '<p>'.get_lang('ConfigSettingsInfo').' <strong>main/inc/conf/configuration.php</strong></p>';
echo '<fieldset>';
echo '<legend>'.get_lang('Administrator').'</legend>';
echo '<table class="table">';
// Parameter 1: administrator's login // Parameter 1: administrator's login
$html = '';
display_configuration_parameter($installType, get_lang('AdminLogin'), 'loginForm', $loginForm, $installType == 'update'); $html .= display_configuration_parameter($installType, get_lang('AdminLogin'), 'loginForm', $loginForm, $installType == 'update');
// Parameter 2: administrator's password // Parameter 2: administrator's password
if ($installType != 'update') { if ($installType != 'update') {
display_configuration_parameter($installType, get_lang('AdminPass'), 'passForm', $passForm, false); $html .= display_configuration_parameter($installType, get_lang('AdminPass'), 'passForm', $passForm, false);
} }
// Parameters 3 and 4: administrator's names // Parameters 3 and 4: administrator's names
display_configuration_parameter($installType, get_lang('AdminFirstName'), 'adminFirstName', $adminFirstName); $html .= display_configuration_parameter($installType, get_lang('AdminFirstName'), 'adminFirstName', $adminFirstName);
display_configuration_parameter($installType, get_lang('AdminLastName'), 'adminLastName', $adminLastName); $html .= display_configuration_parameter($installType, get_lang('AdminLastName'), 'adminLastName', $adminLastName);
//Parameter 3: administrator's email //Parameter 3: administrator's email
display_configuration_parameter($installType, get_lang('AdminEmail'), 'emailForm', $emailForm); $html .= display_configuration_parameter($installType, get_lang('AdminEmail'), 'emailForm', $emailForm);
//Parameter 6: administrator's telephone //Parameter 6: administrator's telephone
display_configuration_parameter($installType, get_lang('AdminPhone'), 'adminPhoneForm', $adminPhoneForm); $html .= display_configuration_parameter($installType, get_lang('AdminPhone'), 'adminPhoneForm', $adminPhoneForm);
echo '</table>';
echo '</fieldset>';
echo '<fieldset>';
echo '<legend>'.get_lang('Platform').'</legend>'; echo panel($html, get_lang('Administrator'), 'administrator');
echo '<table class="table">';
//echo '<table class="table">';
//First parameter: language //First parameter: language
echo "<tr>"; $html = '<div class="form-group">';
echo '<td>'.get_lang('MainLang')."&nbsp;&nbsp;</td>"; $html .= '<label class="col-sm-6 control-label">'.get_lang('MainLang')."</label>";
if ($installType == 'update') { if ($installType == 'update') {
echo '<td><input type="hidden" name="languageForm" value="'.api_htmlentities($languageForm, ENT_QUOTES).'" />'.$languageForm."</td>"; $html .= '<input type="hidden" name="languageForm" value="'.api_htmlentities($languageForm, ENT_QUOTES).'" />'.$languageForm;
} else { // new installation } else { // new installation
echo '<td>'; $html .= '<div class="col-sm-6">';
display_language_selection_box('languageForm', $languageForm); $html .= display_language_selection_box('languageForm', $languageForm);
echo "</td>\n"; $html .= '</div>';
} }
echo "</tr>\n"; $html.= "</div>";
//Second parameter: Chamilo URL //Second parameter: Chamilo URL
echo "<tr>"; $html .= '<div class="form-group">';
echo '<td>'.get_lang('ChamiloURL').' (<font color="red">'.get_lang('ThisFieldIsRequired')."</font>)&nbsp;&nbsp;</td>"; $html .= '<label class="col-sm-6 control-label">'.get_lang('ChamiloURL') .get_lang('ThisFieldIsRequired').'</label>';
if ($installType == 'update') { if ($installType == 'update') {
echo '<td>'.api_htmlentities($urlForm, ENT_QUOTES)."</td>\n"; $html .= api_htmlentities($urlForm, ENT_QUOTES)."\n";
} else { } else {
echo '<td><input type="text" size="40" maxlength="100" name="urlForm" value="'.api_htmlentities($urlForm, ENT_QUOTES).'" />'."</td>"; $html .= '<div class="col-sm-6">';
$html .= '<input class="form-control" type="text" size="40" maxlength="100" name="urlForm" value="'.api_htmlentities($urlForm, ENT_QUOTES).'" />';
$html .= '</div>';
} }
echo "</tr>"; $html .= '</div>';
//Parameter 9: campus name //Parameter 9: campus name
display_configuration_parameter($installType, get_lang('CampusName'), 'campusForm', $campusForm); $html .= display_configuration_parameter($installType, get_lang('CampusName'), 'campusForm', $campusForm);
//Parameter 10: institute (short) name //Parameter 10: institute (short) name
display_configuration_parameter($installType, get_lang('InstituteShortName'), 'institutionForm', $institutionForm); $html .= display_configuration_parameter($installType, get_lang('InstituteShortName'), 'institutionForm', $institutionForm);
//Parameter 11: institute (short) name //Parameter 11: institute (short) name
display_configuration_parameter($installType, get_lang('InstituteURL'), 'institutionUrlForm', $institutionUrlForm); $html .= display_configuration_parameter($installType, get_lang('InstituteURL'), 'institutionUrlForm', $institutionUrlForm);
?>
<tr> $html .= '<div class="form-group">
<td><?php echo get_lang("EncryptMethodUserPass"); ?> :</td> <label class="col-sm-6 control-label">'. get_lang("EncryptMethodUserPass").'</label>
<?php if ($installType == 'update') { ?> <div class="col-sm-6">';
<td><input type="hidden" name="encryptPassForm" value="<?php echo $encryptPassForm; ?>" /><?php echo $encryptPassForm; ?></td> if ($installType == 'update') {
<?php } else { ?> $html .= '<input type="hidden" name="encryptPassForm" value="'. $encryptPassForm .'" />'. $encryptPassForm;
<td> } else {
<div class="control-group">
<label class="radio inline"> $html .= '<div class="checkbox">
<input type="radio" name="encryptPassForm" value="bcrypt" id="encryptPass1" <?php echo ($encryptPassForm == 'bcrypt') ? 'checked="checked" ': ''; ?>/><?php echo 'bcrypt'; ?> <label>
</label> <input type="radio" name="encryptPassForm" value="bcrypt" id="encryptPass1" '. ($encryptPassForm == 'bcrypt' ? 'checked="checked" ':'') .'/> bcrypt
<label class="radio inline"> </label>';
<input type="radio" name="encryptPassForm" value="sha1" id="encryptPass1" <?php echo ($encryptPassForm == 'sha1') ? 'checked="checked" ': ''; ?>/><?php echo 'sha1'; ?>
</label> $html .= '<label>
<input type="radio" name="encryptPassForm" value="sha1" id="encryptPass1" '. ($encryptPassForm == 'sha1' ? 'checked="checked" ':'') .'/> sha1
<label class="radio inline"> </label>';
<input type="radio" name="encryptPassForm" value="md5" id="encryptPass0" <?php echo $encryptPassForm == 1 ? 'checked="checked" ' : ''; ?>/><?php echo 'md5'; ?>
</label> $html .= '<label>
<input type="radio" name="encryptPassForm" value="md5" id="encryptPass0" '. ($encryptPassForm == 'md5' ? 'checked="checked" ':'') .'/> md5
<label class="radio inline"> </label>';
<input type="radio" name="encryptPassForm" value="none" id="encryptPass2" <?php echo $encryptPassForm === '0' or $encryptPassForm === 0 ? 'checked="checked" ':''; ?>/><?php echo get_lang('None'); ?>
</label> $html .= '<label>
</div> <input type="radio" name="encryptPassForm" value="none" id="encryptPass2" '. ($encryptPassForm == 'none' ? 'checked="checked" ':'') .'/>'. get_lang('None').'
</td> </label>';
<?php } ?> $html .= '</div>';
</tr> }
<tr> $html .= '</div></div>';
<td><?php echo get_lang('AllowSelfReg'); ?> :</td>
<?php if ($installType == 'update'): ?> $html .= '<div class="form-group">
<td><input type="hidden" name="allowSelfReg" value="<?php echo $allowSelfReg; ?>" /><?php echo $allowSelfReg ? get_lang('Yes') : get_lang('No'); ?></td> <label class="col-sm-6 control-label">'. get_lang('AllowSelfReg') .'</label>
<?php else: ?> <div class="col-sm-6">';
<td> if ($installType == 'update'){
<div class="control-group"> $html .= '<input type="hidden" name="allowSelfReg" value="'. $allowSelfReg .'" />'. $allowSelfReg ? get_lang('Yes') : get_lang('No');
<label class="radio inline"> } else {
<input type="radio" name="allowSelfReg" value="1" id="allowSelfReg1" <?php echo $allowSelfReg ? 'checked="checked" ' : ''; ?>/> <?php echo get_lang('Yes'); ?> $html .= '<div class="control-group">';
</label> $html .= '<label class="checkbox-inline">
<label class="radio inline"> <input type="radio" name="allowSelfReg" value="1" id="allowSelfReg1" '. ($allowSelfReg ? 'checked="checked" ' : '') . ' /> '. get_lang('Yes') .'
<input type="radio" name="allowSelfReg" value="0" id="allowSelfReg0" <?php echo $allowSelfReg ? '' : 'checked="checked" '; ?>/><?php echo get_lang('No'); ?> </label>';
</label> $html .= '<label class="checkbox-inline">
</div> <input type="radio" name="allowSelfReg" value="0" id="allowSelfReg0" '. ($allowSelfReg ? '' : 'checked="checked" ') .' /> '. get_lang('No') .'
</td> </label>';
<?php endif; ?> $html .= '</div>';
}
</tr> $html .= '</div>';
<tr> $html .= '</div>';
<td><?php echo get_lang('AllowSelfRegProf'); ?> :</td>
$html .= '<div class="form-group">';
<?php if ($installType == 'update'): ?> $html .= '<label class="col-sm-6 control-label">'. get_lang('AllowSelfRegProf') .'</label>
<td><input type="hidden" name="allowSelfRegProf" value="<?php echo $allowSelfRegProf; ?>" /><?php echo $allowSelfRegProf? get_lang('Yes') : get_lang('No'); ?></td> <div class="col-sm-6">';
<?php else: ?> if ($installType == 'update'){
<td> $html .= '<input type="hidden" name="allowSelfRegProf" value="'. $allowSelfRegProf.'" />'. $allowSelfRegProf? get_lang('Yes') : get_lang('No');
<div class="control-group"> } else {
<label class="radio inline"> $html .= '<div class="control-group">
<input type="radio" name="allowSelfRegProf" value="1" id="allowSelfRegProf1" <?php echo $allowSelfRegProf ? 'checked="checked" ' : ''; ?>/> <label class="checkbox-inline">
<?php echo get_lang('Yes'); ?> <input type="radio" name="allowSelfRegProf" value="1" id="allowSelfRegProf1" '. ($allowSelfRegProf ? 'checked="checked" ' : '') .'/>
</label> ' . get_lang('Yes') .'
<label class="radio inline"> </label>';
<input type="radio" name="allowSelfRegProf" value="0" id="allowSelfRegProf0" <?php echo $allowSelfRegProf ? '' : 'checked="checked" '; ?>/> $html .= '<label class="checkbox-inline">
<?php echo get_lang('No'); ?> <input type="radio" name="allowSelfRegProf" value="0" id="allowSelfRegProf0" '. ($allowSelfRegProf ? '' : 'checked="checked" ') .' />
</label> '. get_lang('No') .'
</div> </label>';
</td> $html .= '</div>';
<?php endif; ?> }
$html .= '</div>
</tr> </div>';
<tr>
<td> echo panel($html, get_lang('Platform'), 'platform');
<button type="submit" class="btn btn-default" name="step3" value="&lt; <?php echo get_lang('Previous'); ?>" ><i class="fa fa-backward"> </i> <?php echo get_lang('Previous'); ?></button> ?>
</td> <div class='form-group'>
<td align="right"> <div class="col-sm-6">
<button type="submit" class="btn btn-default pull-right" name="step3" value="&lt; <?php echo get_lang('Previous'); ?>" ><i class="fa fa-backward"> </i> <?php echo get_lang('Previous'); ?></button>
<input type="hidden" name="is_executable" id="is_executable" value="-" /> <input type="hidden" name="is_executable" id="is_executable" value="-" />
<button class="btn btn-success" type="submit" name="step5" value="<?php echo get_lang('Next'); ?> &gt;" ><i class="fa fa-forward"> </i> <?php echo get_lang('Next'); ?></button></td> </div>
</tr> <div class="col-sm-6">
</table> <button class="btn btn-success" type="submit" name="step5" value="<?php echo get_lang('Next'); ?> &gt;" ><i class="fa fa-forward"> </i> <?php echo get_lang('Next'); ?></button>
</fieldset> </div>
</div>
<?php <?php
} }

Loading…
Cancel
Save