diff --git a/core/modules/openid/openid.module b/core/modules/openid/openid.module index eafb0b0..5cfd3c7 100644 --- a/core/modules/openid/openid.module +++ b/core/modules/openid/openid.module @@ -122,13 +122,6 @@ function openid_user_logout($account) { /** * Implements hook_form_FORM_ID_alter(). */ -function openid_form_user_login_block_alter(&$form, &$form_state) { - _openid_user_login_form_alter($form, $form_state); -} - -/** - * Implements hook_form_FORM_ID_alter(). - */ function openid_form_user_login_alter(&$form, &$form_state) { _openid_user_login_form_alter($form, $form_state); } diff --git a/core/modules/simpletest/lib/Drupal/simpletest/Tests/BrowserTest.php b/core/modules/simpletest/lib/Drupal/simpletest/Tests/BrowserTest.php index e976a48..83f5ccb 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/Tests/BrowserTest.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/Tests/BrowserTest.php @@ -30,14 +30,14 @@ class BrowserTest extends WebTestBase { * Test Drupal\simpletest\WebTestBase::getAbsoluteUrl(). */ function testGetAbsoluteUrl() { - $url = 'user/login'; + $url = 'user/password'; $this->drupalGet($url); $absolute = url($url, array('absolute' => TRUE)); $this->assertEqual($absolute, $this->url, t('Passed and requested URL are equal.')); $this->assertEqual($this->url, $this->getAbsoluteUrl($this->url), t('Requested and returned absolute URL are equal.')); - $this->drupalPost(NULL, array(), t('Log in')); + $this->drupalPost(NULL, array(), t('E-mail new password')); $this->assertEqual($absolute, $this->url, t('Passed and requested URL are equal.')); $this->assertEqual($this->url, $this->getAbsoluteUrl($this->url), t('Requested and returned absolute URL are equal.')); diff --git a/core/modules/user/user.module b/core/modules/user/user.module index a526b20..8cb92c1 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -732,36 +732,6 @@ function user_validate_current_pass(&$form, &$form_state) { } } -function user_login_block($form) { - $form['#action'] = url(current_path(), array('query' => drupal_get_destination(), 'external' => FALSE)); - $form['#id'] = 'user-login-form'; - $form['#validate'] = user_login_default_validators(); - $form['#submit'][] = 'user_login_submit'; - $form['name'] = array('#type' => 'textfield', - '#title' => t('Username'), - '#maxlength' => USERNAME_MAX_LENGTH, - '#size' => 15, - '#required' => TRUE, - ); - $form['pass'] = array('#type' => 'password', - '#title' => t('Password'), - '#maxlength' => 60, - '#size' => 15, - '#required' => TRUE, - ); - $form['actions'] = array('#type' => 'actions'); - $form['actions']['submit'] = array('#type' => 'submit', - '#value' => t('Log in'), - ); - $items = array(); - if (config('user.settings')->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY) { - $items[] = l(t('Create new account'), 'user/register', array('attributes' => array('title' => t('Create a new user account.')))); - } - $items[] = l(t('Request new password'), 'user/password', array('attributes' => array('title' => t('Request new password via e-mail.')))); - $form['links'] = array('#theme' => 'item_list', '#items' => $items); - return $form; -} - /** * Implements hook_block_info(). */ @@ -839,7 +809,7 @@ function user_block_view($delta = '') { if (!$user->uid && !(arg(0) == 'user' && !is_numeric(arg(1)))) { $block['subject'] = t('User login'); - $block['content'] = drupal_get_form('user_login_block'); + $block['content'] = drupal_get_form('user_login'); } return $block; @@ -1567,34 +1537,36 @@ function user_set_authmaps($account, $authmaps) { * @ingroup forms */ function user_login($form, &$form_state) { - global $user; - - // If we are already logged on, go to the user page instead. - if ($user->uid) { - drupal_goto('user/' . $user->uid); - } - // Display login form: - $form['name'] = array('#type' => 'textfield', + $form['name'] = array( + '#type' => 'textfield', '#title' => t('Username'), - '#size' => 60, + '#size' => 15, '#maxlength' => USERNAME_MAX_LENGTH, '#required' => TRUE, - '#attributes' => array( - 'autofocus' => 'autofocus', - ), ); $form['name']['#description'] = t('Enter your @s username.', array('@s' => config('system.site')->get('name'))); - $form['pass'] = array('#type' => 'password', + $form['pass'] = array( + '#type' => 'password', '#title' => t('Password'), + '#size' => 15, '#description' => t('Enter the password that accompanies your username.'), '#required' => TRUE, ); $form['#validate'] = user_login_default_validators(); + + $form['#action'] = url(current_path(), array('query' => drupal_get_destination(), 'external' => FALSE)); $form['actions'] = array('#type' => 'actions'); $form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Log in')); + // Adding action links. + if (config('user.settings')->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY) { + $items[] = l(t('Create new account'), 'user/register', array('attributes' => array('title' => t('Create a new user account.')))); + } + $items[] = l(t('Request new password'), 'user/password', array('attributes' => array('title' => t('Request new password via e-mail.')))); + $form['links'] = array('#theme' => 'item_list', '#items' => $items); + return $form; }