From 432d0592346fe73069c27aaeec6077f25842c5e3 Mon Sep 17 00:00:00 2001 From: Stanislav Kutasevits Date: Fri, 13 Apr 2018 12:32:50 +0300 Subject: [PATCH] Moving user activation settings in order to make them available --- includes/settings_form.inc | 34 ++++++++++++++++++++++++++++++++ os2intra_user_import.module | 39 ------------------------------------- 2 files changed, 34 insertions(+), 39 deletions(-) diff --git a/includes/settings_form.inc b/includes/settings_form.inc index 78c98be..710bb19 100644 --- a/includes/settings_form.inc +++ b/includes/settings_form.inc @@ -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', diff --git a/os2intra_user_import.module b/os2intra_user_import.module index c16daea..eb1c107 100644 --- a/os2intra_user_import.module +++ b/os2intra_user_import.module @@ -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(