Skip to content

Commit

Permalink
Merge pull request #11 from bellcom/f/user_activation_settings
Browse files Browse the repository at this point in the history
Moving user activation settings in order to make them available
  • Loading branch information
andriyun authored Apr 13, 2018
2 parents edc330e + 432d059 commit 066cfe0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 39 deletions.
34 changes: 34 additions & 0 deletions includes/settings_form.inc
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,40 @@ $csv_cols_fallback_1 = array(
'#default_value' => variable_get('os2intra_user_import_user_disable_action', 'user_disable'),
);

// User activation settings, see includes/activation_form.inc
$form['os2intra_user_import_activate'] = array(
'#type' => 'fieldset',
'#title' => t('User activation'),
'#collapsible' => TRUE,
);

$form['os2intra_user_import_activate']['activation_fields'] = array(
'#type' => 'fieldset',
'#title' => t('Validate first login by'),
);

$form['os2intra_user_import_activate']['activation_fields']['os2intra_user_import_activate_identification'] = array(
'#title' => t('User identification'),
'#type' => 'select',
'#options' => array(
'ad_id' => t('AD id'),
'employee_id' => ('Employee number'),
),
'#default_value' => variable_get('os2intra_user_import_activate_identification', OS2INTRA_USER_IMPORT_ACTIVATE_IDENTIFICATION),
);

$form['os2intra_user_import_activate']['activation_fields']['os2intra_user_import_activate_birthday'] = array(
'#title' => t('Birthday'),
'#type' => 'checkbox',
'#default_value' => variable_get('os2intra_user_import_activate_birthday', OS2INTRA_USER_IMPORT_ACTIVATE_BIRTHDAY),
);

$form['os2intra_user_import_activate']['activation_fields']['os2intra_user_import_activate_email'] = array(
'#title' => t('Email address'),
'#type' => 'checkbox',
'#default_value' => variable_get('os2intra_user_import_activate_email', OS2INTRA_USER_IMPORT_ACTIVATE_EMAIL),
);

// Settings for data structure compatibility in different installations.
$form['os2intra_structure_settings'] = array(
'#type' => 'fieldset',
Expand Down
39 changes: 0 additions & 39 deletions os2intra_user_import.module
Original file line number Diff line number Diff line change
Expand Up @@ -111,45 +111,6 @@ function os2intra_user_import_form_alter(&$form, &$form_state, $form_id) {
}
}

// Settings form.
// @TODO These settings should be available to change in scope of
// os2intra_user_import module.
if ($form_id == 'os2intra_settings_settings_form') {

$form['os2intra_user_import_activate'] = array(
'#type' => 'fieldset',
'#title' => t('User activation'),
'#collapsible' => TRUE,
);

$form['os2intra_user_import_activate']['activation_fields'] = array(
'#type' => 'fieldset',
'#title' => t('Validate first login by'),
);

$form['os2intra_user_import_activate']['activation_fields']['os2intra_user_import_activate_identification'] = array(
'#title' => t('User identification'),
'#type' => 'select',
'#options' => array(
'ad_id' => t('AD id'),
'employee_id' => ('Employee number'),
),
'#default_value' => variable_get('os2intra_user_import_activate_identification', OS2INTRA_USER_IMPORT_ACTIVATE_IDENTIFICATION),
);

$form['os2intra_user_import_activate']['activation_fields']['os2intra_user_import_activate_birthday'] = array(
'#title' => t('Birthday'),
'#type' => 'checkbox',
'#default_value' => variable_get('os2intra_user_import_activate_birthday', OS2INTRA_USER_IMPORT_ACTIVATE_BIRTHDAY),
);

$form['os2intra_user_import_activate']['activation_fields']['os2intra_user_import_activate_email'] = array(
'#title' => t('Email address'),
'#type' => 'checkbox',
'#default_value' => variable_get('os2intra_user_import_activate_email', OS2INTRA_USER_IMPORT_ACTIVATE_EMAIL),
);
}

if ($form_id == 'user_login') {
// Add link for user activation to login form.
$form['activate_user'] = array(
Expand Down

0 comments on commit 066cfe0

Please sign in to comment.