-
Notifications
You must be signed in to change notification settings - Fork 11
/
oe_authentication.post_update.php
44 lines (38 loc) · 1.29 KB
/
oe_authentication.post_update.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
<?php
/**
* @file
* Post update functions for OE Authentication module.
*/
declare(strict_types=1);
/**
* Customize error messages that refer to CAS.
*/
function oe_authentication_post_update_00001(array &$sandbox) {
\Drupal::configFactory()->getEditable('cas.settings')
->set('error_handling.message_prevent_normal_login', 'This account must log in using <a href="[cas:login-url]">EU Login</a>.')
->set('error_handling.message_restrict_password_management', 'The requested account is associated with EU Login and its password cannot be managed from this website.')
->save();
}
/**
* Update email domain in CAS settings.
*/
function oe_authentication_post_update_00002(array &$sandbox) {
\Drupal::configFactory()->getEditable('cas.settings')
->set('user_accounts.email_hostname', 'example.com')
->save();
}
/**
* Set force_2fa to FALSE as default.
*/
function oe_authentication_post_update_00003() {
\Drupal::configFactory()->getEditable('oe_authentication.settings')
->set('force_2fa', FALSE)->save();
}
/**
* Set the auto_register_follow_registration_policy setting.
*/
function oe_authentication_post_update_00004(): void {
\Drupal::configFactory()->getEditable('cas.settings')
->set('user_accounts.auto_register_follow_registration_policy', TRUE)
->save();
}