Browse Source

made last name check case insensitive

9.x-1.0
Paul Pound 8 years ago
parent
commit
0653609ad5
  1. 1
      includes/form.inc
  2. 2
      includes/relais.inc

1
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;

2
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;

Loading…
Cancel
Save