diff --git a/.php_cs.dist b/.php_cs.dist index f090329168..0aa4efe68e 100644 --- a/.php_cs.dist +++ b/.php_cs.dist @@ -44,7 +44,6 @@ $finder = PhpCsFixer\Finder::create() ->exclude('main/auth/cas/lib') ->exclude('main/auth/shibboleth') ->exclude('main/auth/openid') - ->exclude('main/default_course_document') ->exclude('main/fonts') ->exclude('main/inc/lib/browser') ->exclude('main/inc/lib/internationalization_database') diff --git a/main/inc/lib/add_course.lib.inc.php b/main/inc/lib/add_course.lib.inc.php index ceb09b3f45..51f85c4a3c 100755 --- a/main/inc/lib/add_course.lib.inc.php +++ b/main/inc/lib/add_course.lib.inc.php @@ -319,65 +319,6 @@ class AddCourse } } - /** - * Returns a list of all files in the given course directory. The requested - * directory will be checked against a "checker" directory to avoid access to - * protected/unauthorized files. - * - * @param string Complete path to directory we want to list - * @param array A list of files to which we want to add the files found - * @param string Type of base directory from which we want to recover the files - * @param string $path - * @param string $media - * - * @return array - * @assert (null,null,null) === false - * @assert ('abc',array(),'') === array() - */ - public static function browse_folders($path, $files, $media) - { - if ($media == 'images') { - $code_path = api_get_path(SYS_CODE_PATH).'default_course_document/images/'; - } - if ($media == 'audio') { - $code_path = api_get_path(SYS_CODE_PATH).'default_course_document/audio/'; - } - if ($media == 'flash') { - $code_path = api_get_path(SYS_CODE_PATH).'default_course_document/flash/'; - } - if ($media == 'video') { - $code_path = api_get_path(SYS_CODE_PATH).'default_course_document/video/'; - } - if ($media == 'certificates') { - $code_path = api_get_path(SYS_CODE_PATH).'default_course_document/certificates/'; - } - if (is_dir($path)) { - $handle = opendir($path); - while (false !== ($file = readdir($handle))) { - if (is_dir($path.$file) && strpos($file, '.') !== 0) { - $files[]['dir'] = str_replace( - $code_path, - '', - $path.$file.'/' - ); - $files = self::browse_folders( - $path.$file.'/', - $files, - $media - ); - } elseif (is_file($path.$file) && strpos($file, '.') !== 0) { - $files[]['file'] = str_replace( - $code_path, - '', - $path.$file - ); - } - } - } - - return $files; - } - /** * Sorts pictures by type (used?). * @@ -539,7 +480,7 @@ class AddCourse } $finder = new Symfony\Component\Finder\Finder(); - $defaultPath = api_get_path(SYS_CODE_PATH).'default_course_document'; + $defaultPath = api_get_path(SYS_PUBLIC_PATH).'img/document'; $finder->in($defaultPath); /** @var SplFileInfo $file */ foreach ($finder as $file) { @@ -682,7 +623,7 @@ class AddCourse $html = '
- + '.get_lang('Antique').'
'; diff --git a/main/inc/lib/api.lib.php b/main/inc/lib/api.lib.php index 62929da125..b5765ddf43 100644 --- a/main/inc/lib/api.lib.php +++ b/main/inc/lib/api.lib.php @@ -848,7 +848,6 @@ function api_get_path($path = '', $configuration = []) } $isInitialized = []; - //$root_rel = $configuration['url_append'] ?? ''; $root_rel = $_SERVER['APP_URL_APPEND'] ?? ''; if (!empty($root_rel)) { diff --git a/main/install/data.sql b/main/install/data.sql index 419ae389d1..14ce279ac6 100644 --- a/main/install/data.sql +++ b/main/install/data.sql @@ -704,7 +704,7 @@ INSERT INTO system_template (title, comment, image, content) VALUES
@@ -718,7 +718,7 @@ INSERT INTO system_template (title, comment, image, content) VALUES name="single" quality="high" allowfullscreen="true" - flashvars="width=320&height=240&autostart=false&file={REL_PATH}main/default_course_document/video/flv/example.flv&repeat=false&image=&showdownload=false&link={REL_PATH}main/default_course_document/video/flv/example.flv&showdigits=true&shownavigation=true&logo=" + flashvars="width=320&height=240&autostart=false&file={COURSE_DIR}video/flv/example.flv&repeat=false&image=&showdownload=false&link={COURSE_DIR}video/flv/example.flv&showdigits=true&shownavigation=true&logo=" />
diff --git a/main/install/install.lib.php b/main/install/install.lib.php index 09b84bdc6d..305428f2bd 100755 --- a/main/install/install.lib.php +++ b/main/install/install.lib.php @@ -1076,12 +1076,6 @@ function display_requirements( @chmod($checked_writable, $perm); } - $checked_writable = api_get_path(SYS_CODE_PATH).'default_course_document/images/'; - if (!is_writable($checked_writable)) { - $notWritable[] = $checked_writable; - @chmod($checked_writable, $perm); - } - if ($course_test_was_created == false) { $error = true; } @@ -1699,11 +1693,9 @@ function display_configuration_settings_form( $languageForm = $_SESSION['install_language']; } echo '
'; - echo "

".display_step_sequence().get_lang("CfgSetting")."

"; + echo "

".display_step_sequence().get_lang("Configuration settings")."

"; echo '
'; - echo '

'.get_lang('ConfigSettingsInfo').' app/config/configuration.php

'; - // Parameter 1: administrator's login $html = ''; $html .= display_configuration_parameter( diff --git a/src/CoreBundle/Migrations/Schema/V111/Version20160804174600.php b/src/CoreBundle/Migrations/Schema/V111/Version20160804174600.php index 5a4db43bf8..4ebf479790 100644 --- a/src/CoreBundle/Migrations/Schema/V111/Version20160804174600.php +++ b/src/CoreBundle/Migrations/Schema/V111/Version20160804174600.php @@ -562,7 +562,7 @@ class Version20160804174600 extends AbstractMigrationChamilo
@@ -576,7 +576,7 @@ class Version20160804174600 extends AbstractMigrationChamilo name="single" quality="high" allowfullscreen="true" - flashvars="width=320&height=240&autostart=false&file={REL_PATH}main/default_course_document/video/flv/example.flv&repeat=false&image=&showdownload=false&link={REL_PATH}main/default_course_document/video/flv/example.flv&showdigits=true&shownavigation=true&logo=" + flashvars="width=320&height=240&autostart=false&file={COURSE_DIR}video/flv/example.flv&repeat=false&image=&showdownload=false&link={COURSE_DIR}video/flv/example.flv&showdigits=true&shownavigation=true&logo=" />
@@ -1130,7 +1130,7 @@ class Version20160804174600 extends AbstractMigrationChamilo
- +