Remove unused CONFVAL_ASK_FOR_OFFICIAL_CODE code #2680

pull/2715/head
Julio 7 years ago
parent ed322cf52b
commit 07442b92ee
  1. 3
      main/auth/inscription.php
  2. 3
      main/auth/profile.php
  3. 17
      main/inc/global.inc.php
  4. 20
      main/install/install.lib.php
  5. 4
      main/install/install_files.inc.php

@ -240,8 +240,6 @@ if ($user_already_registered_show_terms === false &&
} }
} }
// OFFICIAL CODE
if (CONFVAL_ASK_FOR_OFFICIAL_CODE) {
if (in_array('official_code', $allowedFields)) { if (in_array('official_code', $allowedFields)) {
$form->addElement( $form->addElement(
'text', 'text',
@ -257,7 +255,6 @@ if ($user_already_registered_show_terms === false &&
); );
} }
} }
}
// EXTENDED FIELDS // EXTENDED FIELDS
if (api_get_setting('extended_profile') == 'true' && if (api_get_setting('extended_profile') == 'true' &&

@ -152,8 +152,6 @@ $form->addRule('username', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule('username', get_lang('UsernameWrong'), 'username'); $form->addRule('username', get_lang('UsernameWrong'), 'username');
$form->addRule('username', get_lang('UserTaken'), 'username_available', $user_data['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]); $form->addElement('text', 'official_code', get_lang('OfficialCode'), ['size' => 40]);
if (api_get_setting('profile', 'officialcode') !== 'true') { if (api_get_setting('profile', 'officialcode') !== 'true') {
$form->freeze('official_code'); $form->freeze('official_code');
@ -166,7 +164,6 @@ if (defined('CONFVAL_ASK_FOR_OFFICIAL_CODE') && CONFVAL_ASK_FOR_OFFICIAL_CODE ==
) { ) {
$form->addRule('official_code', get_lang('ThisFieldIsRequired'), 'required'); $form->addRule('official_code', get_lang('ThisFieldIsRequired'), 'required');
} }
}
// EMAIL // EMAIL
$form->addElement('email', 'email', get_lang('Email'), ['size' => 40]); $form->addElement('email', 'email', get_lang('Email'), ['size' => 40]);

@ -280,23 +280,6 @@ try {
$administrator['email'] = isset($administrator['email']) ? $administrator['email'] : 'admin@example.com'; $administrator['email'] = isset($administrator['email']) ? $administrator['email'] : 'admin@example.com';
$administrator['name'] = isset($administrator['name']) ? $administrator['name'] : 'Admin'; $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 */ /* LOAD LANGUAGE FILES SECTION */
// if we use the javascript version (without go button) we receive a get // 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 // if we use the non-javascript version (with the go button) we receive a post

@ -3674,26 +3674,6 @@ function migrateSwitch($fromVersion, $manager, $processFiles = true)
include __DIR__.'/update-files-1.9.0-1.10.0.inc.php'; include __DIR__.'/update-files-1.9.0-1.10.0.inc.php';
// Only updates the configuration.inc.php with the new version // Only updates the configuration.inc.php with the new version
include __DIR__.'/update-configuration.inc.php'; 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').')'); error_log('Upgrade 1.10.x process concluded! ('.date('Y-m-d H:i:s').')');

@ -28,10 +28,6 @@ if (defined('SYSTEM_INSTALLATION')) {
api_get_path(CONFIGURATION_PATH).'profile.conf.dist.php', api_get_path(CONFIGURATION_PATH).'profile.conf.dist.php',
api_get_path(CONFIGURATION_PATH).'profile.conf.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 { } else {
echo 'You are not allowed here !'.__FILE__; echo 'You are not allowed here !'.__FILE__;
} }

Loading…
Cancel
Save