Browse Source

use https for our proxy in eds target

2.x-ebsco
ppound 3 years ago
parent
commit
df20b07c8e
  1. 4
      targets/eds/js/eds_results_article.js
  2. 6
      targets/eds/roblib_search_eds.module
  3. 2
      targets/eds/theme/roblib-search-eds-articles.tpl.php

4
targets/eds/js/eds_results_article.js

@ -2,7 +2,7 @@ Drupal.behaviors.roblib_search_eds_articles = {
attach: function (context, settings) { attach: function (context, settings) {
$url = settings.roblib_search_eds_articles.search_url; $url = settings.roblib_search_eds_articles.search_url;
articles_profile = settings.roblib_search_eds_articles.eds_profile; articles_profile = settings.roblib_search_eds_articles.eds_profile;
proxy_url = "http://proxy.library.upei.ca/login?url="; proxy_url = "https://proxy.library.upei.ca/login?url=";
jQuery.getJSON($url, function (data) { jQuery.getJSON($url, function (data) {
var items = []; var items = [];
var numberOfDocs = 0; var numberOfDocs = 0;
@ -65,7 +65,7 @@ Drupal.behaviors.roblib_search_eds_articles = {
items.push('</div>'); items.push('</div>');
} else { } else {
items.push('<div class ="roblib-search-row roblib-eds-unauthorized" id="\' + id + \'">You must login to view this result, <a href="http://proxy.library.upei.ca/login?url=' + href_str + query_str + '" id="eds-unauthorized-result">click here to login</a></div>' );} items.push('<div class ="roblib-search-row roblib-eds-unauthorized" id="\' + id + \'">You must login to view this result, <a href="https://proxy.library.upei.ca/login?url=' + href_str + query_str + '" id="eds-unauthorized-result">click here to login</a></div>' );}
}); });
jQuery('#' + 'roblib-search-content-eds-articles').empty().append(items.join('')); jQuery('#' + 'roblib-search-content-eds-articles').empty().append(items.join(''));
} }

6
targets/eds/roblib_search_eds.module

@ -62,8 +62,8 @@ function roblib_search_eds_config_form($form, &$form_state) {
$form['roblib_search_eds_rest_url'] = array( $form['roblib_search_eds_rest_url'] = array(
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('EDS Rest endpoint'), '#title' => t('EDS Rest endpoint'),
'#default_value' => variable_get('roblib_search_eds_rest_url', 'http://eds-api.ebscohost.com/edsapi/rest'), '#default_value' => variable_get('roblib_search_eds_rest_url', 'https://eds-api.ebscohost.com/edsapi/rest'),
'#description' => t('The base EDS URL, for example http://eds-api.ebscohost.com/edsapi/rest'), '#description' => t('The base EDS URL, for example https://eds-api.ebscohost.com/edsapi/rest'),
'#required' => TRUE, '#required' => TRUE,
); );
$form['roblib_search_eds_auth_url'] = array( $form['roblib_search_eds_auth_url'] = array(
@ -339,7 +339,7 @@ function roblib_search_eds_build_config_arr($type) {
$config['profile'] = ($type === 'Books') ? variable_get('roblib_search_eds_book_profile', 'apilite') : $config['profile'] = ($type === 'Books') ? variable_get('roblib_search_eds_book_profile', 'apilite') :
variable_get('roblib_search_eds_profile', 'edsapi'); variable_get('roblib_search_eds_profile', 'edsapi');
$config['auth_url'] = variable_get('roblib_search_eds_auth_url', 'https://eds-api.ebscohost.com/Authservice/rest'); $config['auth_url'] = variable_get('roblib_search_eds_auth_url', 'https://eds-api.ebscohost.com/Authservice/rest');
$config['rest_url'] = variable_get('roblib_search_eds_rest_url', 'http://eds-api.ebscohost.com/edsapi/rest'); $config['rest_url'] = variable_get('roblib_search_eds_rest_url', 'https://eds-api.ebscohost.com/edsapi/rest');
$config['guest'] = variable_get('roblib_search_eds_guest','y'); $config['guest'] = variable_get('roblib_search_eds_guest','y');
return $config; return $config;
} }

2
targets/eds/theme/roblib-search-eds-articles.tpl.php

@ -22,7 +22,7 @@
/** /**
* Alternate way to create link back to ebscohost. * Alternate way to create link back to ebscohost.
<form action="" id = 'roblib-search-eds-articles' method="post" style="width: 375px; overflow: auto;" onsubmit="return ebscoHostSearchGo(this);"> <form action="" id = 'roblib-search-eds-articles' method="post" style="width: 375px; overflow: auto;" onsubmit="return ebscoHostSearchGo(this);">
<input id="ebscohosturl" name="ebscohosturl" type="hidden" value="http://search.ebscohost.com/login.aspx?direct=true&amp;site=ehost-live&amp;scope=site&amp;type=0&amp;custid=uprince&amp;profid=eds&amp;groupid=main&amp;mode=and&amp;cli0=RV&amp;clv0=N&amp;lang=en" /> <input id="ebscohosturl" name="ebscohosturl" type="hidden" value="https://search.ebscohost.com/login.aspx?direct=true&amp;site=ehost-live&amp;scope=site&amp;type=0&amp;custid=uprince&amp;profid=eds&amp;groupid=main&amp;mode=and&amp;cli0=RV&amp;clv0=N&amp;lang=en" />
<input id="ebscohostsearchsrc" name="ebscohostsearchsrc" type="hidden" value="url" /> <input id="ebscohostsearchmode" name="ebscohostsearchmode" type="hidden" value="+" /> <input id="ebscohostsearchsrc" name="ebscohostsearchsrc" type="hidden" value="url" /> <input id="ebscohostsearchmode" name="ebscohostsearchmode" type="hidden" value="+" />
<input id="ebscohostkeywords" name="ebscohostkeywords" type="hidden" value="" /> <input id="ebscohostkeywords" name="ebscohostkeywords" type="hidden" value="" />
<div><input id="ebscohostsearchtext" name="ebscohostsearchtext" value="history" type="hidden" size="23" style="font-size: 9pt; padding-left: 5px; margin-left: 0px;" /> <input type="submit" value="Search" style="font-size: 9pt; padding-left: 5px;" /></div> <div><input id="ebscohostsearchtext" name="ebscohostsearchtext" value="history" type="hidden" size="23" style="font-size: 9pt; padding-left: 5px; margin-left: 0px;" /> <input type="submit" value="Search" style="font-size: 9pt; padding-left: 5px;" /></div>

Loading…
Cancel
Save