user_register_form($form, &$form_state)Form builder; the user registration form.
@see user_account_form_validate()
modules/user/user.module, line 3273
<?php
function user_register_form($form, &$form_state) {
global $user;
$admin = user_access('administer users');
// If we aren't admin but already logged on, go to the user page instead.
if (!$admin && $user->uid) {
drupal_goto('user/' . $user->uid);
}
$form['#user'] = drupal_anonymous_user();
$form['#user_category'] = 'register';
$form['#attached']['library'][] = array('system', 'cookie');
$form['#attributes']['class'][] = 'user-info-from-cookie';
$form['#pre_render'] = array('user_register_form_pre_render');
// Start with the default user account fields.
user_account_form($form, $form_state);
if ($admin) {
// Redirect back to page which initiated the create request;
// usually admin/people/create.
$form_state['redirect'] = $_GET['q'];
}
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Create new account'),
'#weight' => 30,
);
// Add the final user registration form submit handler.
$form['#submit'][] = 'user_register_submit';
return $form;
}
?>