Showing the real path of directories see BT#7020

1.9.x
Julio Montoya 11 years ago
parent fceeacff5d
commit 064ba9fe80
  1. 36
      main/install/install.lib.php

@ -232,7 +232,7 @@ function detect_browser_language() {
* This function checks if the given folder is writable
*/
function check_writable($folder, $suggestion = false) {
if (is_writable(api_get_path(SYS_CODE_PATH).$folder)) {
if (is_writable($folder)) {
return Display::label(get_lang('Writable'), 'success');
} else {
if ($suggestion) {
@ -1275,28 +1275,28 @@ function display_requirements($installType, $badUpdatePath, $updatePath = '', $u
$dir_perm = Display::label('0'.decoct($dir_perm_verified), 'info');
$file_perm = Display::label('0'.decoct($fil_perm_verified), 'info');
$course_test_was_created = ($course_test_was_created == true && $file_course_test_was_created == true) ? Display::label(get_lang('Yes'), 'success') : Display::label(get_lang('No'), 'warning');
$course_test_was_created = ($course_test_was_created == true && $file_course_test_was_created == true) ? Display::label(get_lang('Yes'), 'success') : Display::label(get_lang('No'), 'important');
echo '<table class="table">
<tr>
<td class="requirements-item">chamilo/main/inc/conf/</td>
<td class="requirements-value">'.check_writable('inc/conf/').'</td>
<td class="requirements-item">'.api_get_path(SYS_CODE_PATH).'inc/conf/</td>
<td class="requirements-value">'.check_writable(api_get_path(SYS_CODE_PATH).'inc/conf/').'</td>
</tr>
<tr>
<td class="requirements-item">chamilo/main/upload/users/</td>
<td class="requirements-value">'.check_writable('upload/users/').'</td>
<td class="requirements-item">'.api_get_path(SYS_CODE_PATH).'upload/users/</td>
<td class="requirements-value">'.check_writable(api_get_path(SYS_CODE_PATH).'upload/users/').'</td>
</tr>
<tr>
<td class="requirements-item">chamilo/main/default_course_document/images/</td>
<td class="requirements-value">'.check_writable('default_course_document/images/').'</td>
<td class="requirements-item">'.api_get_path(SYS_CODE_PATH).'default_course_document/images/</td>
<td class="requirements-value">'.check_writable(api_get_path(SYS_CODE_PATH).'default_course_document/images/').'</td>
</tr>
<tr>
<td class="requirements-item">chamilo/archive/</td>
<td class="requirements-value">'.check_writable('../archive/').'</td>
<td class="requirements-item">'.api_get_path(SYS_ARCHIVE_PATH).'</td>
<td class="requirements-value">'.check_writable(api_get_path(SYS_ARCHIVE_PATH)).'</td>
</tr>
<tr>
<td class="requirements-item">chamilo/courses/</td>
<td class="requirements-value">'.check_writable('../courses/').' </td>
<td class="requirements-item">'.api_get_path(SYS_COURSE_PATH).'</td>
<td class="requirements-value">'.check_writable(api_get_path(SYS_COURSE_PATH)).' </td>
</tr>
<tr>
<td class="requirements-item">'.get_lang('CourseTestWasCreated').'</td>
@ -1312,15 +1312,15 @@ function display_requirements($installType, $badUpdatePath, $updatePath = '', $u
</tr>
<tr>
<td class="requirements-item">chamilo/home/</td>
<td class="requirements-value">'.check_writable('../home/').'</td>
<td class="requirements-value">'.check_writable(api_get_path(SYS_CODE_PATH).'home/').'</td>
</tr>
<tr>
<td class="requirements-item">chamilo/main/css/</td>
<td class="requirements-value">'.check_writable('css/', true).' ('.get_lang('SuggestionOnlyToEnableCSSUploadFeature').')</td>
<td class="requirements-value">'.check_writable(api_get_path(SYS_CODE_PATH).'css/', true).' ('.get_lang('SuggestionOnlyToEnableCSSUploadFeature').')</td>
</tr>
<tr>
<td class="requirements-item">chamilo/main/lang/</td>
<td class="requirements-value">'.check_writable('lang/', true).' ('.get_lang('SuggestionOnlyToEnableSubLanguageFeature').')</td>
<td class="requirements-value">'.check_writable(api_get_path(SYS_CODE_PATH).'lang/', true).' ('.get_lang('SuggestionOnlyToEnableSubLanguageFeature').')</td>
</tr>'.
//'<tr>
// <td class="requirements-item">chamilo/searchdb/</td>
@ -2155,7 +2155,8 @@ function compare_setting_values($current_value, $wanted_value) {
}
}
function check_course_script_interpretation($course_dir, $course_attempt_name, $file = 'test.php'){
function check_course_script_interpretation($course_dir, $course_attempt_name, $file = 'test.php')
{
$output = false;
//Write in file
$file_name = $course_dir.'/'.$file;
@ -2165,7 +2166,8 @@ function check_course_script_interpretation($course_dir, $course_attempt_name, $
if ($handler = @fopen($file_name, "w")) {
//write content
if (fwrite($handler, $content)) {
$sock_errno = ''; $sock_errmsg = '';
$sock_errno = '';
$sock_errmsg = '';
$url = api_get_path(WEB_COURSE_PATH).$course_attempt_name.'/'.$file;
$parsed_url = parse_url($url);

Loading…
Cancel
Save