1800) ) { $_SESSION = array(); /* unset session variables */ /* kill the session cookie */ if (ini_get("session.use_cookies")) { $params = session_get_cookie_params(); setcookie(session_name(), '', time() - 42000, $params["path"], $params["domain"], $params["secure"], $params["httponly"] ); } /* unset the ucddl_clr & dl_v cookies */ setcookie("ucddl_clr", "", time() - 3600,"/"); setcookie("dl_v", "", time() - 3600,"/"); /* Zebra library function equivalent to session_destroy() */ $session->stop(); } $_SESSION['last_active'] = time(); /* update time of most recent page load */ /* is the page load a referral back from libauth? */ if (isset($_COOKIE['dl_login_referer'])) { if ($_SERVER['HTTP_REFERER'] == 'https://libauth.ucd.ie/') { $referer = $_COOKIE['dl_login_referer']; setcookie("dl_login_referer", "", time()-3600,"/"); unset($_COOKIE['dl_login_referer']); /* redirect to page from which login request was made */ header("Location: $referer"); } else { /* avoid perpetual redirect loops */ setcookie("dl_login_referer", "", time()-3600,"/"); unset($_COOKIE['dl_login_referer']); } } /* is there an explicit language preference? */ if (isset($_REQUEST['lang'])) { $lang = $_REQUEST['lang']; setcookie("pref_lang", $lang, 0, "/"); } require_once("includes/ConfigLocal.php"); $config = ConfigLocal::getInstance(); set_time_limit(60); require_once("includes/BuildPage.php"); $page = new BuildPage(); $curdir = substr(getcwd(), strrpos(getcwd(), '/') + 1); $context = $page->getContext($curdir); $curfile = basename($_SERVER['PHP_SELF']); /* refer requests for Mirador viewer */ if (isset($_REQUEST['i'])) { $focus = ''; $viewerType = ''; if (!empty($_REQUEST['i'])) { $viewerObject = $_REQUEST['i']; if (isset($_REQUEST['type'])) { if (!empty($_REQUEST['type'])) { $viewerType = $_REQUEST['type']; } } if (isset($_REQUEST['focus'])) { if (!empty($_REQUEST['focus'])) { $focus = $_REQUEST['focus']; } } include('public_html/viewers/img/mirador.php'); exit; } } if (isset($_SESSION['UID'])) { if (isset($_COOKIE['dl_sess_hist_upd'])) { /* save search history with changes made at /history */ require_once("includes/libauth.php"); $libauth = new libauth(); $aUserAttributes = $libauth->getUserAttributes($_SESSION['UID']); $libauth->saveSearchHistory($_SESSION['UID'],$_COOKIE['dl_sess_hist']); setcookie("dl_sess_hist_upd", "", time()-3600,"/"); unset($_COOKIE['dl_sess_hist_upd']); } if (!isset($_COOKIE['dl_v'])) { require_once("includes/libauth.php"); $libauth = new libauth(); $aUserAttributes = $libauth->getUserAttributes($_SESSION['UID']); /* update search history cookie form database */ if (!empty($aUserAttributes['search_history'])) { setcookie('dl_sess_hist',$aUserAttributes['search_history'],0,"/"); } else if (!empty($_COOKIE['dl_sess_hist'])) { $libauth->saveSearchHistory($_SESSION['UID'],$_COOKIE['dl_sess_hist']); } /* get other user attributes */ if (empty($aUserAttributes['firstname']) || empty($aUserAttributes['lastname']) || empty($aUserAttributes['email'])) { $context = 'profile'; } else { setcookie("dl_v","true",0,"/"); } } } /* site title */ $site_title = 'SITE_TITLE' . $config->SITE_SUFFIX; /* search history: make an associative array of searches, save to cookie */ $page_title = null; if (isset($_REQUEST['q']) || isset($_REQUEST['fq'])) { $page_title = 'Search results'; if (!empty($_COOKIE['dl_sess_hist'])) { $dl_sess_hist = json_decode($_COOKIE['dl_sess_hist'],true); } else { $dl_sess_hist = array(); } $uniqId = time() . '_' . uniqid(); $srch = $_REQUEST['q']; if (isset($_REQUEST['fq'])) { foreach ($_REQUEST['fq'] as $fq) { $srch .= '&fq[]=' . $fq; } } $srch = base64_encode($srch); if (array_search($srch,$dl_sess_hist) != FALSE) { $searchId = array_search($srch,$dl_sess_hist); } else { $dl_sess_hist[$uniqId] = $srch; setcookie('dl_sess_hist',json_encode($dl_sess_hist),0,"/"); } } /* refer requests for Mirador viewer */ if (isset($_REQUEST['i'])) { $focus = ''; $viewerType = ''; if (!empty($_REQUEST['i'])) { $viewerObject = $_REQUEST['i']; if (isset($_REQUEST['type'])) { if (!empty($_REQUEST['type'])) { $viewerType = $_REQUEST['type']; } } if (isset($_REQUEST['focus'])) { if (!empty($_REQUEST['focus'])) { $focus = $_REQUEST['focus']; } } include('public_html/viewers/img/mirador.php'); exit; } } /* content negotiation */ if ($context == 'view') { preg_match("/^.*?\.(.*?)$/",$_REQUEST['v'],$aMatches); /* content negotiation */ if (empty($aMatches)) { /* check HTTP_ACCEPT headers to negotiate content delivery */ $aAccept = array(); if (isset($_SERVER['HTTP_ACCEPT'])) { $aAccept = $page->getPreferredMimetype($_SERVER['HTTP_ACCEPT']); } if (!empty($aAccept)) { foreach ($aAccept as $key => $value) { if ($value > 1 && $value > 0) { $vary = TRUE; } } } $loopct=0; foreach ($aAccept as $key => $value) { $loopct++; switch($key) { case 'text/html': break; case 'application/xhtml+xml': break; case 'text/xml': $redirectUrl = $config['WEBAPP_BASE_URL'] . 'view/' . $_REQUEST['v'] . '.xml'; header("HTTP/1.1 302 Found"); header("Location: $redirectUrl"); if ($value == 1 && $vary == TRUE) header("Vary: Accept"); break; case 'application/rdf+xml': $redirectUrl = $config['WEBAPP_BASE_URL'] . 'data/' . $_REQUEST['v'] . '.rdf'; header("HTTP/1.1 302 Found"); header("Location: $redirectUrl"); if ($value == 1 && $vary == TRUE) header("Vary: Accept"); break; case 'text/rdf+n3': $redirectUrl = $config['WEBAPP_BASE_URL'] . 'data/' . $_REQUEST['v'] . '.n3'; header("HTTP/1.1 302 Found"); header("Location: $redirectUrl"); if ($value == 1 && $vary == TRUE) header("Vary: Accept"); break; case 'text/rdf+n3 ': $redirectUrl = $config['WEBAPP_BASE_URL'] . 'data/' . $_REQUEST['v'] . '.nt'; header("HTTP/1.1 302 Found"); header("Location: $redirectUrl"); if ($value == 1 && $vary == TRUE) header("Vary: Accept"); break; case 'text/x-nquads ': $redirectUrl = $config['WEBAPP_BASE_URL'] . 'data/' . $_REQUEST['v'] . '.nq'; header("HTTP/1.1 302 Found"); header("Location: $redirectUrl"); if ($value == 1 && $vary == TRUE) header("Vary: Accept"); break; case 'application/x-turtle': $redirectUrl = $config['WEBAPP_BASE_URL'] . 'data/' . $_REQUEST['v'] . '.ttl'; header("HTTP/1.1 302 Found"); header("Location: $redirectUrl"); if ($value == 1 && $vary == TRUE) header("Vary: Accept"); break; case 'application/trix': $redirectUrl = $config['WEBAPP_BASE_URL'] . 'data/' . $_REQUEST['v'] . '.trix'; header("HTTP/1.1 302 Found"); header("Location: $redirectUrl"); if ($value == 1 && $vary == TRUE) header("Vary: Accept"); break; case 'text/json': $redirectUrl = $config['WEBAPP_BASE_URL'] . 'data/' . $_REQUEST['v'] . '.json'; header("HTTP/1.1 302 Found"); header("Location: $redirectUrl"); if ($value == 1 && $vary == TRUE) header("Vary: Accept"); break; case 'application/trig': header("HTTP/1.1 501 Not implemented"); exit; case 'application/ld+json': header("HTTP/1.1 501 Not implemented"); exit; } } /* foreach */ } /* cache the requested object for subsequent page processing */ require_once('lib/fedora-client/FedoraObject.php'); if (isset($config['MEMCACHE'])) { $cache = $config['MEMCACHE']; } //$cachekey = 'datacache:obj_' . $_REQUEST['v']; //$results = $cache->get($cachekey); if ($results == false) { try { $obj = new FedoraObject($_REQUEST['v']); $cache->set($cachekey, serialize($obj), MEMCACHE_COMPRESSED, 60); } catch (Exception $e) { $error[0] = TRUE; $error[1] .= "

" . $e->getMessage() . "

"; } } else if (!empty($results)) { $obj = $results; } /* needed to evaluate restrictions before the object is displayed to the user */ //$obj = unserialize($results); include("includes/view_descMetadata.php"); $details = new view_descMetadata($obj); if (isset($obj)) { $coordinates = $details->getMapDetails($obj); $page_title = $details->getTitle($obj); $abstract = $details->getAbstract($obj); $mediaTypes= $details->getMediaTypes($obj); $collectionID = $details->getCollectionPID($obj); $DOI = $details->getDOI($obj); $aImageMetaTags = $details->getImageMetaTags($obj); } if (empty($abstract)) { if (!empty($title)) { $abstract = $title; } } } if ($page_title == null) { $page_title = 'Iberian Books'; } else { $page_title = 'Iberian Books - ' . $page_title; } /* manage error messages ... */ if (ini_get('display_errors')) { ini_set('display_errors', 0); } /* canonical address of page for link element */ global $canonicalUrl; $canonicalUrl = $page->getCanonicalUrl($context,$_SERVER['REQUEST_URI']); /* unAPI */ if ($context == 'view') { $unapi = $page->getUnApiLinks($_SERVER['REQUEST_URI']); } ?> */ ?> <? if (!empty($pageTitle)) { echo htmlspecialchars($pageTitle) . ' - '; } ?> */ ?>
SEARCH_ADVANCED == TRUE) { ?>


Style Switcher
Theme Colors
Theme Skins

Layout Styles

Theme Types and Versions
*/ ?> */ ?> {'action'} == 'accept') { if ($_COOKIE['dl_settings_anno'] == 'on') { if ( isset($_COOKIE['CookieScriptConsent'])) { print_r(json_decode($_COOKIE['CookieScriptConsent'])); ?>