Browse Source

updated the error message we show to the end user on authentication type errors

9.x-1.0
Paul Pound 8 years ago
parent
commit
87923e9a6d
  1. 13
      includes/relais.inc
  2. 2
      includes/utilities.inc

13
includes/relais.inc

@ -108,8 +108,7 @@ function upei_roblib_ill_authenticate($barcode, $surname) {
if ($result->code == '200') {
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;
$response_data['Problem']['Message'] = upei_roblib_ill_build_err_msg($err_message);
return $response_data;
}
$aid = $response_data['AuthorizationId'];
@ -117,3 +116,13 @@ function upei_roblib_ill_authenticate($barcode, $surname) {
return isset($aid) ? $aid : $response_data;
}
function upei_roblib_ill_build_err_msg($msg_from_server) {
$campus_id = l(t('Campus ID'), 'http://www.upei.ca/vpaf/campuscard');
$ill_email = l(t('ill@upei.ca'), 'mailto:ill@upei.ca');
$phone = l(t('902-566-0583'), 'tel:902-566-0353');
return t('Oops. Something went wrong.<br />Check the "Your Last Name" and "Your Campus ID" fields - those two need to match what is on file
. (Your !campus_id appears as the NUMBER near the middle of your campus card). If you do not have a !campus_id, please contact the Robertson Library Service Desk, or,
call !phone. Note: if you are a student taking online courses only, please email !ill_email.<br />Server response: @msg_from_server',
array('!campus_id' => $campus_id, '!ill_email' => $ill_email, '!phone' => $phone, '@msg_from_server' => $msg_from_server));
}

2
includes/utilities.inc

@ -14,7 +14,7 @@ function upei_roblib_ill_check_arr_item(&$value, $key) {
if(is_array($value)) {
array_walk($value, 'upei_roblib_ill_check_arr_item');
} else {
$value = check_plain($value);
$value = filter_xss($value);
}
}

Loading…
Cancel
Save