function security_questions_form_user_register_alter in Security Questions 6.2
Same name and namespace in other branches
- 6 security_questions.module \security_questions_form_user_register_alter()
Implements hook_form_FORM_ID_alter().
Allows the user to select security questions during registration.
File
- ./
security_questions.module, line 82 - Main module file for security_questions.
Code
function security_questions_form_user_register_alter(&$form, &$form_state) {
// Hide the questions form when the user is being registered by an admin.
if (!user_access('administer users')) {
// Merge in our user form.
module_load_include('inc', 'security_questions', 'security_questions.pages');
$form += drupal_retrieve_form('security_questions_user_form', $form_state);
array_unshift($form['#validate'], 'security_questions_user_register_form_validate');
// We can't add our submit handler here, because the user account doesn't
// exist yet. Instead, we will get the info during hook_user().
}
}