To set default parameters in the main/admin/user_import.php page
@@ -1,5 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
+
/**
* This tool allows platform admins to add users by uploading a CSV or XML file.
*
@@ -548,6 +549,14 @@ $form->addButtonImport(get_lang('Import'));
$defaults['formSent'] = 1;
$defaults['sendMail'] = 0;
$defaults['file_type'] = 'csv';
+$extraSettings = api_get_configuration_value('user_import_settings');
+if (!empty($extraSettings) && isset($extraSettings['options']) &&
+ isset($extraSettings['options']['send_mail_default_option'])
+) {
+ $defaults['sendMail'] = $extraSettings['options']['send_mail_default_option'];
+}
$form->setDefaults($defaults);
$form->display();
@@ -1032,6 +1032,13 @@ VALUES (2, 13, 'session_courses_read_only_mode', 'Lock Course In Session', 1, 1,
]
];*/
+// This option sets default parameters in the main/admin/user_import.php
+/*$_configuration['user_import_settings'] = [
+ 'options' => [
+ 'send_mail_default_option' => '1',
+ ]
+];*/
// Disable all new exercise attempts in all the platform
// $_configuration['exercises_disable_new_attempts'] = false;