Sedang Disiapkan

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 lebih lanjut: need 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:

vijay04

Please check PM

$30 USD dalam sehari
(4 Ulasan)
3.4

8 pekerja bebas membida secara purata $30 untuk pekerjaan ini

Instantsolutions

check your pmb.Thanks

$30 USD dalam 3 hari
(77 Ulasan)
6.4
binhdigipro

Already to work! Give me this job! Thanks

$30 USD dalam 0 hari
(37 Ulasan)
5.8
bhavinhjoshi

Hello, Please check PM. Regards.

$30 USD dalam 0 hari
(50 Ulasan)
5.9
lordpet

I can do this for you. There is a module which already does this. http://drupal.org/project/email_registration Thanks

$30 USD dalam 2 hari
(8 Ulasan)
5.4
fhedayatif

Please see pm

$30 USD dalam sehari
(21 Ulasan)
5.2
dgitts

Hello KUSHIBARA, Drupal certified engineer willing to assist.

$30 USD dalam 2 hari
(8 Ulasan)
4.8
siteexpert

I will do it just now.Please check your message box.

$30 USD dalam sehari
(12 Ulasan)
4.6
obad2015

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)
1.0