Fix setting definition "show_conditions_to_user" see BT#14371

pull/2543/head
jmontoyaa 8 years ago
parent 3640292c89
commit dec201b557
  1. 3
      main/admin/user_edit.php
  2. 3
      main/auth/inscription.php
  3. 3
      main/auth/profile.php
  4. 19
      main/install/configuration.dist.php

@ -340,7 +340,8 @@ $(document).ready(function(){
// Freeze user conditions, admin cannot updated them
$extraConditions = api_get_configuration_value('show_conditions_to_user');
if ($extraConditions) {
if ($extraConditions && isset($extraConditions['conditions'])) {
$extraConditions = $extraConditions['conditions'];
foreach ($extraConditions as $condition) {
/** @var HTML_QuickForm_group $element */
$element = $form->getElement('extra_'.$condition['variable']);

@ -57,9 +57,10 @@ if (!empty($_SESSION['user_language_choice'])) {
$extraConditions = api_get_configuration_value('show_conditions_to_user');
if ($extraConditions) {
if ($extraConditions && isset($extraConditions['conditions'])) {
// Create user extra fields for the conditions
$userExtraField = new ExtraField('user');
$extraConditions = $extraConditions['conditions'];
foreach ($extraConditions as $condition) {
$exists = $userExtraField->get_handler_field_info_by_field_variable($condition['variable']);
if ($exists == false) {

@ -364,7 +364,8 @@ if (is_profile_editable()) {
// Student cannot modified their user conditions
$extraConditions = api_get_configuration_value('show_conditions_to_user');
if ($extraConditions) {
if ($extraConditions && isset($extraConditions['conditions'])) {
$extraConditions = $extraConditions['conditions'];
foreach ($extraConditions as $condition) {
$element = $form->getElement('extra_'.$condition['variable']);
if ($element) {

@ -861,15 +861,22 @@ VALUES (2, 13, 'session_courses_read_only_mode', 'Lock Course In Session', 1, 1,
// Show pending survey link in user menu
// $_configuration['show_pending_survey_in_menu'] = false;
// Show multiple conditions to user during the inscription
// Show multiple conditions to user during sign up process
// Example with a GDPR condition
$_configuration['show_conditions_to_user'] = [
/*$_configuration['show_conditions_to_user'] = [
'conditions' => [
'variable' => 'gdpr', // internal extra field name
'display_text' => 'GDPRTitle', // checkbox title will be translated with get_lang('GDPRTitle')
'text_area' => 'GDPRTextArea', // this will be translated using get_lang('GDPRTextArea')
[
'variable' => 'gdpr', // internal extra field name
'display_text' => 'GDPRTitle', // checkbox title will be translated with get_lang('GDPRTitle')
'text_area' => 'GDPRTextArea', // this will be translated using get_lang('GDPRTextArea')
],
[
'variable' => 'my_terms',
'display_text' => 'My test conditions',
'text_area' => 'This is a long text area, with lot of terms and conditions ... ',
],
],
];
];*/
// ------ Custom DB changes (keep this at the end)
// Add user activation by confirmation email

Loading…
Cancel
Save