function bakery_uncrumble_validate in Bakery Single Sign-On System 6.2
Same name and namespace in other branches
- 6 bakery.module \bakery_uncrumble_validate()
- 7.2 bakery.module \bakery_uncrumble_validate()
Validation for bakery_uncrumble form.
File
- ./
bakery.module, line 1746
Code
function bakery_uncrumble_validate($form, &$form_state) {
// We are ignoring blocked status on purpose. The user is being repaired, not logged in.
$account = user_load(array(
'name' => $form_state['values']['name'],
'pass' => $form_state['values']['pass'],
));
if (!($account && $account->uid)) {
watchdog('bakery', 'Login attempt failed for %user while running uncrumble.', array(
'%user' => $form_state['values']['name'],
));
// Can't pretend that it was the "username or password" so let's be helpful instead.
form_set_error('pass', t('Sorry, unrecognized password. If you have forgotten your %site password, please <a href="@contact">contact the site administrator.</a>', array(
'%site' => variable_get('site_name', 'Drupal'),
'@contact' => variable_get('bakery_master', 'http://drupal.org/') . 'contact',
)), 'error');
}
else {
$form_state['bakery_uncrumble_account'] = $account;
}
}