Permalink
Browse files

Some clean ups of the login language and stuff.

  • Loading branch information...
onefang committed Jun 14, 2012
1 parent bdb51ac commit ea45d6cf539aca3cfeab7cc30e97d46b6f8bb7c6
Showing with 10 additions and 9 deletions.
  1. +10 −9 ui/users/d4os_ui_auth/d4os_ui_auth.module
@@ -78,13 +78,18 @@ function d4os_ui_auth_login_validate($form, &$form_state) {
break;
// grid only
case 1:
- d4os_ui_auth_grid_login($form, $form_state);
+ if (!d4os_ui_auth_grid_login($form, $form_state)) {
+ drupal_set_message(t('Grid authentication has failed. Please try again.'), 'error');
+ }
break;
// drupal -> grid
case 2:
if (!user_authenticate($form_state['values']['name'], $form_state['values']['pass'])) {
- drupal_set_message(t('Sorry, unable to log in using the website credentials. Trying grid process.'), 'error');
- d4os_ui_auth_grid_login($form, $form_state);
+ drupal_set_message(t('Sorry, unable to log in using the website credentials. Trying grid login.'), 'error');
+ if (!d4os_ui_auth_grid_login($form, $form_state)) {
+ drupal_set_message(t('Grid authentication has failed. Please try again.'), 'error');
+ user_login_final_validate($form, $form_state);
+ }
}
else {
user_login_name_validate($form, $form_state);
@@ -95,7 +100,7 @@ function d4os_ui_auth_login_validate($form, &$form_state) {
// grid -> drupal
case 3:
if (!d4os_ui_auth_grid_login($form, $form_state)) {
- drupal_set_message(t('Sorry, unable to log in using the grid credentials. Trying website process.'), 'error');
+ drupal_set_message(t('Sorry, unable to log in using the grid credentials. Trying website login.'), 'error');
user_login_name_validate($form, $form_state);
user_login_authenticate_validate($form, $form_state);
user_login_final_validate($form, $form_state);
@@ -132,22 +137,18 @@ function d4os_ui_auth_grid_login($form, &$form_state) {
$grid_account = $grid_account[0];
if (!is_object($grid_account)) {
- drupal_set_message(t('Grid authentication has failed. Please try again.'), 'error');
- user_login_final_validate($form, $form_state);
return FALSE;
}
$data = array();
// check the password
// md5(md5($pass) . ":" . $user['passwordSalt'])
if ($grid_account->passwordHash != md5(md5($pass). ':'. $grid_account->passwordSalt)) {
- drupal_set_message(t('Grid authentication has failed. Please try again.'), 'error');
- user_login_final_validate($form, $form_state);
return FALSE;
}
// log in the website
- drupal_set_message(t('Grid Authentication Success'));
+ drupal_set_message(t('Grid authentication success.'));
$account = user_load_by_name($form_state['values']['name']);
if ($account) {
global $user;

0 comments on commit ea45d6c

Please sign in to comment.