D6 fixing the code of a very small module

I'm using [url removed, login to view] so users can login with their email.

I need a small module to prevent users from logging in with "username".

<My goal>

Users can login with only by their email address but NOT by their username

<Example code>

function My_MODULE_form_user_login_alter(&$form, &$form_state) {

// Add an extra validation step to the form.

// The user is actually authenticated during the validation stage

// so we have to make sure this validate function runs before any others

array_unshift($form['#validate'], 'My_MODULE_user_login_validate');


function My_MODULE_user_login_validate($form, &$form_state) {

// Make sure the provided username field is in the form of an email address.

// If not we can safely say the user shouldn't be allowed to log in,

// regardless of whether or not a user exists with that username.

if (!valid_email_address($form_state['values']['name'])) {

form_set_error('name', 'The email address you have entered was not found in the system.');

// Empty the name variable so further validation definitely fails.

// There are probably better ways to do this.

$form_state['values']['name'] = '';



But the code above doesn't let login with their email address also.

I'm expecting to pay around US$10 to fix this and I would like to ask this job the one who bids the lowest price.

Thanks you.

Kemahiran: Drupal, PHP

Lihat lagi: i need a better job, fixing my, very small, code name one, drupal add form, php module function, drupal user module, php log found, drupal user field, entered values, drupal add user field, code function, authenticated, add field code, job logging system php, drupal form email validation, small project drupal, authenticated users, login module php, php small login project, validation email address, small validation, email validate, php job module, validate username

Tentang Majikan:
( 5 ulasan ) Koto-ku, Japan

ID Projek: #1562988

Dianugerahkan kepada:


Please check PM

$30 USD dalam sehari
(6 Ulasan)

7 pekerja bebas membida secara purata $30 untuk pekerjaan ini


Already to work! Give me this job! Thanks

$30 USD dalam 0 hari
(75 Ulasan)

check your [login to view URL]

$30 USD dalam 3 hari
(88 Ulasan)

I will do it just [login to view URL] check your message box.

$30 USD dalam sehari
(33 Ulasan)

Please see pm

$30 USD dalam sehari
(21 Ulasan)

Hello KUSHIBARA, Drupal certified engineer willing to assist.

$30 USD dalam 2 hari
(8 Ulasan)

I'm working as a full-time drupal developer for the past two years. I'll exploring this task whether i took it or not, most probably I'd have it complete when you ready this bid :) P.S. bid can't be less than 30 Lagi

$30 USD dalam sehari
(1 Ulasan)