Skip to content
Permalink
Browse files

Add "session_import_settings" configuration value see BT#15081

This option sets default parameters in the main/session/session_import.php
  • Loading branch information...
jmontoyaa committed Nov 28, 2018
1 parent 99429a5 commit ba6bffcce7a95ccbee25ef40da3e795eb8a67406
Showing with 20 additions and 0 deletions.
  1. +9 −0 main/install/configuration.dist.php
  2. +11 −0 main/session/session_import.php
@@ -1024,9 +1024,18 @@
// Allow my personal files link in the homepage
// $_configuration['allow_my_files_link_in_homepage'] = false;
// This option sets default parameters in the main/session/session_import.php
/*$_configuration['session_import_settings'] = [
'options' => [
'session_exists_default_option' => '1',
'send_mail_default_option' => '1',
]
];*/
// ------ Custom DB changes (keep this at the end)
// Add user activation by confirmation email
// This option prevents the new user to login in the platform if your account is not confirmed via email
// You need add a new option called "confirmation" to the registration settings
//INSERT INTO settings_options (variable, value, display_text) VALUES ('allow_registration', 'confirmation', 'MailConfirmation');
// ------ (End) Custom DB changes
@@ -511,6 +511,17 @@
$form->addButtonImport(get_lang('ImportSession'));
$defaults = ['sendMail' => 'true', 'file_type' => 'csv'];
$options = api_get_configuration_value('session_import_settings');
if (!empty($options) && isset($options['options'])) {
if (isset($options['options']['session_exists_default_option'])) {
$defaults['overwrite'] = $options['options']['session_exists_default_option'];
}
if (isset($options['options']['send_mail_default_option'])) {
$defaults['sendMail'] = $options['options']['send_mail_default_option'];
}
}
$form->setDefaults($defaults);
Display::return_message(get_lang('TheXMLImportLetYouAddMoreInfoAndCreateResources'));

0 comments on commit ba6bffc

Please sign in to comment.
You can’t perform that action at this time.