i'm dancing around line 31
user_authenticate_finalize($values);
in users module find only user_login_finalize funktion.

write to you, when find answer...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

vmkazakoff’s picture

Title: D7 portnot working » D7 port not working
vmkazakoff’s picture

found:

//alternative login function to check against uid instead of username
function uid_login_validate($form, $form_state) {
  global $user;
  $values=$form_state['values'];
  if (!empty($values['name']) && !empty($values['pass']) && $account = user_load(array('uid' => $values['name'], 'pass' => trim($values['pass']), 'status' => 1))) {
    $user = $account;
    user_authenticate_finalize($values);
    return $user;
  } else {
    user_login_final_validate($form, $form_state);
  }
}

and replace on

//alternative login function to check against uid instead of username
function uid_login_validate($form, $form_state) {
  global $user;
  $values=$form_state['values'];
  if (!empty($values['name']) && !empty($values['pass']) && $account = user_load($values['name'])) {
    // !!Argument to a load() function *must* be a single id
    $user = $account;
    user_login_finalize($values);
    // !! it is no "user_authenticate_finalize" function in drupal 7
    return $user;
  } else {
    user_login_final_validate($form, $form_state);
  }
}

now i have a error (incorrect user name or password), but already can log in...

vmkazakoff’s picture

DO NOT USE THIS CODE!!!
i found a big mistake in it!

jharder’s picture

I am porting a different custom login module from 6 to 7 and am encountering a similar problem that after updating the user_login_finalize function, the user is logged in but error message is still displayed. What solution did you find?

matslats’s picture

Sorry I don't understand.
What is the error message in uid_login?

jharder’s picture

Not sure if this questions was meant for my reply, but the error message is incorrect username or password.

matslats’s picture

Status: Active » Closed (fixed)

I had forgotten to commit this module after updating it...

Sarenc’s picture

Some fixes.

Sarenc’s picture

Status: Closed (fixed) » Needs review