-
Notifications
You must be signed in to change notification settings - Fork 4
/
settings.php
68 lines (51 loc) · 4.01 KB
/
settings.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
/**
* User role assignment plugin settings and presets.
*
* @package enrol
* @subpackage dbuserrel
* @copyright Penny Leach <[email protected]>
* @copyright Maxime Pelletier <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
if ($ADMIN->fulltree) {
//--- general settings -----------------------------------------------------------------------------------
$settings->add(new admin_setting_heading('enrol_dbuserrel_settings', '', get_string('pluginname_desc', 'enrol_dbuserrel')));
$settings->add(new admin_setting_heading('enrol_dbuserrel_exdbheader', get_string('settingsheaderdb', 'enrol_dbuserrel'), ''));
$options = array('', "access","ado_access", "ado", "ado_mssql", "borland_ibase", "csv", "db2", "fbsql", "firebird", "ibase", "informix72", "informix", "mssql", "mssql_n", "mssqlnative", "mysql", "mysqli", "mysqlt", "oci805", "oci8", "oci8po", "odbc", "odbc_mssql", "odbc_oracle", "oracle", "postgres64", "postgres7", "postgres", "proxy", "sqlanywhere", "sybase", "vfp");
$options = array_combine($options, $options);
$settings->add(new admin_setting_configselect(
'enrol_dbuserrel/dbtype',
get_string('dbtype', 'enrol_dbuserrel'),
get_string('dbtype_desc', 'enrol_dbuserrel'),
'mysqli',
$options
));
$settings->add(new admin_setting_configtext('enrol_dbuserrel/dbhost', get_string('dbhost', 'enrol_dbuserrel'), get_string('dbhost_desc', 'enrol_dbuserrel'), 'localhost'));
$settings->add(new admin_setting_configtext('enrol_dbuserrel/dbuser', get_string('dbuser', 'enrol_dbuserrel'), '', ''));
$settings->add(new admin_setting_configpasswordunmask('enrol_dbuserrel/dbpass', get_string('dbpass', 'enrol_dbuserrel'), '', ''));
$settings->add(new admin_setting_configtext('enrol_dbuserrel/dbname', get_string('dbname', 'enrol_dbuserrel'), '', ''));
$settings->add(new admin_setting_configtext('enrol_dbuserrel/dbencoding', get_string('dbencoding', 'enrol_dbuserrel'), '', 'utf-8'));
$settings->add(new admin_setting_configtext('enrol_dbuserrel/remoteenroltable', get_string('remoteenroltable', 'enrol_dbuserrel'), get_string('remoteenroltable_desc', 'enrol_dbuserrel'), ''));
$settings->add(new admin_setting_heading('enrol_dbuserrel_remoteheader', get_string('remote_fields_mapping', 'enrol_dbuserrel'), ''));
// Set local object and subject options from list of fields advertised by available field entities
$settings->add(new admin_setting_configselect(
'enrol_dbuserrel/localsubjectuserfield',
get_string('localsubjectuserfield', 'enrol_dbuserrel'),
get_string('localsubjectuserfield_desc', 'enrol_dbuserrel'),
'',
enrol_dbuserrel_field_factory::get_mappable_fields_for_config_settings()
));
$settings->add(new admin_setting_configselect(
'enrol_dbuserrel/localobjectuserfield',
get_string('localobjectuserfield', 'enrol_dbuserrel'),
get_string('localobjectuserfield_desc', 'enrol_dbuserrel'),
'',
enrol_dbuserrel_field_factory::get_mappable_fields_for_config_settings()
));
$settings->add(new admin_setting_configtext('enrol_dbuserrel/localrolefield', get_string('localrolefield', 'enrol_dbuserrel'), get_string('localrolefield_desc', 'enrol_dbuserrel'), 'shortname'));
$settings->add(new admin_setting_configtext('enrol_dbuserrel/remotesubjectuserfield', get_string('remotesubjectuserfield', 'enrol_dbuserrel'), get_string('remotesubjectuserfield_desc', 'enrol_dbuserrel'), ''));
$settings->add(new admin_setting_configtext('enrol_dbuserrel/remoteobjectuserfield', get_string('remoteobjectuserfield', 'enrol_dbuserrel'), get_string('remoteobjectuserfield_desc', 'enrol_dbuserrel'), ''));
$settings->add(new admin_setting_configtext('enrol_dbuserrel/remoterolefield', get_string('remoterolefield', 'enrol_dbuserrel'), get_string('remoterolefield_desc', 'enrol_dbuserrel'), ''));
}