You are here

public function UserSaveHandler::configFormSubmit in Services Client 7.2

Form submit.

Overrides EventHandler::configFormSubmit

File

include/event.inc, line 1390

Class

UserSaveHandler

Code

public function configFormSubmit(&$form, &$form_state) {
  parent::configFormSubmit($form, $form_state);
  $this->config['user_map_roles'] = $form_state['values']['user_map_roles'];
  $this->config['user_sync_by_name'] = $form_state['values']['user_sync_by_name'];

  // Store role mapping
  $this->config['user_map_roles_map'] = array();
  $i = 0;
  foreach (array_keys($form_state['values']['user_map_roles_widget']) as $key) {
    if ($key !== 'add_row') {
      $local = $form_state['values']['user_map_roles_widget'][$key]['local'];
      $remote = $form_state['values']['user_map_roles_widget'][$key]['remote'];
      if (!empty($local) && !empty($remote)) {
        $this->config['user_map_roles_map'][$i++] = array(
          'local' => $local,
          'remote' => $remote,
        );
      }
    }
  }
}