diff --git a/main/auth/inscription.php b/main/auth/inscription.php index 32d3d7c2e9..462df752d1 100755 --- a/main/auth/inscription.php +++ b/main/auth/inscription.php @@ -240,22 +240,19 @@ if ($user_already_registered_show_terms === false && } } - // OFFICIAL CODE - if (CONFVAL_ASK_FOR_OFFICIAL_CODE) { - if (in_array('official_code', $allowedFields)) { - $form->addElement( - 'text', + if (in_array('official_code', $allowedFields)) { + $form->addElement( + 'text', + 'official_code', + get_lang('OfficialCode'), + ['size' => 40] + ); + if (api_get_setting('registration', 'officialcode') == 'true') { + $form->addRule( 'official_code', - get_lang('OfficialCode'), - ['size' => 40] + get_lang('ThisFieldIsRequired'), + 'required' ); - if (api_get_setting('registration', 'officialcode') == 'true') { - $form->addRule( - 'official_code', - get_lang('ThisFieldIsRequired'), - 'required' - ); - } } } diff --git a/main/auth/profile.php b/main/auth/profile.php index 6b0e18f686..5e90d63b3c 100755 --- a/main/auth/profile.php +++ b/main/auth/profile.php @@ -152,20 +152,17 @@ $form->addRule('username', get_lang('ThisFieldIsRequired'), 'required'); $form->addRule('username', get_lang('UsernameWrong'), 'username'); $form->addRule('username', get_lang('UserTaken'), 'username_available', $user_data['username']); -// OFFICIAL CODE -if (defined('CONFVAL_ASK_FOR_OFFICIAL_CODE') && CONFVAL_ASK_FOR_OFFICIAL_CODE === true) { - $form->addElement('text', 'official_code', get_lang('OfficialCode'), ['size' => 40]); - if (api_get_setting('profile', 'officialcode') !== 'true') { - $form->freeze('official_code'); - } - $form->applyFilter('official_code', 'stripslashes'); - $form->applyFilter('official_code', 'trim'); - $form->applyFilter('official_code', 'html_filter'); - if (api_get_setting('registration', 'officialcode') === 'true' && - api_get_setting('profile', 'officialcode') === 'true' - ) { - $form->addRule('official_code', get_lang('ThisFieldIsRequired'), 'required'); - } +$form->addElement('text', 'official_code', get_lang('OfficialCode'), ['size' => 40]); +if (api_get_setting('profile', 'officialcode') !== 'true') { + $form->freeze('official_code'); +} +$form->applyFilter('official_code', 'stripslashes'); +$form->applyFilter('official_code', 'trim'); +$form->applyFilter('official_code', 'html_filter'); +if (api_get_setting('registration', 'officialcode') === 'true' && + api_get_setting('profile', 'officialcode') === 'true' +) { + $form->addRule('official_code', get_lang('ThisFieldIsRequired'), 'required'); } // EMAIL diff --git a/main/inc/global.inc.php b/main/inc/global.inc.php index a7cc01bb81..d5e54498c2 100755 --- a/main/inc/global.inc.php +++ b/main/inc/global.inc.php @@ -279,24 +279,7 @@ try { // Fixes bug in Chamilo 1.8.7.1 array was not set $administrator['email'] = isset($administrator['email']) ? $administrator['email'] : 'admin@example.com'; $administrator['name'] = isset($administrator['name']) ? $administrator['name'] : 'Admin'; - - // Including configuration files - $configurationFiles = [ - 'mail.conf.php', - 'profile.conf.php', - 'course_info.conf.php', - 'add_course.conf.php', - 'events.conf.php', - 'auth.conf.php', - ]; - - foreach ($configurationFiles as $file) { - $file = api_get_path(CONFIGURATION_PATH).$file; - if (file_exists($file)) { - require_once $file; - } - } - + /* LOAD LANGUAGE FILES SECTION */ // if we use the javascript version (without go button) we receive a get // if we use the non-javascript version (with the go button) we receive a post diff --git a/main/install/install.lib.php b/main/install/install.lib.php index 804f24c764..f7bc6dc87b 100755 --- a/main/install/install.lib.php +++ b/main/install/install.lib.php @@ -3674,26 +3674,6 @@ function migrateSwitch($fromVersion, $manager, $processFiles = true) include __DIR__.'/update-files-1.9.0-1.10.0.inc.php'; // Only updates the configuration.inc.php with the new version include __DIR__.'/update-configuration.inc.php'; - - $configurationFiles = [ - 'mail.conf.php', - 'profile.conf.php', - 'course_info.conf.php', - 'add_course.conf.php', - 'events.conf.php', - 'auth.conf.php', - ]; - - error_log('Copy conf files'); - - foreach ($configurationFiles as $file) { - if (file_exists(api_get_path(SYS_CODE_PATH).'inc/conf/'.$file)) { - copy( - api_get_path(SYS_CODE_PATH).'inc/conf/'.$file, - api_get_path(CONFIGURATION_PATH).$file - ); - } - } } error_log('Upgrade 1.10.x process concluded! ('.date('Y-m-d H:i:s').')'); diff --git a/main/install/install_files.inc.php b/main/install/install_files.inc.php index 35e107f406..c452ef93e3 100755 --- a/main/install/install_files.inc.php +++ b/main/install/install_files.inc.php @@ -28,10 +28,6 @@ if (defined('SYSTEM_INSTALLATION')) { api_get_path(CONFIGURATION_PATH).'profile.conf.dist.php', api_get_path(CONFIGURATION_PATH).'profile.conf.php' ); - copy( - api_get_path(CONFIGURATION_PATH).'auth.conf.dist.php', - api_get_path(CONFIGURATION_PATH).'auth.conf.php' - ); } else { echo 'You are not allowed here !'.__FILE__; }