diff --git a/includes/form.inc b/includes/form.inc index 18755c1..8cd4133 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -42,6 +42,7 @@ function upei_roblib_ill_form_validate($form, &$form_state) { $aid = upei_roblib_ill_authenticate($form_state['values']['campus_id'], $form_state['values']['Surname']); if (is_array($aid) && isset($aid['Problem']['Message'])) { form_set_error('Surname', $aid['Problem']['Message']); + form_set_error('campus_id', ''); } else { $form_state['storage']['aid'] = $aid; diff --git a/includes/relais.inc b/includes/relais.inc index 3d36bb3..646489b 100644 --- a/includes/relais.inc +++ b/includes/relais.inc @@ -86,7 +86,7 @@ function upei_roblib_ill_authenticate($barcode, $surname) { } $response_data = json_decode($result->data, TRUE); if ($result->code == '200') { - if (isset($response_data['Problem']) || $response_data['LastName'] !== $surname) { + if (isset($response_data['Problem']) || strtolower($response_data['LastName']) !== strtolower($surname)) { $err_message = isset($response_data['Problem']['Message']) ? $response_data['Problem']['Message'] : ''; $err_message .= t( ' Your Campus ID could be incorrect or your Last Name does not match what is stored in the profile for the user with the specified Campus ID'); $response_data['Problem']['Message'] = $err_message;