Skip to content

Commit

Permalink
imported user expire settings file (#491)
Browse files Browse the repository at this point in the history
* imported user expire settings file

* fixed name function

* added commit hash

* Updated hook update

* Fixed hook update

* revert commit hash

---------

Co-authored-by: Md Nadim Hossain <[email protected]>
Co-authored-by: Vincent Gao <[email protected]>
  • Loading branch information
3 people authored Nov 26, 2024
1 parent b4f3247 commit 6b61f04
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
13 changes: 13 additions & 0 deletions modules/tide_user_expire/config/optional/user_expire.settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
frequency: 172800
offset: 604800
user_expire_roles:
authenticated: 13148730
administrator: 13148730
approver: 13148730
site_admin: 13148730
editor: 13148730
previewer: 13148730
contributor: 13148730
event_author: 13148730
grant_author: 13148730
site_auditor: 13148730
15 changes: 15 additions & 0 deletions modules/tide_user_expire/tide_user_expire.install
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,18 @@
function tide_user_expire_uninstall() {
\Drupal::configFactory()->getEditable('tide_user_expire.settings')->delete();
}

/**
* Import user expire settings.
*/
function tide_user_expire_update_10001() {
module_load_include('inc', 'tide_core', 'includes/helpers');
$config_id = 'user_expire.settings';
$config = \Drupal::configFactory()->getEditable($config_id);
$config_location = [\Drupal::service('extension.list.module')->getPath('tide_user_expire') . '/config/optional'];
$config_read = _tide_read_config($config_id, $config_location, FALSE);
$config->set('frequency', $config_read['frequency']);
$config->set('offset', $config_read['offset']);
$config->set('user_expire_roles', $config_read['user_expire_roles']);
$config->save();
}

0 comments on commit 6b61f04

Please sign in to comment.