function OLAuth() {
- this.authUrl = br.olHost + '/ia_auth/' + br.bookId;
this.olConnect = false;
this.loanUUID = false;
this.permsToken = false;
if (0 == cookies[i].indexOf('loan-' + br.bookId)) {
this.permsToken = cookies[i].split('=')[1];
}
+
+ // Set olHost to use if passed in
+ if (0 == cookies[i].indexOf('ol-host')) {
+ br.olHost = 'http://' + unescape(cookies[i].split('=')[1]);
+ }
}
+ this.authUrl = br.olHost + '/ia_auth/' + br.bookId;
+
return this;
}
$uuid = $_REQUEST['uuid'];
$token = $_REQUEST['token'];
$bookPath = $_REQUEST['bookPath'];
+$olHost = $_REQUEST['olHost'];
if (!preg_match('/^\d{10}-[0-9a-f]{32}$/', $token)) {
fatal();
setcookie('br-loan-' . $id, $uuid, 0, '/', '.archive.org');
setcookie('loan-' . $id, $token, 0, '/', '.archive.org');
+setcookie('ol-host', $olHost, 0, '/', '.archive.org');
header('Location: ' . $bookPath);