Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions config/authsources.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,21 @@
],
];
}

if ($saml2auth->config->refedscodeofconduct === '1') {
$sp = $saml2auth->spname;

if (!isset($config[$sp]['EntityAttributes'])) {
$config[$sp]['EntityAttributes'] = [];
}

if (!isset($config[$sp]['EntityAttributes']['https://macedir.org/entity-category'])) {
$config[$sp]['EntityAttributes']['https://macedir.org/entity-category'] = [];
}

$config[$sp]['EntityAttributes']['https://macedir.org/entity-category'][] =
'https://refeds.org/category/code-of-conduct/v2';

$config[$sp]['EntityAttributes']['https://macedir.org/entity-category'][] =
'http://www.geant.net/uri/dataprotection-code-of-conduct/v1';
}
2 changes: 2 additions & 0 deletions lang/en/auth_saml2.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@
$string['pluginname'] = 'SAML2';
$string['privatekeypass'] = 'Private certificate key password';
$string['privatekeypass_help'] = 'This is used for signing the local Moodle certificate, changing this will invalidate the current certificate.';
$string['refedscodeofconduct'] = 'REFEDS Data Protection Code of Conduct v2.0';
$string['refedscodeofconduct_desc'] = 'Include in the Service Provider metadata that this Moodle instance adheres to the <a href="{$a}" target="_blank">REFEDS Data Protection Code of Conduct v2.0</a>.';
$string['regenerate_submit'] = 'Regenerate';
$string['regenerateheading'] = 'Regenerate Private Key and Certificate';
$string['rememberidp'] = 'Remember login service';
Expand Down
12 changes: 12 additions & 0 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,18 @@
PARAM_TEXT
));

// Signal REFEDS Data Protection Code of Conduct.
$settings->add(new admin_setting_configcheckbox(
'auth_saml2/refedscodeofconduct',
get_string('refedscodeofconduct', 'auth_saml2'),
get_string(
'refedscodeofconduct_desc',
'auth_saml2',
'https://refeds.org/category/code-of-conduct/v2'
),
'0'
));

// Autocreate Users.
$settings->add(new admin_setting_configselect(
'auth_saml2/autocreate',
Expand Down