Skip to content

Commit

Permalink
Issue #215: Clean-up user edit form
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Brockbank authored and lkmorlan committed Dec 7, 2023
1 parent 9013993 commit b320d58
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions html/modules/custom/bc_dc/bc_dc.module
Original file line number Diff line number Diff line change
Expand Up @@ -628,3 +628,15 @@ function bc_dc_system_breadcrumb_alter(Breadcrumb &$breadcrumb, RouteMatchInterf
$breadcrumb->setLinks($links);
$breadcrumb->addCacheableDependency($cacheability);
}

/**
* Implements hook_form_FORM_ID_alter().
*/
function bc_dc_form_user_form_alter(array &$form, FormStateInterface $form_state, string $form_id): void {
$user = \Drupal::currentUser();
if (!in_array('administrator', $user->getRoles())) {
$form['language']['#access'] = FALSE;
$form['timezone']['#access'] = FALSE;
$form['account']['#access'] = FALSE;
}
}

0 comments on commit b320d58

Please sign in to comment.