You are here

function user_expire_user_profile_form_submit in User Expire 8

Submit callback for the user profile form to save the contact page setting.

1 string reference to 'user_expire_user_profile_form_submit'
user_expire_form_user_form_alter in ./user_expire.module
Implements hook_form_FORM_ID_alter().

File

./user_expire.module, line 124
Main module file for User expire module.

Code

function user_expire_user_profile_form_submit($form, FormStateInterface $form_state) {
  $account = $form_state
    ->getFormObject()
    ->getEntity();
  if ($account
    ->id() && $form_state
    ->hasValue('user_expiration_date')) {
    $account->user_expiration_date = $form_state
      ->getValue('user_expiration_date');
    $account->user_expiration = $form_state
      ->getValue('user_expiration');
    $account->expiration = $form_state
      ->getValue('user_expiration_date');
    _user_expire_save($account);
  }
}