You are here

function force_password_change_delete_role in Force Password Change 2.0.x

Same name and namespace in other branches
  1. 8 force_password_change.module \force_password_change_delete_role()
  2. 7.2 force_password_change.module \force_password_change_delete_role()
  3. 7 force_password_change.module \force_password_change_delete_role()

Callback #submit function called on the role edit page when the user clicks the delete button. This function removes the fole from the {force_password_change_roles} table.

1 string reference to 'force_password_change_delete_role'
force_password_change_form_alter in ./force_password_change.module
Implements hook_form_alter().

File

./force_password_change.module, line 309

Code

function force_password_change_delete_role(array $form, FormStateInterface $form_state) {
  \Drupal::database()
    ->delete('force_password_change_roles')
    ->condition('rid', $form_state
    ->getValue('rid'))
    ->execute();
  \Drupal::database()
    ->delete('force_password_change_expiry')
    ->condition('rid', $form_state
    ->getValue('rid'))
    ->execute();
}