function securesite_user_login_form in Secure Site 7.2
Form constructor for user login form.
We use our own version of the login form for theming. We do not use the default validate and submit functions because we may allow anonymous users.
See also
2 string references to 'securesite_user_login_form'
- _securesite_dialog_page in ./
securesite.inc - Display fall-back HTML for HTTP authentication dialogs. Safari will not load this. Opera will not load this after log-out unless the page has been reloaded and the authentication dialog has been displayed twice.
- _securesite_mechanism in ./
securesite.module - Return the authentication method used by the client, or FALSE if the client did not send credentials.
File
- ./
securesite.inc, line 477 - Secure Site log-in functions.
Code
function securesite_user_login_form($form, &$form_state) {
$form['name'] = array(
'#type' => 'textfield',
'#title' => t('User name'),
'#maxlength' => USERNAME_MAX_LENGTH,
'#size' => 15,
);
$form['pass'] = array(
'#type' => 'password',
'#title' => t('Password'),
'#maxlength' => 60,
'#size' => 15,
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Log in'),
'#weight' => 2,
);
if (module_exists('openid')) {
global $base_path;
$style = '<style type="text/css" media="all">' . "\n" . '#securesite-user-login li.openid-link {' . "\n" . ' background:transparent url(' . $base_path . drupal_get_path('module', 'openid') . '/login-bg.png) no-repeat scroll 1px 0.35em;' . "\n" . '}' . "\n" . '</style>';
drupal_add_html_head($style, 'securesite_open_id');
}
// drupal_alter takes this variable by reference so can't be a literal.
$form_id = 'user_login';
drupal_alter('form', $form, $form_state, $form_id);
return $form;
}