Remove unused CONFVAL_ASK_FOR_OFFICIAL_CODE code #2680

pull/2715/head
Julio 7 years ago
parent ed322cf52b
commit 07442b92ee
  1. 25
      main/auth/inscription.php
  2. 25
      main/auth/profile.php
  3. 19
      main/inc/global.inc.php
  4. 20
      main/install/install.lib.php
  5. 4
      main/install/install_files.inc.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'
);
}
}
}

@ -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

@ -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

@ -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').')');

@ -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__;
}

Loading…
Cancel
Save