You are here

function _bakery_pass_validate in Bakery Single Sign-On System 7.2

Same name and namespace in other branches
  1. 8.2 bakery.module \_bakery_pass_validate()
  2. 6.2 bakery.module \_bakery_pass_validate()

Validate handler for the password reset login.

1 string reference to '_bakery_pass_validate'
bakery_form_alter in ./bakery.module
Implements hook_form_alter().

File

./bakery.module, line 440
Module file for the Bakery.

Code

function _bakery_pass_validate($form, &$form_state) {

  // On a slave site it's possible that a user requests their password but
  // doesn't have an account on the slave site. So, we check if that's the case
  // and use our helpful functions to create their account on the slave site.
  $name = trim($form_state['values']['name']);
  $account = user_load_by_mail($name);
  if (!$account) {

    // No success, try to load by name.
    $account = user_load_by_name($name);
  }
  if (!$account) {

    // Attempt to copy account from master.
    bakery_request_account($name, TRUE);
  }
}