In the user_login function, user_deny is called even if $edit['name'] is empty (for example when the login form is displayed for the first time). I think this performs 2 unnecessary database queries.

CommentFileSizeAuthor
#6 userlogin_0.patch10.9 KBZen
#4 userlogin.patch11.09 KBZen
#3 user_29.patch685 bytesgordon
#2 user_28.patch691 bytesgordon

Comments

Bèr Kessels’s picture

gordon’s picture

Assigned: Unassigned » gordon
Status: Active » Needs review
StatusFileSize
new691 bytes

here is a small problem that fixes this. It actually reduces the queries by 4 not including and also the actual user authentication.

gordon’s picture

StatusFileSize
new685 bytes

a little tidier patch.

Zen’s picture

Priority: Minor » Normal
StatusFileSize
new11.09 KB

Resurrecting this issue. Attached patch:

  • Makes the user login and password fields in the login _block_ required.
  • Uses just if ($form['name']) rather than if (isset($form['name']) && $form['name']). AFAIK, using both is unnecessary with the form API.
  • Changes maxlength for usernames to 60 which is the (rather odd) database value. The maxlength fields at present don't accomodate affiliate logins with extra long usernames/domains, but I've left that issue alone for now.
  • Removes all instances of maxlength for password. They were a)not being applied with any degree of consistency, and b)unnecessary as only the hash is stored.
  • Corrects an e-mail address maxlength from 55 to 64.
  • unset() accepts more than one variable.

That's about it. Please review.

Thanks :)
-K

Zen’s picture

Assigned: gordon » Zen
Zen’s picture

Title: user_login calls user_deny with empty variable » Fix user login error message + attribute fixes
StatusFileSize
new10.9 KB

Re-rolled.

-K

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

code reviewed and tested. i fixed a tiny problem with duplicate ids in the
tag as per http://drupal.org/project/comments/add/47785

fax8’s picture

Status: Reviewed & tested by the community » Needs work

Where is your patch moshe?

ids are still dupicate on userlogin_0.patch

moshe weitzman’s picture

Status: Needs work » Reviewed & tested by the community

i managed to lose my changes. lets just take Zen's most recent patch. it fixes this issue nicely.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)